diff options
Diffstat (limited to 'src')
104 files changed, 2069 insertions, 1316 deletions
diff --git a/src/emu/bus/msx_cart/cartridge.c b/src/emu/bus/msx_cart/cartridge.c index c8dfb3da9b8..9415ab2f3c0 100644 --- a/src/emu/bus/msx_cart/cartridge.c +++ b/src/emu/bus/msx_cart/cartridge.c @@ -16,6 +16,7 @@ #include "konami.h" #include "korean.h" #include "majutsushi.h" +#include "moonsound.h" #include "msx_audio.h" #include "msxdos2.h" #include "nomapper.h" @@ -61,6 +62,7 @@ SLOT_INTERFACE_START(msx_cart) SLOT_INTERFACE_INTERNAL("disk_fsfd1a", MSX_CART_FSFD1A) SLOT_INTERFACE_INTERNAL("disk_fscf351", MSX_CART_FSCF351) SLOT_INTERFACE("bm_012", MSX_CART_BM_012) + SLOT_INTERFACE("moonsound", MSX_CART_MOONSOUND) SLOT_INTERFACE_END diff --git a/src/emu/bus/msx_cart/moonsound.c b/src/emu/bus/msx_cart/moonsound.c new file mode 100644 index 00000000000..b8601335917 --- /dev/null +++ b/src/emu/bus/msx_cart/moonsound.c @@ -0,0 +1,124 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +/********************************************************************************** + +TODO: +- Properly hook up correct SRAM sizes for different moonsound compatible + cartridges. (Original moonsound has 128KB SRAM) +- Fix FM support (ymf262 support needs to be added to ymf278b). + +**********************************************************************************/ + +#include "emu.h" +#include "moonsound.h" + + +#define VERBOSE 0 +#define LOG(x) do { if (VERBOSE) logerror x; } while (0) + + +const device_type MSX_CART_MOONSOUND = &device_creator<msx_cart_moonsound>; + + +msx_cart_moonsound::msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, MSX_CART_MOONSOUND, "MSX Cartridge - MoonSound", tag, owner, clock, "msx_cart_moonsound", __FILE__) + , msx_cart_interface(mconfig, *this) + , m_ymf278b(*this, "ymf278b") +{ +} + + +static ADDRESS_MAP_START( ymf278b_map, AS_0, 8, msx_cart_moonsound ) + AM_RANGE(0x000000, 0x1fffff) AM_ROM + AM_RANGE(0x200000, 0x3fffff) AM_RAM // 2MB sram for testing +ADDRESS_MAP_END + + +static MACHINE_CONFIG_FRAGMENT( moonsound ) + // The moonsound cartridge has a separate stereo output. + MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SOUND_ADD("ymf278b", YMF278B, YMF278B_STD_CLOCK) + MCFG_DEVICE_ADDRESS_MAP(AS_0, ymf278b_map) + MCFG_YMF278B_IRQ_HANDLER(WRITELINE(msx_cart_moonsound,irq_w)) + MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) + MCFG_SOUND_ROUTE(1, "rspeaker", 0.50) +MACHINE_CONFIG_END + + +machine_config_constructor msx_cart_moonsound::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( moonsound ); +} + + +ROM_START( msx_cart_moonsound ) + ROM_REGION(0x400000, "ymf278b", 0) + ROM_LOAD("yrw801.rom", 0x0, 0x200000, CRC(2a9d8d43) SHA1(32760893ce06dbe3930627755ba065cc3d8ec6ca)) +ROM_END + + +const rom_entry *msx_cart_moonsound::device_rom_region() const +{ + return ROM_NAME( msx_cart_moonsound ); +} + + +void msx_cart_moonsound::device_start() +{ + m_out_irq_cb.resolve_safe(); + + // Install IO read/write handlers + address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO); + space.install_readwrite_handler(0x7e, 0x7f, read8_delegate(FUNC(msx_cart_moonsound::read_ymf278b_pcm), this), write8_delegate(FUNC(msx_cart_moonsound::write_ymf278b_pcm), this)); + space.install_readwrite_handler(0xc4, 0xc7, read8_delegate(FUNC(msx_cart_moonsound::read_ymf278b_fm), this), write8_delegate(FUNC(msx_cart_moonsound::write_ymf278b_fm), this)); + space.install_read_handler(0xc0, 0xc0, read8_delegate(FUNC(msx_cart_moonsound::read_c0), this)); +} + + +void msx_cart_moonsound::device_reset() +{ +} + + +WRITE_LINE_MEMBER(msx_cart_moonsound::irq_w) +{ + LOG(("moonsound: irq state %d\n", state)); + m_out_irq_cb(state); +} + + +WRITE8_MEMBER(msx_cart_moonsound::write_ymf278b_fm) +{ + LOG(("moonsound: write 0x%02x, data 0x%02x\n", 0xc4 + offset, data)); + m_ymf278b->write(space, offset, data); +} + + +READ8_MEMBER(msx_cart_moonsound::read_ymf278b_fm) +{ + LOG(("moonsound: read 0x%02x\n", 0xc4 + offset)); + return m_ymf278b->read(space, offset); +} + + +WRITE8_MEMBER(msx_cart_moonsound::write_ymf278b_pcm) +{ + LOG(("moonsound: write 0x%02x, data 0x%02x\n", 0x7e + offset, data)); + m_ymf278b->write(space, 4 + offset, data); +} + + +READ8_MEMBER(msx_cart_moonsound::read_ymf278b_pcm) +{ + LOG(("moonsound: read 0x%02x\n", 0x7e + offset)); + return m_ymf278b->read(space, 4 + offset); +} + + +// For detecting presence of moonsound cartridge +READ8_MEMBER(msx_cart_moonsound::read_c0) +{ + LOG(("moonsound: read 0xc0\n")); + return 0x00; +} + diff --git a/src/emu/bus/msx_cart/moonsound.h b/src/emu/bus/msx_cart/moonsound.h new file mode 100644 index 00000000000..930fedb363c --- /dev/null +++ b/src/emu/bus/msx_cart/moonsound.h @@ -0,0 +1,38 @@ +// license:BSD-3-Clause +// copyright-holders:Wilbert Pol +#ifndef __MSX_CART_MOONSOUND_H +#define __MSX_CART_MOONSOUND_H + +#include "bus/msx_cart/cartridge.h" +#include "sound/ymf278b.h" + + +extern const device_type MSX_CART_MOONSOUND; + + +class msx_cart_moonsound : public device_t + , public msx_cart_interface +{ +public: + msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; + + DECLARE_WRITE8_MEMBER(write_ymf278b_fm); + DECLARE_READ8_MEMBER(read_ymf278b_fm); + DECLARE_WRITE8_MEMBER(write_ymf278b_pcm); + DECLARE_READ8_MEMBER(read_ymf278b_pcm); + DECLARE_READ8_MEMBER(read_c0); + DECLARE_WRITE_LINE_MEMBER(irq_w); + +private: + required_device<ymf278b_device> m_ymf278b; + +}; + + +#endif diff --git a/src/emu/bus/ti99_peb/hfdc.c b/src/emu/bus/ti99_peb/hfdc.c index f4facb82034..ed73221837a 100644 --- a/src/emu/bus/ti99_peb/hfdc.c +++ b/src/emu/bus/ti99_peb/hfdc.c @@ -1012,7 +1012,9 @@ SLOT_INTERFACE_END static SLOT_INTERFACE_START( hfdc_harddisks ) SLOT_INTERFACE( "generic", MFMHD_GENERIC ) // Generic high-level emulation - SLOT_INTERFACE( "st225", MFMHD_ST225 ) // Seagate ST-225 and others + SLOT_INTERFACE( "st213", MFMHD_ST213 ) // Seagate ST-213 (10 MB) + SLOT_INTERFACE( "st225", MFMHD_ST225 ) // Seagate ST-225 (20 MB) + SLOT_INTERFACE( "st251", MFMHD_ST251 ) // Seagate ST-251 (40 MB) SLOT_INTERFACE_END MACHINE_CONFIG_FRAGMENT( ti99_hfdc ) @@ -1030,9 +1032,9 @@ MACHINE_CONFIG_FRAGMENT( ti99_hfdc ) MCFG_FLOPPY_DRIVE_ADD("f4", hfdc_floppies, NULL, myarc_hfdc_device::floppy_formats) // NB: Hard disks don't go without image (other than floppy drives) - MCFG_MFM_HARDDISK_CONN_ADD("h1", hfdc_harddisks, NULL, MFM_BYTE, 3000, 20) - MCFG_MFM_HARDDISK_CONN_ADD("h2", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20) - MCFG_MFM_HARDDISK_CONN_ADD("h3", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20) + MCFG_MFM_HARDDISK_CONN_ADD("h1", hfdc_harddisks, NULL, MFM_BYTE, 3000, 20, MFMHD_TI99_FORMAT) + MCFG_MFM_HARDDISK_CONN_ADD("h2", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20, MFMHD_TI99_FORMAT) + MCFG_MFM_HARDDISK_CONN_ADD("h3", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20, MFMHD_TI99_FORMAT) MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0) MCFG_MM58274C_MODE24(1) // 24 hour diff --git a/src/emu/cpu/sm510/sm510.c b/src/emu/cpu/sm510/sm510.c index c428eb76e40..09029709849 100644 --- a/src/emu/cpu/sm510/sm510.c +++ b/src/emu/cpu/sm510/sm510.c @@ -8,7 +8,7 @@ - SM512: 4Kx8 ROM, 128x4 RAM(48x4 for LCD), melody controller Other chips that may be in the same family, investigate more when one of - them needs to get emulated: SM500, SM530, SM531, .. + them needs to get emulated: SM500, SM530/31, SM4A, SM3903, .. References: - 1990 Sharp Microcomputers Data Book diff --git a/src/emu/cpu/sm510/sm510op.c b/src/emu/cpu/sm510/sm510op.c index 91dd26d1ccb..bb0f4975511 100644 --- a/src/emu/cpu/sm510/sm510op.c +++ b/src/emu/cpu/sm510/sm510op.c @@ -57,10 +57,22 @@ inline UINT8 sm510_base_device::bitmask(UINT16 param) void sm510_base_device::op_lb() { // LB x: load BM/BL with 4-bit immediate value (partial) + + // SM510 WIP.. + // bm and bl(low) are probably ok! m_bm = (m_bm & 4) | (m_op & 3); - m_bl = m_op >> 2 & 3; - if (m_bl == 3) - m_bl |= 0xc; + m_bl = (m_op >> 2 & 3); + + // bl(high) is still unclear, official doc is confusing + UINT8 hi = 0; + switch (m_bl) + { + case 0: hi = 3; break; + case 1: hi = 0; break; + case 2: hi = 0; break; + case 3: hi = 3; break; + } + m_bl |= (hi << 2 & 0xc); } void sm510_base_device::op_lbl() diff --git a/src/emu/machine/netlist.c b/src/emu/machine/netlist.c index 355199a8328..8db7fa3feb4 100644 --- a/src/emu/machine/netlist.c +++ b/src/emu/machine/netlist.c @@ -100,7 +100,7 @@ void netlist_mame_analog_output_t::custom_netlist_additions(netlist::setup_t &se pstring dname = "OUT_" + m_in; m_delegate.bind_relative_to(owner()->machine().root_device()); NETLIB_NAME(analog_callback) *dev = downcast<NETLIB_NAME(analog_callback) *>( - setup.register_dev("nld_analog_callback", dname)); + setup.register_dev("NETDEV_CALLBACK", dname)); dev->register_callback(m_delegate); setup.register_link(dname + ".IN", m_in); @@ -173,7 +173,7 @@ void netlist_mame_stream_input_t::custom_netlist_additions(netlist::setup_t &set { NETLIB_NAME(sound_in) *snd_in = setup.netlist().get_first_device<NETLIB_NAME(sound_in)>(); if (snd_in == NULL) - snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.register_dev("nld_sound_in", "STREAM_INPUT")); + snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.register_dev("NETDEV_SOUND_IN", "STREAM_INPUT")); pstring sparam = pstring::sprintf("STREAM_INPUT.CHAN%d", m_channel); setup.register_param(sparam, m_param_name); @@ -213,7 +213,7 @@ void netlist_mame_stream_output_t::custom_netlist_additions(netlist::setup_t &se pstring sname = pstring::sprintf("STREAM_OUT_%d", m_channel); //snd_out = dynamic_cast<NETLIB_NAME(sound_out) *>(setup.register_dev("nld_sound_out", sname)); - setup.register_dev("nld_sound_out", sname); + setup.register_dev("NETDEV_SOUND_OUT", sname); setup.register_param(sname + ".CHAN" , m_channel); setup.register_param(sname + ".MULT", m_mult); diff --git a/src/emu/machine/ti99_hd.c b/src/emu/machine/ti99_hd.c index 5895d6a0243..f6f3344f94a 100644 --- a/src/emu/machine/ti99_hd.c +++ b/src/emu/machine/ti99_hd.c @@ -34,6 +34,7 @@ #define TRACE_TIMING 0 #define TRACE_IMAGE 0 #define TRACE_STATE 1 +#define TRACE_CONFIG 1 enum { @@ -51,7 +52,6 @@ enum }; #define TRACKSLOTS 5 -#define TRACKIMAGE_SIZE 10416 // Provide the buffer for a complete track, including preambles and gaps #define OFFLIMIT -1 @@ -69,8 +69,19 @@ mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_t { m_spinupms = 10000; m_cachelines = TRACKSLOTS; - m_max_cylinder = 0; + m_max_cylinders = 0; + m_phys_cylinders = 0; // We will get this value for generic drives from the image m_max_heads = 0; + m_cell_size = 100; + m_rpm = 3600; // MFM drives have a revolution rate of 3600 rpm (i.e. 60/sec) + m_trackimage_size = (int)((60000000000L / (m_rpm * m_cell_size)) / 16 + 1); + m_cache = NULL; + // We will calculate default values from the time specs later. + m_seeknext_time = 0; + m_maxseek_time = 0; + m_actual_cylinders = 0; + m_park_pos = 0; + m_interleave = 0; } mfm_harddisk_device::~mfm_harddisk_device() @@ -84,17 +95,15 @@ void mfm_harddisk_device::device_start() m_seek_timer = timer_alloc(SEEK_TM); m_cache_timer = timer_alloc(CACHE_TM); - m_rev_time = attotime::from_hz(60); + m_rev_time = attotime::from_hz(m_rpm/60); + m_index_timer->adjust(attotime::from_hz(m_rpm/60), 0, attotime::from_hz(m_rpm/60)); - // MFM drives have a revolution rate of 3600 rpm (i.e. 60/sec) - m_index_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); - - m_current_cylinder = 615; // Park position + m_current_cylinder = m_park_pos; // Park position m_spinup_timer->adjust(attotime::from_msec(m_spinupms)); m_cache = global_alloc(mfmhd_trackimage_cache); - // In 5 second period, check whether the cache has dirty lines + // In 5 second periods, check whether the cache has dirty lines m_cache_timer->adjust(attotime::from_msec(5000), 0, attotime::from_msec(5000)); } @@ -111,15 +120,80 @@ void mfm_harddisk_device::device_reset() void mfm_harddisk_device::device_stop() { - global_free(m_cache); + if (m_cache!=NULL) global_free(m_cache); } +/* + Load the image from the CHD. We also calculate the head timing here + because we need the number of cylinders, and for generic drives we get + them from the CHD. +*/ bool mfm_harddisk_device::call_load() { bool loaded = harddisk_image_device::call_load(); if (loaded==IMAGE_INIT_PASS) { - m_cache->init(get_chd_file(), tag(), m_max_cylinder, m_max_heads, m_cachelines, m_encoding); + std::string metadata; + chd_file* chdfile = get_chd_file(); + + if (chdfile==NULL) + { + logerror("%s: chdfile is null\n", tag()); + return IMAGE_INIT_FAIL; + } + + // Read the hard disk metadata + chd_error state = chdfile->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata); + if (state != CHDERR_NONE) + { + logerror("%s: Failed to read CHD metadata\n", tag()); + return IMAGE_INIT_FAIL; + } + + if (TRACE_CONFIG) logerror("%s: CHD metadata: %s\n", tag(), metadata.c_str()); + + // Parse the metadata + int imagecyls; + int imageheads; + int imagesecpt; + int imagesecsz; + + if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &imagecyls, &imageheads, &imagesecpt, &imagesecsz) != 4) + { + logerror("%s: Invalid CHD metadata\n", tag()); + return IMAGE_INIT_FAIL; + } + + if (TRACE_CONFIG) logerror("%s: CHD image has geometry cyl=%d, head=%d, sect=%d, size=%d\n", tag(), imagecyls, imageheads, imagesecpt, imagesecsz); + + if (m_max_cylinders != 0 && (imagecyls != m_max_cylinders || imageheads != m_max_heads)) + { + throw emu_fatalerror("Image geometry does not fit this kind of hard drive: drive=(%d,%d), image=(%d,%d)", m_max_cylinders, m_max_heads, imagecyls, imageheads); + } + + m_cache->init(chdfile, tag(), m_trackimage_size, imagecyls, imageheads, imagesecpt, m_cachelines, m_encoding, m_format); + + // Head timing + // We assume that the real times are 80% of the max times + // The single-step time includes the settle time, so does the max time + // From that we calculate the actual cylinder-by-cylinder time and the settle time + + m_actual_cylinders = m_cache->get_cylinders(); + if (m_phys_cylinders == 0) m_phys_cylinders = m_actual_cylinders+1; + + m_park_pos = m_phys_cylinders-1; + + float realnext = (m_seeknext_time==0)? 10 : (m_seeknext_time * 0.8); + float realmax = (m_maxseek_time==0)? (m_actual_cylinders * 0.2) : (m_maxseek_time * 0.8); + float settle_us = ((m_actual_cylinders-1.0) * realnext - realmax) / (m_actual_cylinders-2.0) * 1000; + float step_us = realnext * 1000 - settle_us; + if (TRACE_CONFIG) logerror("%s: Calculated settle time: %0.2f ms, step: %d us\n", tag(), settle_us/1000, (int)step_us); + + m_settle_time = attotime::from_usec((int)settle_us); + m_step_time = attotime::from_usec((int)step_us); + + m_current_cylinder = m_park_pos; + m_interleave = m_format->get_interleave(); } else { @@ -130,7 +204,17 @@ bool mfm_harddisk_device::call_load() void mfm_harddisk_device::call_unload() { - m_cache->cleanup(); + if (m_cache!=NULL) + { + m_cache->cleanup(); + + if (m_interleave != m_format->get_interleave()) + { + logerror("%s: Interleave changed from %d to %d; committing to CHD\n", tag(), m_interleave, m_format->get_interleave()); + } + } + + // TODO: If interleave changed, commit that to CHD harddisk_image_device::call_unload(); } @@ -176,7 +260,7 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int switch (id) { case INDEX_TM: - /* Simple index hole handling. We assume that there is only a short pulse. */ + // Simple index hole handling. We assume that there is only a short pulse. m_revolution_start_time = machine().time(); if (!m_index_pulse_cb.isnull()) { @@ -207,7 +291,7 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int { // Start the settle timer m_step_phase = STEP_SETTLE; - m_seek_timer->adjust(attotime::from_usec(16800)); + m_seek_timer->adjust(m_settle_time); if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Arrived at target cylinder %d, settling ...\n", tag(), m_current_cylinder); } break; @@ -241,7 +325,7 @@ void mfm_harddisk_device::recalibrate() { if (TRACE_STEPS) logerror("%s: Recalibrate to track 0\n", tag()); direction_in_w(CLEAR_LINE); - while (-m_track_delta < 620) + while (-m_track_delta < m_phys_cylinders) { step_w(ASSERT_LINE); step_w(CLEAR_LINE); @@ -254,14 +338,16 @@ void mfm_harddisk_device::head_move() if (steps < 0) steps = -steps; if (TRACE_STEPS) logerror("%s: Moving head by %d step(s) %s\n", tag(), steps, (m_track_delta<0)? "outward" : "inward"); - int disttime = steps*200; + // We simulate the head movement by pausing for n*step_time with n being the cylinder delta m_step_phase = STEP_MOVING; - m_seek_timer->adjust(attotime::from_usec(disttime)); + m_seek_timer->adjust(m_step_time * steps); + + if (TRACE_TIMING) logerror("%s: Head movement takes %s time\n", tag(), tts(m_step_time * steps).c_str()); // We pretend that we already arrived // TODO: Check auto truncation? m_current_cylinder += m_track_delta; if (m_current_cylinder < 0) m_current_cylinder = 0; - if (m_current_cylinder > 670) m_current_cylinder = 670; + if (m_current_cylinder >= m_actual_cylinders) m_current_cylinder = m_actual_cylinders-1; m_track_delta = 0; } @@ -303,14 +389,6 @@ void mfm_harddisk_device::direction_in_w(line_state line) - When the timer expires (mode=settle) - When the counter is not zero, go to (1) - When the counter is zero, signal seek_complete; done - - Step timing: - per track = 20 ms max, full seek: 150 ms max (615 tracks); both including settling time - We assume t(1) = 17; t(615)=140 - t(i) = s+d*i - s=(615*t(1)-t(615))/614 - d=t(1)-s - s=16800 us, d=200 us */ void mfm_harddisk_device::step_w(line_state line) @@ -328,12 +406,12 @@ void mfm_harddisk_device::step_w(line_state line) // Counter will be adjusted according to the direction (+-1) m_track_delta += (m_seek_inward)? +1 : -1; if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Got seek pulse; track delta %d\n", tag(), m_track_delta); - if (m_track_delta < -670 || m_track_delta > 670) + if (m_track_delta < -m_phys_cylinders || m_track_delta > m_phys_cylinders) { if (TRACE_STEPS) logerror("%s: Excessive step pulses - doing auto-truncation\n", tag()); m_autotruncation = true; } - m_seek_timer->adjust(attotime::from_usec(250)); + m_seek_timer->adjust(attotime::from_usec(250)); // Start step collect timer } m_step_line = line; } @@ -345,25 +423,27 @@ void mfm_harddisk_device::step_w(line_state line) */ bool mfm_harddisk_device::find_position(attotime &from_when, const attotime &limit, int &bytepos, int &bit) { + // Frequency + UINT32 freq = 1000000000/m_cell_size; + // As we stop some few cells early each track, we adjust our position // to the track start if (from_when < m_revolution_start_time) from_when = m_revolution_start_time; // Calculate the position in the track, given the from_when time and the revolution_start_time. - // Each cell takes 100 ns (@10 MHz) - int cell = (from_when - m_revolution_start_time).as_ticks(10000000); + int cell = (from_when - m_revolution_start_time).as_ticks(freq); - from_when += attotime::from_nsec((m_encoding==MFM_BITS)? 100 : 1600); + from_when += attotime::from_nsec((m_encoding==MFM_BITS)? m_cell_size : (16*m_cell_size)); if (from_when > limit) return true; bytepos = cell / 16; // Reached the end - if (bytepos >= 10416) + if (bytepos >= m_trackimage_size) { if (TRACE_TIMING) logerror("%s: Reached end: rev_start = %s, live = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(from_when).c_str()); m_revolution_start_time += m_rev_time; - cell = (from_when - m_revolution_start_time).as_ticks(10000000); + cell = (from_when - m_revolution_start_time).as_ticks(freq); bytepos = cell / 16; } @@ -464,15 +544,48 @@ mfm_hd_generic_device::mfm_hd_generic_device(const machine_config &mconfig, cons const device_type MFMHD_GENERIC = &device_creator<mfm_hd_generic_device>; +/* + Various models. +*/ +mfm_hd_st213_device::mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +: mfm_harddisk_device(mconfig, MFMHD_ST213, "Seagate ST-213 MFM hard disk", tag, owner, clock, "mfm_hd_st213", __FILE__) +{ + m_phys_cylinders = 670; + m_max_cylinders = 615; // 0..614 + m_park_pos = 620; + m_max_heads = 2; + m_seeknext_time = 20; // time for one step including settle time + m_maxseek_time = 150; +} + +const device_type MFMHD_ST213 = &device_creator<mfm_hd_st213_device>; + mfm_hd_st225_device::mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : mfm_harddisk_device(mconfig, MFMHD_ST225, "Seagate ST-225 MFM hard disk", tag, owner, clock, "mfm_hd_st225", __FILE__) { - m_max_cylinder = 615; + m_phys_cylinders = 670; + m_max_cylinders = 615; + m_park_pos = 620; m_max_heads = 4; + m_seeknext_time = 20; + m_maxseek_time = 150; } const device_type MFMHD_ST225 = &device_creator<mfm_hd_st225_device>; +mfm_hd_st251_device::mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +: mfm_harddisk_device(mconfig, MFMHD_ST251, "Seagate ST-251 MFM hard disk", tag, owner, clock, "mfm_hd_st251", __FILE__) +{ + m_phys_cylinders = 821; + m_max_cylinders = 820; + m_park_pos = 820; + m_max_heads = 6; + m_seeknext_time = 8; + m_maxseek_time = 70; +} + +const device_type MFMHD_ST251 = &device_creator<mfm_hd_st251_device>; + // =========================================================== // Track cache // The cache holds track images to be read by the controller. @@ -483,6 +596,7 @@ mfmhd_trackimage_cache::mfmhd_trackimage_cache(): m_tracks(NULL) { m_current_crc = 0; + m_tracksize = 0; } mfmhd_trackimage_cache::~mfmhd_trackimage_cache() @@ -507,8 +621,9 @@ void mfmhd_trackimage_cache::write_back_one() { if (current->dirty) { - if (TRACE_CACHE) logerror("%s: MFM HD cache: write back line c=%d h=%d\n", tag(), current->cylinder, current->head); - write_back(current); + // write_track(m_chd, current->encdata, m_tracksize, current->cylinder, current->head); + m_format->save(tag(), m_chd, current->encdata, m_encoding, m_tracksize, current->cylinder, current->head, m_cylinders, m_heads, m_sectors_per_track); + current->dirty = false; break; } mfmhd_trackimage* currenttmp = current->next; @@ -525,7 +640,12 @@ void mfmhd_trackimage_cache::cleanup() while (current != NULL) { if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", tag(), current->cylinder, current->head); - if (current->dirty) write_back(current); + if (current->dirty) + { + // write_track(m_chd, current->encdata, m_tracksize, current->cylinder, current->head); + m_format->save(tag(), m_chd, current->encdata, m_encoding, m_tracksize, current->cylinder, current->head, m_cylinders, m_heads, m_sectors_per_track); + current->dirty = false; + } mfmhd_trackimage* currenttmp = current->next; current = currenttmp; } @@ -545,7 +665,7 @@ const char *encnames[] = { "MFM_BITS","MFM_BYTE","SEPARATE","SSIMPLE " }; /* Initialize the cache by loading the first <trackslots> tracks. */ -void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int maxcyl, int maxhead, int trackslots, mfmhd_enc_t encoding) +void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int tracksize, int imagecyl, int imageheads, int imagesecpt, int trackslots, mfmhd_enc_t encoding, mfmhd_image_format_t* format) { m_encoding = encoding; m_tagdev = dtag; @@ -555,33 +675,13 @@ void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int maxcy mfmhd_trackimage* previous = NULL; mfmhd_trackimage* current = NULL; std::string metadata; - m_calc_interleave = 0; + m_tracksize = tracksize; m_chd = chdfile; - - if (chdfile==NULL) - { - logerror("%s: chdfile is null\n", tag()); - return; - } - - // Read the hard disk metadata - state = chdfile->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata); - if (state != CHDERR_NONE) - { - throw emu_fatalerror("Failed to read CHD metadata"); - } - - // Parse the metadata - if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &m_cylinders, &m_heads, &m_sectors_per_track, &m_sectorsize) != 4) - { - throw emu_fatalerror("Invalid metadata"); - } - - if (maxcyl != 0 && m_cylinders > maxcyl) - { - throw emu_fatalerror("Image geometry does not fit this kind of hard drive: drive=(%d,%d), image=(%d,%d)", maxcyl, maxhead, m_cylinders, m_heads); - } + m_format = format; + m_cylinders = imagecyl; + m_heads = imageheads; + m_sectors_per_track = imagesecpt; // Load some tracks into the cache int track = 0; @@ -592,10 +692,16 @@ void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int maxcy if (TRACE_CACHE && TRACE_DETAIL) logerror("%s: MFM HD allocate cache slot\n", tag()); previous = current; current = global_alloc(mfmhd_trackimage); - current->encdata = global_alloc_array(UINT16, TRACKIMAGE_SIZE); + current->encdata = global_alloc_array(UINT16, tracksize); // Load the first tracks into the slots - state = load_track(current, cylinder, head, 32, 256, 4); + // state = load_track(m_chd, current->encdata, m_tracksize, cylinder, head); + + state = m_format->load(tag(), m_chd, current->encdata, m_encoding, m_tracksize, cylinder, head, m_cylinders, m_heads, m_sectors_per_track); + + current->dirty = false; + current->cylinder = cylinder; + current->head = head; if (state != CHDERR_NONE) throw emu_fatalerror("Cannot load (c=%d,h=%d) from hard disk", cylinder, head); @@ -619,39 +725,6 @@ void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int maxcy } /* - Returns the linear sector number, given the CHS data. - - C,H,S - | 0,0,0 | 0,0,1 | 0,0,2 | ... - | 0,1,0 | 0,1,1 | 0,1,2 | ... - ... - | 1,0,0 | ... - ... -*/ -int mfmhd_trackimage_cache::chs_to_lba(int cylinder, int head, int sector) -{ - if ((cylinder < m_cylinders) && (head < m_heads) && (sector < m_sectors_per_track)) - { - return (cylinder * m_heads + head) * m_sectors_per_track + sector; - } - else return -1; -} - -/* - Calculate the ident byte from the cylinder. The specification does not - define idents beyond cylinder 1023, but formatting programs seem to - continue with 0xfd for cylinders between 1024 and 2047. -*/ -UINT8 mfmhd_trackimage_cache::cylinder_to_ident(int cylinder) -{ - if (cylinder < 256) return 0xfe; - if (cylinder < 512) return 0xff; - if (cylinder < 768) return 0xfc; - return 0xfd; -} - - -/* Delivers the track image. First look up the track image in the cache. If not present, load it from the CHD, convert it, and evict the least recently used line. @@ -700,29 +773,86 @@ UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head) current = previous->next; if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line (c=%d,h=%d)\n", tag(), current->cylinder, current->head); - if (current->dirty) write_back(current); - state = load_track(current, cylinder, head, 32, 256, 4); + if (current->dirty) + { + // write_track(m_chd, current->encdata, m_tracksize, current->cylinder, current->head); + m_format->save(tag(), m_chd, current->encdata, m_encoding, m_tracksize, current->cylinder, current->head, m_cylinders, m_heads, m_sectors_per_track); + current->dirty = false; + } + + // state = load_track(m_chd, current->encdata, m_tracksize, cylinder, head); + state = m_format->load(tag(), m_chd, current->encdata, m_encoding, m_tracksize, cylinder, head, m_cylinders, m_heads, m_sectors_per_track); + + current->dirty = false; + current->cylinder = cylinder; + current->head = head; } // If we are here we have a CHD error. return NULL; } -/* - Create MFM encoding. -*/ -void mfmhd_trackimage_cache::mfm_encode(mfmhd_trackimage* slot, int& position, UINT8 byte, int count) +// ================================================================ + +mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock): + device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__), + device_slot_interface(mconfig, *this) { - mfm_encode_mask(slot, position, byte, count, 0x00); } -void mfmhd_trackimage_cache::mfm_encode_a1(mfmhd_trackimage* slot, int& position) +mfm_harddisk_connector::~mfm_harddisk_connector() +{ +} + +mfm_harddisk_device* mfm_harddisk_connector::get_device() +{ + return dynamic_cast<mfm_harddisk_device *>(get_card_device()); +} + +void mfm_harddisk_connector::configure(mfmhd_enc_t encoding, int spinupms, int cache, const mfmhd_format_type format) +{ + m_encoding = encoding; + m_spinupms = spinupms; + m_cachesize = cache; + m_format = format(); +} + +void mfm_harddisk_connector::device_config_complete() +{ + mfm_harddisk_device *dev = get_device(); + if (dev != NULL) + { + dev->set_encoding(m_encoding); + dev->set_spinup_time(m_spinupms); + dev->set_cache_size(m_cachesize); + dev->set_format(m_format); + } +} + +const device_type MFM_HD_CONNECTOR = &device_creator<mfm_harddisk_connector>; + +// ================================================================ + +mfmhd_image_format_t::mfmhd_image_format_t() +{ +}; + +mfmhd_image_format_t::~mfmhd_image_format_t() +{ +}; + +void mfmhd_image_format_t::mfm_encode(UINT16* trackimage, int& position, UINT8 byte, int count) +{ + mfm_encode_mask(trackimage, position, byte, count, 0x00); +} + +void mfmhd_image_format_t::mfm_encode_a1(UINT16* trackimage, int& position) { m_current_crc = 0xffff; - mfm_encode_mask(slot, position, 0xa1, 1, 0x04); + mfm_encode_mask(trackimage, position, 0xa1, 1, 0x04); // 0x443b; CRC for A1 } -void mfmhd_trackimage_cache::mfm_encode_mask(mfmhd_trackimage* slot, int& position, UINT8 byte, int count, int mask) +void mfmhd_image_format_t::mfm_encode_mask(UINT16* trackimage, int& position, UINT8 byte, int count, int mask) { UINT16 encclock = 0; UINT16 encdata = 0; @@ -768,7 +898,7 @@ void mfmhd_trackimage_cache::mfm_encode_mask(mfmhd_trackimage* slot, int& positi else encclock <<= 8; - slot->encdata[position++] = (encclock | encdata); + trackimage[position++] = (encclock | encdata); // When we write the byte multiple times, check whether the next encoding // differs from the previous because of the last bit @@ -781,19 +911,103 @@ void mfmhd_trackimage_cache::mfm_encode_mask(mfmhd_trackimage* slot, int& positi for (int j=1; j < count; j++) { - slot->encdata[position++] = (encclock | encdata); + trackimage[position++] = (encclock | encdata); m_current_crc = ccitt_crc16_one(m_current_crc, byte); } } +UINT8 mfmhd_image_format_t::mfm_decode(UINT16 raw) +{ + unsigned int value = 0; + + for (int i=0; i < 8; i++) + { + value <<= 1; + + value |= (raw & 0x4000); + raw <<= 2; + } + return (value >> 14) & 0xff; +} + +/* + For debugging. Outputs the byte array in a xxd-like way. +*/ +void mfmhd_image_format_t::showtrack(UINT16* enctrack, int length) +{ + for (int i=0; i < length; i+=16) + { + logerror("%07x: ", i); + for (int j=0; j < 16; j++) + { + logerror("%04x ", enctrack[i+j]); + } + logerror(" "); + logerror("\n"); + } +} + +// ====================================================================== +// TI-99-specific format +// ====================================================================== + +const mfmhd_format_type MFMHD_TI99_FORMAT = &mfmhd_image_format_creator<ti99_mfmhd_format>; + +enum +{ + SEARCH_A1=0, + FOUND_A1, + DAM_FOUND, + CHECK_CRC +}; + + /* - Load a track from the CHD. - TODO: Isolate the encoding into a separate format definition + Calculate the ident byte from the cylinder. The specification does not + define idents beyond cylinder 1023, but formatting programs seem to + continue with 0xfd for cylinders between 1024 and 2047. */ -chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinder, int head, int sectorcount, int size, int interleave) +UINT8 ti99_mfmhd_format::cylinder_to_ident(int cylinder) +{ + if (cylinder < 256) return 0xfe; + if (cylinder < 512) return 0xff; + if (cylinder < 768) return 0xfc; + return 0xfd; +} + +/* + Returns the linear sector number, given the CHS data. + + C,H,S + | 0,0,0 | 0,0,1 | 0,0,2 | ... + | 0,1,0 | 0,1,1 | 0,1,2 | ... + ... + | 1,0,0 | ... + ... +*/ +int ti99_mfmhd_format::chs_to_lba(int cylinder, int head, int sector) +{ + if ((cylinder < m_cylinders) && (head < m_heads) && (sector < m_sectors_per_track)) + { + return (cylinder * m_heads + head) * m_sectors_per_track + sector; + } + else return -1; +} + +chd_error ti99_mfmhd_format::load(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track) { chd_error state = CHDERR_NONE; + int sectorcount = 32; + int size = 256; + int interleave = 4; + + m_encoding = encoding; + m_cylinders = cylcnt; + m_heads = headcnt; + m_sectors_per_track = sect_per_track; + m_tagdev = tagdev; + UINT8 sector_content[1024]; if (TRACE_RWTRACK) logerror("%s: MFM HD cache: load track (c=%d,h=%d) from CHD\n", tag(), cylinder, head); @@ -808,7 +1022,7 @@ chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinde // both be set to the same number and loaded in the appropriate registers. // Gap 1 - mfm_encode(slot, position, 0x4e, 16); + mfm_encode(trackimage, position, 0x4e, 16); int sec_il_start = 0; int sec_number = 0; @@ -826,43 +1040,43 @@ chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinde if (TRACE_DETAIL) logerror("%02d ", sec_number); // Sync gap - mfm_encode(slot, position, 0x00, 13); + mfm_encode(trackimage, position, 0x00, 13); // Write IDAM - mfm_encode_a1(slot, position); + mfm_encode_a1(trackimage, position); // Write header identfield = cylinder_to_ident(cylinder); cylfield = cylinder & 0xff; headfield = ((cylinder & 0x700)>>4) | (head&0x0f); - mfm_encode(slot, position, identfield); - mfm_encode(slot, position, cylfield); - mfm_encode(slot, position, headfield); - mfm_encode(slot, position, sec_number); - mfm_encode(slot, position, sizefield); + mfm_encode(trackimage, position, identfield); + mfm_encode(trackimage, position, cylfield); + mfm_encode(trackimage, position, headfield); + mfm_encode(trackimage, position, sec_number); + mfm_encode(trackimage, position, sizefield); // logerror("%s: Created header (%02x,%02x,%02x,%02x)\n", tag(), identfield, cylfield, headfield, sector); // Write CRC for header. int crc = m_current_crc; - mfm_encode(slot, position, (crc >> 8) & 0xff); - mfm_encode(slot, position, crc & 0xff); + mfm_encode(trackimage, position, (crc >> 8) & 0xff); + mfm_encode(trackimage, position, crc & 0xff); // Gap 2 - mfm_encode(slot, position, 0x4e, 3); + mfm_encode(trackimage, position, 0x4e, 3); // Sync - mfm_encode(slot, position, 0x00, 13); + mfm_encode(trackimage, position, 0x00, 13); // Write DAM - mfm_encode_a1(slot, position); - mfm_encode(slot, position, 0xfb); + mfm_encode_a1(trackimage, position); + mfm_encode(trackimage, position, 0xfb); // Get sector content from CHD int lbaposition = chs_to_lba(cylinder, head, sec_number); if (lbaposition>=0) { - chd_error state = m_chd->read_units(lbaposition, sector_content); + chd_error state = chdfile->read_units(lbaposition, sector_content); if (state != CHDERR_NONE) break; } else @@ -871,16 +1085,16 @@ chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinde } for (int i=0; i < size; i++) - mfm_encode(slot, position, sector_content[i]); + mfm_encode(trackimage, position, sector_content[i]); // Write CRC for content. crc = m_current_crc; - mfm_encode(slot, position, (crc >> 8) & 0xff); - mfm_encode(slot, position, crc & 0xff); + mfm_encode(trackimage, position, (crc >> 8) & 0xff); + mfm_encode(trackimage, position, crc & 0xff); // Gap 3 - mfm_encode(slot, position, 0x00, 3); - mfm_encode(slot, position, 0x4e, 19); + mfm_encode(trackimage, position, 0x00, 3); + mfm_encode(trackimage, position, 0x4e, 19); // Calculate next sector number sec_number += delta; @@ -892,54 +1106,21 @@ chd_error mfmhd_trackimage_cache::load_track(mfmhd_trackimage* slot, int cylinde if (state == CHDERR_NONE) { // Fill the rest with 0x4e - mfm_encode(slot, position, 0x4e, TRACKIMAGE_SIZE-position); + mfm_encode(trackimage, position, 0x4e, tracksize-position); if (TRACE_IMAGE) { - showtrack(slot->encdata, TRACKIMAGE_SIZE); + showtrack(trackimage, tracksize); } } - - slot->dirty = false; - slot->cylinder = cylinder; - slot->head = head; - return state; } -enum -{ - SEARCH_A1=0, - FOUND_A1, - DAM_FOUND, - CHECK_CRC -}; - -UINT8 mfmhd_trackimage_cache::mfm_decode(UINT16 raw) -{ - unsigned int value = 0; - - for (int i=0; i < 8; i++) - { - value <<= 1; - - value |= (raw & 0x4000); - raw <<= 2; - } - return (value >> 14) & 0xff; -} - -/* - TODO: The CHD/track conversion should go in a separate format definition (see floppy) - (can also handle different header formats there) -*/ -void mfmhd_trackimage_cache::write_back(mfmhd_trackimage* slot) +chd_error ti99_mfmhd_format::save(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int current_cylinder, int current_head, int cylcnt, int headcnt, int sect_per_track) { - if (TRACE_CACHE) logerror("%s: MFM HD cache: write back (c=%d,h=%d) to CHD\n", tag(), slot->cylinder, slot->head); + if (TRACE_CACHE) logerror("%s: MFM HD cache: write back (c=%d,h=%d) to CHD\n", tag(), current_cylinder, current_head); UINT8 buffer[1024]; // for header or sector content - UINT16 *track = slot->encdata; - int bytepos = 0; int state = SEARCH_A1; int count = 0; @@ -959,25 +1140,33 @@ void mfmhd_trackimage_cache::write_back(mfmhd_trackimage* slot) int interleave_prec = -1; bool check_interleave = true; + chd_error chdstate = CHDERR_NONE; + + m_encoding = encoding; + m_cylinders = cylcnt; + m_heads = headcnt; + m_sectors_per_track = sect_per_track; + m_tagdev = tagdev; + if (TRACE_IMAGE) { - for (int i=0; i < TRACKIMAGE_SIZE; i++) + for (int i=0; i < tracksize; i++) { if ((i % 16)==0) logerror("\n%04x: ", i); - logerror("%02x ", (m_encoding==MFM_BITS || m_encoding==MFM_BYTE)? mfm_decode(track[i]) : (track[i]&0xff)); + logerror("%02x ", (m_encoding==MFM_BITS || m_encoding==MFM_BYTE)? mfm_decode(trackimage[i]) : (trackimage[i]&0xff)); } logerror("\n"); } // We have to go through the bytes of the track and save a sector as soon as one shows up - while (bytepos < TRACKIMAGE_SIZE) + while (bytepos < tracksize) { switch (state) { case SEARCH_A1: - if (((m_encoding==MFM_BITS || m_encoding==MFM_BYTE) && track[bytepos]==0x4489) - || (m_encoding==SEPARATED && track[bytepos]==0x0aa1) - || (m_encoding==SEPARATED_SIMPLE && track[bytepos]==0xffa1)) + if (((m_encoding==MFM_BITS || m_encoding==MFM_BYTE) && trackimage[bytepos]==0x4489) + || (m_encoding==SEPARATED && trackimage[bytepos]==0x0aa1) + || (m_encoding==SEPARATED_SIMPLE && trackimage[bytepos]==0xffa1)) { state = FOUND_A1; count = search_header? 7 : 259; @@ -991,9 +1180,9 @@ void mfmhd_trackimage_cache::write_back(mfmhd_trackimage* slot) // read next values into array if (m_encoding==MFM_BITS || m_encoding==MFM_BYTE) { - byte = mfm_decode(track[bytepos]); + byte = mfm_decode(trackimage[bytepos]); } - else byte = (track[bytepos] & 0xff); + else byte = (trackimage[bytepos] & 0xff); crc = ccitt_crc16_one(crc, byte); // logerror("%s: MFM HD: Byte = %02x, CRC=%04x\n", tag(), byte, crc); @@ -1021,6 +1210,16 @@ void mfmhd_trackimage_cache::write_back(mfmhd_trackimage* slot) logerror("%s: MFM HD: Field error; ident = %02x (expected %02x) for sector chs=(%d,%d,%d)\n", tag(), ident, identexp, cylinder, head, sector); } + if (cylinder != current_cylinder) + { + logerror("%s: MFM HD: Sector header of sector %d defines cylinder = %02x (should be %02x)\n", tag(), sector, cylinder, current_cylinder); + } + + if (head != current_head) + { + logerror("%s: MFM HD: Sector header of sector %d defines head = %02x (should be %02x)\n", tag(), sector, head, current_head); + } + // Count the sectors for the interleave if (check_interleave) { @@ -1045,10 +1244,10 @@ void mfmhd_trackimage_cache::write_back(mfmhd_trackimage* slot) int lbaposition = chs_to_lba(cylinder, head, sector); if (lbaposition>=0) { - if (TRACE_DETAIL) logerror("%s: MFM HD: Writing sector chs=(%d,%d,%d) to CHD\n", tag(), cylinder, head, sector); - chd_error state = m_chd->write_units(chs_to_lba(cylinder, head, sector), buffer); + if (TRACE_DETAIL) logerror("%s: MFM HD: Writing sector chs=(%d,%d,%d) to CHD\n", tag(), current_cylinder, current_head, sector); + chdstate = chdfile->write_units(chs_to_lba(current_cylinder, current_head, sector), buffer); - if (state != CHDERR_NONE) + if (chdstate != CHDERR_NONE) { logerror("%s: MFM HD: Write error while writing sector chs=(%d,%d,%d)\n", tag(), cylinder, head, sector); } @@ -1079,71 +1278,17 @@ void mfmhd_trackimage_cache::write_back(mfmhd_trackimage* slot) break; } } - // Clear the dirty flag - slot->dirty = false; if (check_interleave == false) { // Successfully determined the interleave - m_calc_interleave = calc_interleave; + m_interleave = calc_interleave; } if (TRACE_CACHE) { - logerror("%s: MFM HD cache: write back complete (c=%d,h=%d), interleave = %d\n", tag(), slot->cylinder, slot->head, m_calc_interleave); + logerror("%s: MFM HD cache: write back complete (c=%d,h=%d), interleave = %d\n", tag(), current_cylinder, current_head, m_interleave); } -} -/* - For debugging. Outputs the byte array in a xxd-like way. -*/ -void mfmhd_trackimage_cache::showtrack(UINT16* enctrack, int length) -{ - for (int i=0; i < length; i+=16) - { - logerror("%07x: ", i); - for (int j=0; j < 16; j++) - { - logerror("%04x ", enctrack[i+j]); - } - logerror(" "); - logerror("\n"); - } -} - -// ================================================================ - -mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock): - device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__), - device_slot_interface(mconfig, *this) -{ + return chdstate; } - -mfm_harddisk_connector::~mfm_harddisk_connector() -{ -} - -mfm_harddisk_device* mfm_harddisk_connector::get_device() -{ - return dynamic_cast<mfm_harddisk_device *>(get_card_device()); -} - -void mfm_harddisk_connector::configure(mfmhd_enc_t encoding, int spinupms, int cache) -{ - m_encoding = encoding; - m_spinupms = spinupms; - m_cachesize = cache; -} - -void mfm_harddisk_connector::device_config_complete() -{ - mfm_harddisk_device *dev = get_device(); - if (dev != NULL) - { - dev->set_encoding(m_encoding); - dev->set_spinup_time(m_spinupms); - dev->set_cache_size(m_cachesize); - } -} - -const device_type MFM_HD_CONNECTOR = &device_creator<mfm_harddisk_connector>; diff --git a/src/emu/machine/ti99_hd.h b/src/emu/machine/ti99_hd.h index c6cd8acccfc..b004ea7cafb 100644 --- a/src/emu/machine/ti99_hd.h +++ b/src/emu/machine/ti99_hd.h @@ -29,6 +29,17 @@ enum mfmhd_enc_t SEPARATED_SIMPLE // MSB: 00/FF (standard / mark) clock, LSB: one data byte }; +class mfmhd_image_format_t; + +// Pointer to its alloc function +typedef mfmhd_image_format_t *(*mfmhd_format_type)(); + +template<class _FormatClass> +mfmhd_image_format_t *mfmhd_image_format_creator() +{ + return new _FormatClass(); +} + class mfmhd_trackimage { public: @@ -44,36 +55,29 @@ class mfmhd_trackimage_cache public: mfmhd_trackimage_cache(); ~mfmhd_trackimage_cache(); - void init(chd_file* chdfile, const char* tag, int maxcyl, int maxhead, int trackslots, mfmhd_enc_t encoding); + void init(chd_file* chdfile, const char* tag, int tracksize, int imagecyls, int imageheads, int imagesecpt, int trackslots, mfmhd_enc_t encoding, mfmhd_image_format_t* format); UINT16* get_trackimage(int cylinder, int head); void mark_current_as_dirty(); void cleanup(); void write_back_one(); + int get_cylinders() { return m_cylinders; } private: - void mfm_encode(mfmhd_trackimage* slot, int& position, UINT8 byte, int count=1); - void mfm_encode_a1(mfmhd_trackimage* slot, int& position); - void mfm_encode_mask(mfmhd_trackimage* slot, int& position, UINT8 byte, int count, int mask); - UINT8 mfm_decode(UINT16 raw); - - chd_error load_track(mfmhd_trackimage* slot, int cylinder, int head, int sectorcount, int size, int interleave); - void write_back(mfmhd_trackimage* timg); - int chs_to_lba(int cylinder, int head, int sector); - UINT8 cylinder_to_ident(int cylinder); - chd_file* m_chd; - const char* m_tagdev; - mfmhd_trackimage* m_tracks; - mfmhd_enc_t m_encoding; + const char* m_tagdev; + mfmhd_trackimage* m_tracks; + mfmhd_enc_t m_encoding; + mfmhd_image_format_t* m_format; + bool m_lastbit; int m_current_crc; int m_cylinders; int m_heads; int m_sectors_per_track; int m_sectorsize; + int m_tracksize; - int m_calc_interleave; void showtrack(UINT16* enctrack, int length); const char* tag() { return m_tagdev; } }; @@ -97,6 +101,7 @@ public: void set_encoding(mfmhd_enc_t encoding) { m_encoding = encoding; } void set_spinup_time(int spinupms) { m_spinupms = spinupms; } void set_cache_size(int tracks) { m_cachelines = tracks; } + void set_format(mfmhd_image_format_t* format) { m_format = format; } mfmhd_enc_t get_encoding() { return m_encoding; } @@ -140,12 +145,21 @@ protected: ready_cb m_ready_cb; seek_complete_cb m_seek_complete_cb; - int m_max_cylinder; - int m_max_heads; + int m_max_cylinders; + int m_phys_cylinders; + int m_actual_cylinders; // after reading the CHD + int m_max_heads; + int m_park_pos; + int m_maxseek_time; + int m_seeknext_time; private: mfmhd_enc_t m_encoding; + int m_cell_size; // nanoseconds + int m_trackimage_size; // number of 16-bit cell blocks (data bytes) int m_spinupms; + int m_rpm; + int m_interleave; int m_cachelines; bool m_ready; int m_current_cylinder; @@ -154,7 +168,6 @@ private: int m_step_phase; bool m_seek_complete; bool m_seek_inward; - //bool m_seeking; bool m_autotruncation; bool m_recalibrated; line_state m_step_line; // keep the last state @@ -163,13 +176,27 @@ private: attotime m_revolution_start_time; attotime m_rev_time; + attotime m_settle_time; + attotime m_step_time; + mfmhd_trackimage_cache* m_cache; + mfmhd_image_format_t* m_format; void prepare_track(int cylinder, int head); void head_move(); void recalibrate(); }; +/* + The Generic drive is a MFM drive that has just enough heads and cylinders + to handle the CHD image. + + Specific Seagate models: + + ST-213: 10 MB + ST-225: 20 MB + ST-251: 40 MB +*/ class mfm_hd_generic_device : public mfm_harddisk_device { public: @@ -178,6 +205,14 @@ public: extern const device_type MFMHD_GENERIC; +class mfm_hd_st213_device : public mfm_harddisk_device +{ +public: + mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + +extern const device_type MFMHD_ST213; + class mfm_hd_st225_device : public mfm_harddisk_device { public: @@ -186,6 +221,15 @@ public: extern const device_type MFMHD_ST225; +class mfm_hd_st251_device : public mfm_harddisk_device +{ +public: + mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + +extern const device_type MFMHD_ST251; + + /* Connector for a MFM hard disk. See also floppy.c */ class mfm_harddisk_connector : public device_t, public device_slot_interface @@ -196,7 +240,7 @@ public: mfm_harddisk_device *get_device(); - void configure(mfmhd_enc_t encoding, int spinupms, int cache); + void configure(mfmhd_enc_t encoding, int spinupms, int cache, mfmhd_format_type format); protected: void device_start() { }; @@ -206,6 +250,7 @@ private: mfmhd_enc_t m_encoding; int m_spinupms; int m_cachesize; + mfmhd_image_format_t* m_format; }; extern const device_type MFM_HD_CONNECTOR; @@ -222,9 +267,59 @@ extern const device_type MFM_HD_CONNECTOR; emulate this, so we allow for shorter times) _cache = number of cached MFM tracks */ -#define MCFG_MFM_HARDDISK_CONN_ADD(_tag, _slot_intf, _def_slot, _enc, _spinupms, _cache) \ +#define MCFG_MFM_HARDDISK_CONN_ADD(_tag, _slot_intf, _def_slot, _enc, _spinupms, _cache, _format) \ MCFG_DEVICE_ADD(_tag, MFM_HD_CONNECTOR, 0) \ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ - static_cast<mfm_harddisk_connector *>(device)->configure(_enc, _spinupms, _cache); + static_cast<mfm_harddisk_connector *>(device)->configure(_enc, _spinupms, _cache, _format); + + +/* + Hard disk format +*/ +class mfmhd_image_format_t +{ +public: + mfmhd_image_format_t(); + virtual ~mfmhd_image_format_t(); + + // Load the image. + virtual chd_error load(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track) = 0; + + // Save the image. + virtual chd_error save(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track) = 0; + + // Return the recent interleave of the image + int get_interleave() { return m_interleave; } + +protected: + bool m_lastbit; + int m_current_crc; + mfmhd_enc_t m_encoding; + const char* m_tagdev; + int m_cylinders; + int m_heads; + int m_sectors_per_track; + int m_interleave; + + void mfm_encode(UINT16* trackimage, int& position, UINT8 byte, int count=1); + void mfm_encode_a1(UINT16* trackimage, int& position); + void mfm_encode_mask(UINT16* trackimage, int& position, UINT8 byte, int count, int mask); + UINT8 mfm_decode(UINT16 raw); + const char* tag() { return m_tagdev; } + void showtrack(UINT16* enctrack, int length); +}; + +class ti99_mfmhd_format : public mfmhd_image_format_t +{ +public: + ti99_mfmhd_format() {}; + chd_error load(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track); + chd_error save(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track); +private: + UINT8 cylinder_to_ident(int cylinder); + int chs_to_lba(int cylinder, int head, int sector); +}; + +extern const mfmhd_format_type MFMHD_TI99_FORMAT; #endif diff --git a/src/emu/machine/tms6100.c b/src/emu/machine/tms6100.c index d37771f4fd2..c0b355feee5 100644 --- a/src/emu/machine/tms6100.c +++ b/src/emu/machine/tms6100.c @@ -136,13 +136,15 @@ void tms6100_device::device_start() save_item(NAME(m_m0)); save_item(NAME(m_m1)); save_item(NAME(m_state)); + //save_item(NAME(m_variant)); + //tms6100_set_variant(tms, TMS6110_IS_TMS6100); } void m58819_device::device_start() { - //tms5110_set_variant(tms, TMS5110_IS_5100); tms6100_device::device_start(); + //tms6100_set_variant(tms, TMS6110_IS_M58819); } //------------------------------------------------- @@ -197,7 +199,15 @@ WRITE_LINE_MEMBER(tms6100_device::tms6100_romclock_w) else { /* read bit at address */ + /* if (m_variant == TMS6110_IS_M58819) + { + m_data = (m_rom[m_address >> 3] >> (7-(m_address & 0x07))) & 1; + } + else // m_variant == (TMS6110_IS_TMS6100 || TMS6110_IS_TMS6125) + { + */ m_data = (m_rom[m_address >> 3] >> (m_address & 0x07)) & 1; + /* } */ m_address++; } m_state &= ~TMS6100_READ_PENDING; diff --git a/src/emu/machine/tms6100.h b/src/emu/machine/tms6100.h index 2259ac27585..2838adf63cf 100644 --- a/src/emu/machine/tms6100.h +++ b/src/emu/machine/tms6100.h @@ -37,6 +37,7 @@ private: UINT8 m_tms_clock; UINT8 m_data; UINT8 m_state; + //UINT8 m_variant; }; diff --git a/src/emu/netlist/analog/nld_bjt.h b/src/emu/netlist/analog/nld_bjt.h index 9b66da8c319..df0a68f5cf8 100644 --- a/src/emu/netlist/analog/nld_bjt.h +++ b/src/emu/netlist/analog/nld_bjt.h @@ -16,7 +16,7 @@ // ---------------------------------------------------------------------------------------- #define QBJT_SW(_name, _model) \ - NET_REGISTER_DEV(QBJT_switch, _name) \ + NET_REGISTER_DEV(QBJT_SW, _name) \ NETDEV_PARAMI(_name, model, _model) #define QBJT_EB(_name, _model) \ diff --git a/src/emu/netlist/analog/nld_switches.h b/src/emu/netlist/analog/nld_switches.h index cb346f64af1..79dc989c948 100644 --- a/src/emu/netlist/analog/nld_switches.h +++ b/src/emu/netlist/analog/nld_switches.h @@ -18,10 +18,10 @@ // ---------------------------------------------------------------------------------------- #define SWITCH(_name) \ - NET_REGISTER_DEV(switch1, _name) + NET_REGISTER_DEV(SWITCH, _name) #define SWITCH2(_name) \ - NET_REGISTER_DEV(switch2, _name) + NET_REGISTER_DEV(SWITCH2, _name) // ---------------------------------------------------------------------------------------- // Devices ... diff --git a/src/emu/netlist/analog/nld_twoterm.h b/src/emu/netlist/analog/nld_twoterm.h index e441b16a40c..c6714d62d45 100644 --- a/src/emu/netlist/analog/nld_twoterm.h +++ b/src/emu/netlist/analog/nld_twoterm.h @@ -40,7 +40,7 @@ // ---------------------------------------------------------------------------------------- #define RES(_name, _R) \ - NET_REGISTER_DEV(R, _name) \ + NET_REGISTER_DEV(RES, _name) \ NETDEV_PARAMI(_name, R, _R) #define POT(_name, _R) \ @@ -54,12 +54,12 @@ #define CAP(_name, _C) \ - NET_REGISTER_DEV(C, _name) \ + NET_REGISTER_DEV(CAP, _name) \ NETDEV_PARAMI(_name, C, _C) /* Generic Diode */ #define DIODE(_name, _model) \ - NET_REGISTER_DEV(D, _name) \ + NET_REGISTER_DEV(DIODE, _name) \ NETDEV_PARAMI(_name, model, _model) #define VS(_name, _V) \ diff --git a/src/emu/netlist/devices/net_lib.h b/src/emu/netlist/devices/net_lib.h index b7eb7d3c201..4f10aee0651 100644 --- a/src/emu/netlist/devices/net_lib.h +++ b/src/emu/netlist/devices/net_lib.h @@ -56,13 +56,15 @@ #include "nld_log.h" +#include "../macro/nlm_cd4xxx.h" +#include "../macro/nlm_ttl74xx.h" +#include "../macro/nlm_opamp.h" + #include "../analog/nld_bjt.h" #include "../analog/nld_fourterm.h" #include "../analog/nld_switches.h" #include "../analog/nld_twoterm.h" #include "../analog/nld_opamps.h" -#include "../macro/nlm_cd4xxx.h" -#include "../macro/nlm_ttl74xx.h" #include "../solver/nld_solver.h" #include "nld_legacy.h" diff --git a/src/emu/netlist/devices/nld_4020.h b/src/emu/netlist/devices/nld_4020.h index be8d38eff66..d4814471fc1 100644 --- a/src/emu/netlist/devices/nld_4020.h +++ b/src/emu/netlist/devices/nld_4020.h @@ -32,7 +32,7 @@ /* FIXME: only used in mario.c */ #define CD4020_WI(_name, _IP, _RESET, _VDD, _VSS) \ - NET_REGISTER_DEV(CD4020, _name) \ + NET_REGISTER_DEV(CD4020_WI, _name) \ NET_CONNECT(_name, IP, _IP) \ NET_CONNECT(_name, RESET, _RESET) \ NET_CONNECT(_name, VDD, _VDD) \ diff --git a/src/emu/netlist/devices/nld_7400.h b/src/emu/netlist/devices/nld_7400.h index ac719f64046..97bdda0a912 100644 --- a/src/emu/netlist/devices/nld_7400.h +++ b/src/emu/netlist/devices/nld_7400.h @@ -36,12 +36,12 @@ #include "nld_truthtable.h" #define TTL_7400_NAND(_name, _A, _B) \ - NET_REGISTER_DEV(7400, _name) \ + NET_REGISTER_DEV(TTL_7400_NAND, _name) \ NET_CONNECT(_name, A, _A) \ NET_CONNECT(_name, B, _B) #define TTL_7400_DIP(_name) \ - NET_REGISTER_DEV(7400_dip, _name) + NET_REGISTER_DEV(TTL_7400_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7402.h b/src/emu/netlist/devices/nld_7402.h index 91079cf6812..1d11236488b 100644 --- a/src/emu/netlist/devices/nld_7402.h +++ b/src/emu/netlist/devices/nld_7402.h @@ -36,12 +36,12 @@ #include "nld_truthtable.h" #define TTL_7402_NOR(_name, _I1, _I2) \ - NET_REGISTER_DEV(7402, _name) \ + NET_REGISTER_DEV(TTL_7402_NOR, _name) \ NET_CONNECT(_name, A, _I1) \ NET_CONNECT(_name, B, _I2) #define TTL_7402_DIP(_name) \ - NET_REGISTER_DEV(7402_dip, _name) + NET_REGISTER_DEV(TTL_7402_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7404.h b/src/emu/netlist/devices/nld_7404.h index 7cf3a1acb98..60465f74d9c 100644 --- a/src/emu/netlist/devices/nld_7404.h +++ b/src/emu/netlist/devices/nld_7404.h @@ -34,11 +34,11 @@ #include "nld_truthtable.h" #define TTL_7404_INVERT(_name, _A) \ - NET_REGISTER_DEV(7404, _name) \ + NET_REGISTER_DEV(TTL_7404_INVERT, _name) \ NET_CONNECT(_name, A, _A) #define TTL_7404_DIP(_name) \ - NET_REGISTER_DEV(7404_dip, _name) + NET_REGISTER_DEV(TTL_7404_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7408.h b/src/emu/netlist/devices/nld_7408.h index f33bc5e0a17..9304d5c554d 100644 --- a/src/emu/netlist/devices/nld_7408.h +++ b/src/emu/netlist/devices/nld_7408.h @@ -36,12 +36,12 @@ #include "nld_truthtable.h" #define TTL_7408_AND(_name, _A, _B) \ - NET_REGISTER_DEV(7408, _name) \ + NET_REGISTER_DEV(TTL_7408_AND, _name) \ NET_CONNECT(_name, A, _A) \ NET_CONNECT(_name, B, _B) #define TTL_7408_DIP(_name) \ - NET_REGISTER_DEV(7408_dip, _name) + NET_REGISTER_DEV(TTL_7408_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7410.h b/src/emu/netlist/devices/nld_7410.h index 6272185795d..d6e97838c7b 100644 --- a/src/emu/netlist/devices/nld_7410.h +++ b/src/emu/netlist/devices/nld_7410.h @@ -36,13 +36,13 @@ #include "nld_truthtable.h" #define TTL_7410_NAND(_name, _I1, _I2, _I3) \ - NET_REGISTER_DEV(7410, _name) \ + NET_REGISTER_DEV(TTL_7410_NAND, _name) \ NET_CONNECT(_name, A, _I1) \ NET_CONNECT(_name, B, _I2) \ NET_CONNECT(_name, C, _I3) #define TTL_7410_DIP(_name) \ - NET_REGISTER_DEV(7410_dip, _name) + NET_REGISTER_DEV(TTL_7410_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_74107.h b/src/emu/netlist/devices/nld_74107.h index e7de9d687be..89f59822f22 100644 --- a/src/emu/netlist/devices/nld_74107.h +++ b/src/emu/netlist/devices/nld_74107.h @@ -62,7 +62,7 @@ #include "../nl_base.h" #define TTL_74107A(_name, _CLK, _J, _K, _CLRQ) \ - NET_REGISTER_DEV(74107A, _name) \ + NET_REGISTER_DEV(TTL_74107A, _name) \ NET_CONNECT(_name, CLK, _CLK) \ NET_CONNECT(_name, J, _J) \ NET_CONNECT(_name, K, _K) \ @@ -72,7 +72,7 @@ TTL_74107A(_name, _CLK, _J, _K, _CLRQ) #define TTL_74107_DIP(_name) \ - NET_REGISTER_DEV(74107_dip, _name) + NET_REGISTER_DEV(TTL_74107_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7411.h b/src/emu/netlist/devices/nld_7411.h index 0cd5358ea51..11d4d45a20f 100644 --- a/src/emu/netlist/devices/nld_7411.h +++ b/src/emu/netlist/devices/nld_7411.h @@ -36,13 +36,13 @@ #include "nld_truthtable.h" #define TTL_7411_AND(_name, _I1, _I2, _I3) \ - NET_REGISTER_DEV(7411, _name) \ + NET_REGISTER_DEV(TTL_7411_AND, _name) \ NET_CONNECT(_name, A, _I1) \ NET_CONNECT(_name, B, _I2) \ NET_CONNECT(_name, C, _I3) #define TTL_7411_DIP(_name) \ - NET_REGISTER_DEV(7411_dip, _name) + NET_REGISTER_DEV(TTL_7411_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_74123.h b/src/emu/netlist/devices/nld_74123.h index 23498c4f662..8772103b521 100644 --- a/src/emu/netlist/devices/nld_74123.h +++ b/src/emu/netlist/devices/nld_74123.h @@ -54,7 +54,7 @@ #include "../analog/nld_twoterm.h" #define TTL_74123(_name) \ - NET_REGISTER_DEV(74123, _name) + NET_REGISTER_DEV(TTL_74123, _name) NETLIB_NAMESPACE_DEVICES_START() @@ -85,7 +85,7 @@ public: ); #define TTL_74123_DIP(_name) \ - NET_REGISTER_DEV(74123_dip, _name) + NET_REGISTER_DEV(TTL_74123_DIP, _name) NETLIB_DEVICE(74123_dip, @@ -99,7 +99,7 @@ NETLIB_DEVICE(74123_dip, */ #define TTL_9602_DIP(_name) \ - NET_REGISTER_DEV(9602_dip, _name) + NET_REGISTER_DEV(TTL_9602_DIP, _name) NETLIB_DEVICE(9602_dip, @@ -113,7 +113,7 @@ NETLIB_DEVICE(9602_dip, */ #define CD4538_DIP(_name) \ - NET_REGISTER_DEV(4538_dip, _name) + NET_REGISTER_DEV(CD4538_DIP, _name) NETLIB_DEVICE(4538_dip, NETLIB_LOGIC_FAMILY(CD4XXX) diff --git a/src/emu/netlist/devices/nld_74153.h b/src/emu/netlist/devices/nld_74153.h index 9dcc9afeacf..fe59759b1f7 100644 --- a/src/emu/netlist/devices/nld_74153.h +++ b/src/emu/netlist/devices/nld_74153.h @@ -48,7 +48,7 @@ #include "../nl_base.h" #define TTL_74153(_name, _C0, _C1, _C2, _C3, _A, _B, _G) \ - NET_REGISTER_DEV(74153, _name) \ + NET_REGISTER_DEV(TTL_74153, _name) \ NET_CONNECT(_name, C0, _C0) \ NET_CONNECT(_name, C1, _C1) \ NET_CONNECT(_name, C2, _C2) \ @@ -58,7 +58,7 @@ NET_CONNECT(_name, G, _G) #define TTL_74153_DIP(_name) \ - NET_REGISTER_DEV(74153_dip, _name) + NET_REGISTER_DEV(TTL_74153_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_74175.h b/src/emu/netlist/devices/nld_74175.h index d77a51784ac..f74165a5839 100644 --- a/src/emu/netlist/devices/nld_74175.h +++ b/src/emu/netlist/devices/nld_74175.h @@ -39,9 +39,9 @@ #include "nld_signal.h" #define TTL_74175(_name) \ - NET_REGISTER_DEV(74175, _name) + NET_REGISTER_DEV(TTL_74175, _name) #define TTL_74175_DIP(_name) \ - NET_REGISTER_DEV(74175_dip, _name) + NET_REGISTER_DEV(TTL_74175_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_74192.h b/src/emu/netlist/devices/nld_74192.h index 0fd50af7910..d5be6346cb2 100644 --- a/src/emu/netlist/devices/nld_74192.h +++ b/src/emu/netlist/devices/nld_74192.h @@ -33,10 +33,10 @@ #include "nld_9316.h" #define TTL_74192(_name) \ - NET_REGISTER_DEV(74192, _name) + NET_REGISTER_DEV(TTL_74192, _name) #define TTL_74192_DIP(_name) \ - NET_REGISTER_DEV(74192_dip, _name) + NET_REGISTER_DEV(TTL_74192_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_74193.h b/src/emu/netlist/devices/nld_74193.h index 8193a53f42a..d97095b7230 100644 --- a/src/emu/netlist/devices/nld_74193.h +++ b/src/emu/netlist/devices/nld_74193.h @@ -29,10 +29,10 @@ #include "../nl_base.h" #define TTL_74193(_name) \ - NET_REGISTER_DEV(74193, _name) + NET_REGISTER_DEV(TTL_74193, _name) #define TTL_74193_DIP(_name) \ - NET_REGISTER_DEV(74193_dip, _name) + NET_REGISTER_DEV(TTL_74193_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7420.h b/src/emu/netlist/devices/nld_7420.h index 10e5f3596c0..2ce7020c7e5 100644 --- a/src/emu/netlist/devices/nld_7420.h +++ b/src/emu/netlist/devices/nld_7420.h @@ -37,7 +37,7 @@ #include "nld_truthtable.h" #define TTL_7420_NAND(_name, _I1, _I2, _I3, _I4) \ - NET_REGISTER_DEV(7420, _name) \ + NET_REGISTER_DEV(TTL_7420_NAND, _name) \ NET_CONNECT(_name, A, _I1) \ NET_CONNECT(_name, B, _I2) \ NET_CONNECT(_name, C, _I3) \ @@ -45,7 +45,7 @@ #define TTL_7420_DIP(_name) \ - NET_REGISTER_DEV(7420_dip, _name) + NET_REGISTER_DEV(TTL_7420_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7425.h b/src/emu/netlist/devices/nld_7425.h index d5e2f25e144..816c0cba100 100644 --- a/src/emu/netlist/devices/nld_7425.h +++ b/src/emu/netlist/devices/nld_7425.h @@ -39,14 +39,14 @@ #include "nld_signal.h" #define TTL_7425_NOR(_name, _I1, _I2, _I3, _I4) \ - NET_REGISTER_DEV(7425, _name) \ + NET_REGISTER_DEV(TTL_7425_NOR, _name) \ NET_CONNECT(_name, A, _I1) \ NET_CONNECT(_name, B, _I2) \ NET_CONNECT(_name, C, _I3) \ NET_CONNECT(_name, D, _I4) #define TTL_7425_DIP(_name) \ - NET_REGISTER_DEV(7425_dip, _name) + NET_REGISTER_DEV(TTL_7425_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7427.h b/src/emu/netlist/devices/nld_7427.h index 7bef7a274aa..6ba726a17fc 100644 --- a/src/emu/netlist/devices/nld_7427.h +++ b/src/emu/netlist/devices/nld_7427.h @@ -36,13 +36,13 @@ #include "nld_truthtable.h" #define TTL_7427_NOR(_name, _I1, _I2, _I3) \ - NET_REGISTER_DEV(7427, _name) \ + NET_REGISTER_DEV(TTL_7427_NOR, _name) \ NET_CONNECT(_name, A, _I1) \ NET_CONNECT(_name, B, _I2) \ NET_CONNECT(_name, C, _I3) #define TTL_7427_DIP(_name) \ - NET_REGISTER_DEV(7427_dip, _name) + NET_REGISTER_DEV(TTL_7427_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_74279.h b/src/emu/netlist/devices/nld_74279.h index 926ca540873..aecd8435f6d 100644 --- a/src/emu/netlist/devices/nld_74279.h +++ b/src/emu/netlist/devices/nld_74279.h @@ -39,7 +39,7 @@ #include "nld_truthtable.h" #define TTL_74279_DIP(_name) \ - NET_REGISTER_DEV(74279_dip, _name) + NET_REGISTER_DEV(TTL_74279_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7430.h b/src/emu/netlist/devices/nld_7430.h index 70e7450c598..126aa491429 100644 --- a/src/emu/netlist/devices/nld_7430.h +++ b/src/emu/netlist/devices/nld_7430.h @@ -41,7 +41,7 @@ #include "nld_truthtable.h" #define TTL_7430_NAND(_name, _I1, _I2, _I3, _I4, _I5, _I6, _I7, _I8) \ - NET_REGISTER_DEV(7430, _name) \ + NET_REGISTER_DEV(TTL_7430_NAND, _name) \ NET_CONNECT(_name, A, _I1) \ NET_CONNECT(_name, B, _I2) \ NET_CONNECT(_name, C, _I3) \ @@ -53,7 +53,7 @@ #define TTL_7430_DIP(_name) \ - NET_REGISTER_DEV(7430_dip, _name) + NET_REGISTER_DEV(TTL_7430_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7432.h b/src/emu/netlist/devices/nld_7432.h index f83c34648c5..f3655407143 100644 --- a/src/emu/netlist/devices/nld_7432.h +++ b/src/emu/netlist/devices/nld_7432.h @@ -35,13 +35,13 @@ #include "nld_signal.h" #include "nld_truthtable.h" -#define TTL_7432_OR(_name, _I1, _I2) \ - NET_REGISTER_DEV(7432, _name) \ - NET_CONNECT(_name, A, _I1) \ +#define TTL_7432_OR(_name, _I1, _I2) \ + NET_REGISTER_DEV(TTL_7432_OR, _name) \ + NET_CONNECT(_name, A, _I1) \ NET_CONNECT(_name, B, _I2) -#define TTL_7432_DIP(_name) \ - NET_REGISTER_DEV(7432_dip, _name) +#define TTL_7432_DIP(_name) \ + NET_REGISTER_DEV(TTL_7432_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7437.h b/src/emu/netlist/devices/nld_7437.h index 1fa20d19e9b..6b2f193b374 100644 --- a/src/emu/netlist/devices/nld_7437.h +++ b/src/emu/netlist/devices/nld_7437.h @@ -39,12 +39,12 @@ #include "nld_truthtable.h" #define TTL_7437_NAND(_name, _A, _B) \ - NET_REGISTER_DEV(7437, _name) \ + NET_REGISTER_DEV(TTL_7437_NAND, _name) \ NET_CONNECT(_name, A, _A) \ NET_CONNECT(_name, B, _B) #define TTL_7437_DIP(_name) \ - NET_REGISTER_DEV(7437_dip, _name) + NET_REGISTER_DEV(TTL_7437_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7448.h b/src/emu/netlist/devices/nld_7448.h index a3fb4f03316..f5bbdf50704 100644 --- a/src/emu/netlist/devices/nld_7448.h +++ b/src/emu/netlist/devices/nld_7448.h @@ -27,7 +27,7 @@ #include "../nl_base.h" #define TTL_7448(_name, _A0, _A1, _A2, _A3, _LTQ, _BIQ, _RBIQ) \ - NET_REGISTER_DEV(7448, _name) \ + NET_REGISTER_DEV(TTL_7448, _name) \ NET_CONNECT(_name, A, _A0) \ NET_CONNECT(_name, B, _A1) \ NET_CONNECT(_name, C, _A2) \ @@ -37,7 +37,7 @@ NET_CONNECT(_name, RBIQ, _RBIQ) #define TTL_7448_DIP(_name) \ - NET_REGISTER_DEV(7448_dip, _name) + NET_REGISTER_DEV(TTL_7448_DIP, _name) /* * FIXME: Using truthtable is a lot slower than the explicit device diff --git a/src/emu/netlist/devices/nld_7450.h b/src/emu/netlist/devices/nld_7450.h index ec7ffddda45..43b73636be3 100644 --- a/src/emu/netlist/devices/nld_7450.h +++ b/src/emu/netlist/devices/nld_7450.h @@ -27,14 +27,14 @@ #include "nld_signal.h" #define TTL_7450_ANDORINVERT(_name, _I1, _I2, _I3, _I4) \ - NET_REGISTER_DEV(7450, _name) \ + NET_REGISTER_DEV(TTL_7450_ANDORINVERT, _name) \ NET_CONNECT(_name, A, _I1) \ NET_CONNECT(_name, B, _I2) \ NET_CONNECT(_name, C, _I3) \ NET_CONNECT(_name, D, _I4) #define TTL_7450_DIP(_name) \ - NET_REGISTER_DEV(7450_dip, _name) + NET_REGISTER_DEV(TTL_7450_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7474.h b/src/emu/netlist/devices/nld_7474.h index 0893da2ca87..f98de117350 100644 --- a/src/emu/netlist/devices/nld_7474.h +++ b/src/emu/netlist/devices/nld_7474.h @@ -45,14 +45,14 @@ #include "nld_signal.h" #define TTL_7474(_name, _CLK, _D, _CLRQ, _PREQ) \ - NET_REGISTER_DEV(7474, _name) \ + NET_REGISTER_DEV(TTL_7474, _name) \ NET_CONNECT(_name, CLK, _CLK) \ NET_CONNECT(_name, D, _D) \ NET_CONNECT(_name, CLRQ, _CLRQ) \ NET_CONNECT(_name, PREQ, _PREQ) #define TTL_7474_DIP(_name) \ - NET_REGISTER_DEV(7474_dip, _name) + NET_REGISTER_DEV(TTL_7474_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7483.h b/src/emu/netlist/devices/nld_7483.h index b6c9b8936a5..9bbefc88b1d 100644 --- a/src/emu/netlist/devices/nld_7483.h +++ b/src/emu/netlist/devices/nld_7483.h @@ -30,7 +30,7 @@ #include "../nl_base.h" #define TTL_7483(_name, _A1, _A2, _A3, _A4, _B1, _B2, _B3, _B4, _CI) \ - NET_REGISTER_DEV(7483, _name) \ + NET_REGISTER_DEV(TTL_7483, _name) \ NET_CONNECT(_name, A1, _A1) \ NET_CONNECT(_name, A2, _A2) \ NET_CONNECT(_name, A3, _A3) \ @@ -42,7 +42,7 @@ NET_CONNECT(_name, C0, _CI) #define TTL_7483_DIP(_name) \ - NET_REGISTER_DEV(7483_dip, _name) + NET_REGISTER_DEV(TTL_7483_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7486.h b/src/emu/netlist/devices/nld_7486.h index 67e79f740f5..788b633dfe1 100644 --- a/src/emu/netlist/devices/nld_7486.h +++ b/src/emu/netlist/devices/nld_7486.h @@ -36,13 +36,13 @@ #include "nld_truthtable.h" #define TTL_7486_XOR(_name, _A, _B) \ - NET_REGISTER_DEV(7486, _name) \ + NET_REGISTER_DEV(TTL_7486_XOR, _name) \ NET_CONNECT(_name, A, _A) \ NET_CONNECT(_name, B, _B) #define TTL_7486_DIP(_name) \ - NET_REGISTER_DEV(7486_dip, _name) + NET_REGISTER_DEV(TTL_7486_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7490.h b/src/emu/netlist/devices/nld_7490.h index 80d5b1ad4c2..72650c3dcbe 100644 --- a/src/emu/netlist/devices/nld_7490.h +++ b/src/emu/netlist/devices/nld_7490.h @@ -58,7 +58,7 @@ #include "../nl_base.h" #define TTL_7490(_name, _A, _B, _R1, _R2, _R91, _R92) \ - NET_REGISTER_DEV(7490, _name) \ + NET_REGISTER_DEV(TTL_7490, _name) \ NET_CONNECT(_name, A, _A) \ NET_CONNECT(_name, B, _B) \ NET_CONNECT(_name, R1, _R1) \ @@ -67,7 +67,7 @@ NET_CONNECT(_name, R92, _R92) #define TTL_7490_DIP(_name) \ - NET_REGISTER_DEV(7490_dip, _name) + NET_REGISTER_DEV(TTL_7490_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_7493.h b/src/emu/netlist/devices/nld_7493.h index ac751e46555..a54593c7c1f 100644 --- a/src/emu/netlist/devices/nld_7493.h +++ b/src/emu/netlist/devices/nld_7493.h @@ -60,14 +60,14 @@ #include "../nl_base.h" #define TTL_7493(_name, _CLKA, _CLKB, _R1, _R2) \ - NET_REGISTER_DEV(7493, _name) \ + NET_REGISTER_DEV(TTL_7493, _name) \ NET_CONNECT(_name, CLKA, _CLKA) \ NET_CONNECT(_name, CLKB, _CLKB) \ NET_CONNECT(_name, R1, _R1) \ NET_CONNECT(_name, R2, _R2) #define TTL_7493_DIP(_name) \ - NET_REGISTER_DEV(7493_dip, _name) + NET_REGISTER_DEV(TTL_7493_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_74ls629.h b/src/emu/netlist/devices/nld_74ls629.h index 1e3e9b42220..11c74bb8246 100644 --- a/src/emu/netlist/devices/nld_74ls629.h +++ b/src/emu/netlist/devices/nld_74ls629.h @@ -60,7 +60,7 @@ public: ); #define SN74LS629_DIP(_name, _cap1, _cap2) \ - NET_REGISTER_DEV(SN74LS629_dip, _name) \ + NET_REGISTER_DEV(SN74LS629_DIP, _name) \ NETDEV_PARAMI(_name, 1.CAP, _cap1) \ NETDEV_PARAMI(_name, 2.CAP, _cap2) diff --git a/src/emu/netlist/devices/nld_82S16.h b/src/emu/netlist/devices/nld_82S16.h index 891b2ea5abb..0c0963498c9 100644 --- a/src/emu/netlist/devices/nld_82S16.h +++ b/src/emu/netlist/devices/nld_82S16.h @@ -27,9 +27,9 @@ #include "../nl_base.h" #define TTL_82S16(_name) \ - NET_REGISTER_DEV(82S16, _name) + NET_REGISTER_DEV(TTL_82S16, _name) #define TTL_82S16_DIP(_name) \ - NET_REGISTER_DEV(82S16_dip, _name) + NET_REGISTER_DEV(TTL_82S16_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_9310.h b/src/emu/netlist/devices/nld_9310.h index 23848f00b9f..4ab59ea038e 100644 --- a/src/emu/netlist/devices/nld_9310.h +++ b/src/emu/netlist/devices/nld_9310.h @@ -48,7 +48,7 @@ #include "../nl_base.h" #define TTL_9310(_name, _CLK, _ENP, _ENT, _CLRQ, _LOADQ, _A, _B, _C, _D) \ - NET_REGISTER_DEV(9310, _name) \ + NET_REGISTER_DEV(TTL_9310, _name) \ NET_CONNECT(_name, CLK, _CLK) \ NET_CONNECT(_name, ENP, _ENP) \ NET_CONNECT(_name, ENT, _ENT) \ @@ -60,7 +60,7 @@ NET_CONNECT(_name, D, _D) #define TTL_9310_DIP(_name) \ - NET_REGISTER_DEV(9310_dip, _name) + NET_REGISTER_DEV(TTL_9310_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_9312.h b/src/emu/netlist/devices/nld_9312.h index b6d9c97dfdd..ab5c0a8f8c9 100644 --- a/src/emu/netlist/devices/nld_9312.h +++ b/src/emu/netlist/devices/nld_9312.h @@ -41,10 +41,10 @@ #include "nld_truthtable.h" #define TTL_9312(_name) \ - NET_REGISTER_DEV(9312, _name) + NET_REGISTER_DEV(TTL_9312, _name) #define TTL_9312_DIP(_name) \ - NET_REGISTER_DEV(9312_dip, _name) + NET_REGISTER_DEV(TTL_9312_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_9316.h b/src/emu/netlist/devices/nld_9316.h index 2894a27ef39..ec6791ed63b 100644 --- a/src/emu/netlist/devices/nld_9316.h +++ b/src/emu/netlist/devices/nld_9316.h @@ -52,7 +52,7 @@ #include "../nl_base.h" #define TTL_9316(_name, _CLK, _ENP, _ENT, _CLRQ, _LOADQ, _A, _B, _C, _D) \ - NET_REGISTER_DEV(9316, _name) \ + NET_REGISTER_DEV(TTL_9316, _name) \ NET_CONNECT(_name, CLK, _CLK) \ NET_CONNECT(_name, ENP, _ENP) \ NET_CONNECT(_name, ENT, _ENT) \ @@ -64,7 +64,7 @@ NET_CONNECT(_name, D, _D) #define TTL_9316_DIP(_name) \ - NET_REGISTER_DEV(9316_dip, _name) + NET_REGISTER_DEV(TTL_9316_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_legacy.h b/src/emu/netlist/devices/nld_legacy.h index 08c8b6b4f05..62cdd8b02ca 100644 --- a/src/emu/netlist/devices/nld_legacy.h +++ b/src/emu/netlist/devices/nld_legacy.h @@ -22,10 +22,10 @@ NETLIB_NAMESPACE_DEVICES_START() // ---------------------------------------------------------------------------------------- #define NETDEV_RSFF(_name) \ - NET_REGISTER_DEV(nicRSFF, _name) + NET_REGISTER_DEV(NETDEV_RSFF, _name) #define NETDEV_DELAY(_name) \ - NET_REGISTER_DEV(nicDelay, _name) + NET_REGISTER_DEV(NETDEV_DELAY, _name) // ---------------------------------------------------------------------------------------- // Devices ... diff --git a/src/emu/netlist/devices/nld_log.h b/src/emu/netlist/devices/nld_log.h index f631b62464b..4b768b66b82 100644 --- a/src/emu/netlist/devices/nld_log.h +++ b/src/emu/netlist/devices/nld_log.h @@ -21,7 +21,7 @@ #include "../nl_base.h" #define LOG(_name, _I) \ - NET_REGISTER_DEV(log, _name) \ + NET_REGISTER_DEV(ÖPG, _name) \ NET_CONNECT(_name, I, _I) NETLIB_NAMESPACE_DEVICES_START() @@ -34,7 +34,7 @@ protected: ); #define LOGD(_name, _I, _I2) \ - NET_REGISTER_DEV(logD, _name) \ + NET_REGISTER_DEV(LOGD, _name) \ NET_CONNECT(_name, I, _I) \ NET_CONNECT(_name, I2, _I2) diff --git a/src/emu/netlist/devices/nld_mm5837.h b/src/emu/netlist/devices/nld_mm5837.h index 70afb3638ac..e5aad3daa81 100644 --- a/src/emu/netlist/devices/nld_mm5837.h +++ b/src/emu/netlist/devices/nld_mm5837.h @@ -23,7 +23,7 @@ #include "../analog/nld_twoterm.h" #define MM5837_DIP(_name) \ - NET_REGISTER_DEV(MM5837, _name) + NET_REGISTER_DEV(MM5837_DIP, _name) NETLIB_NAMESPACE_DEVICES_START() diff --git a/src/emu/netlist/devices/nld_ne555.h b/src/emu/netlist/devices/nld_ne555.h index c1a6091d2f8..f02c7763ebd 100644 --- a/src/emu/netlist/devices/nld_ne555.h +++ b/src/emu/netlist/devices/nld_ne555.h @@ -46,7 +46,7 @@ NETLIB_DEVICE(NE555, ); #define NE555_DIP(_name) \ - NET_REGISTER_DEV(NE555_dip, _name) + NET_REGISTER_DEV(NE555_DIP, _name) NETLIB_DEVICE_DERIVED_PURE(NE555_dip, NE555); diff --git a/src/emu/netlist/devices/nld_r2r_dac.h b/src/emu/netlist/devices/nld_r2r_dac.h index 8578deb2099..843c827a538 100644 --- a/src/emu/netlist/devices/nld_r2r_dac.h +++ b/src/emu/netlist/devices/nld_r2r_dac.h @@ -50,7 +50,7 @@ #include "../analog/nld_twoterm.h" #define R2R_DAC(_name, _VIN, _R, _N) \ - NET_REGISTER_DEV(r2r_dac, _name) \ + NET_REGISTER_DEV(R2R_DAC, _name) \ NETDEV_PARAMI(_name, VIN, _VIN) \ NETDEV_PARAMI(_name, R, _R) \ NETDEV_PARAMI(_name, N, _N) diff --git a/src/emu/netlist/devices/nld_system.h b/src/emu/netlist/devices/nld_system.h index de2154a78a9..76837f99d28 100644 --- a/src/emu/netlist/devices/nld_system.h +++ b/src/emu/netlist/devices/nld_system.h @@ -19,40 +19,40 @@ // ----------------------------------------------------------------------------- #define TTL_INPUT(_name, _v) \ - NET_REGISTER_DEV(logic_input, _name) \ + NET_REGISTER_DEV(TTL_INPUT, _name) \ PARAM(_name.IN, _v) #define LOGIC_INPUT(_name, _v, _family) \ - NET_REGISTER_DEV(logic_input, _name) \ + NET_REGISTER_DEV(LOGIC_INPUT, _name) \ PARAM(_name.IN, _v) \ PARAM(_name.FAMILY, _family) #define ANALOG_INPUT(_name, _v) \ - NET_REGISTER_DEV(analog_input, _name) \ + NET_REGISTER_DEV(ANALOG_INPUT, _name) \ PARAM(_name.IN, _v) #define MAINCLOCK(_name, _freq) \ - NET_REGISTER_DEV(mainclock, _name) \ + NET_REGISTER_DEV(MAINCLOCK, _name) \ PARAM(_name.FREQ, _freq) #define CLOCK(_name, _freq) \ - NET_REGISTER_DEV(clock, _name) \ + NET_REGISTER_DEV(CLOCK, _name) \ PARAM(_name.FREQ, _freq) #define EXTCLOCK(_name, _freq, _pattern) \ - NET_REGISTER_DEV(extclock, _name) \ + NET_REGISTER_DEV(EXTCLOCK, _name) \ PARAM(_name.FREQ, _freq) \ PARAM(_name.PATTERN, _pattern) #define GNDA() \ - NET_REGISTER_DEV(gnd, GND) + NET_REGISTER_DEV(GNDA, GND) #define DUMMY_INPUT(_name) \ - NET_REGISTER_DEV(dummy_input, _name) + NET_REGISTER_DEV(DUMMY_INPUT, _name) //FIXME: Usage discouraged, use OPTIMIZE_FRONTIER instead #define FRONTIER_DEV(_name, _IN, _G, _OUT) \ - NET_REGISTER_DEV(frontier, _name) \ + NET_REGISTER_DEV(FRONTIER_DEV, _name) \ NET_C(_IN, _name.I) \ NET_C(_G, _name.G) \ NET_C(_OUT, _name.Q) @@ -61,17 +61,17 @@ setup.register_frontier(# _attach, _r_in, _r_out); #define RES_SWITCH(_name, _IN, _P1, _P2) \ - NET_REGISTER_DEV(res_sw, _name) \ + NET_REGISTER_DEV(RES_SWITCH, _name) \ NET_C(_IN, _name.I) \ NET_C(_P1, _name.1) \ NET_C(_P2, _name.2) /* Default device to hold netlist parameters */ #define PARAMETERS(_name) \ - NET_REGISTER_DEV(netlistparams, _name) + NET_REGISTER_DEV(PARAMETERS, _name) #define AFUNC(_name, _N, _F) \ - NET_REGISTER_DEV(function, _name) \ + NET_REGISTER_DEV(AFUNC, _name) \ PARAM(_name.N, _N) \ PARAM(_name.FUNC, _F) diff --git a/src/emu/netlist/macro/nlm_cd4xxx.h b/src/emu/netlist/macro/nlm_cd4xxx.h index 9c2c4fef315..e841fb89afc 100644 --- a/src/emu/netlist/macro/nlm_cd4xxx.h +++ b/src/emu/netlist/macro/nlm_cd4xxx.h @@ -3,6 +3,17 @@ #include "../nl_setup.h" +/* + * Devices: + * + * CD4001_NOR : single gate + * CD4001_DIP : dip package + * CD4020_DIP : dip package (device model in core) + * CD4016_DIP : dip package (device model in core) + * CD4066_DIP : dip package (device model in core) + * + */ + #ifndef __PLIB_PREPROCESSOR__ /* ---------------------------------------------------------------------------- @@ -10,23 +21,23 @@ * ---------------------------------------------------------------------------*/ #define CD4001_NOR(_name) \ - NET_REGISTER_DEV_X(CD4001_NOR, _name) + NET_REGISTER_DEV(CD4001_NOR, _name) #define CD4001_DIP(_name) \ - NET_REGISTER_DEV_X(CD4001_DIP, _name) + NET_REGISTER_DEV(CD4001_DIP, _name) /* ---------------------------------------------------------------------------- * DIP only macros * ---------------------------------------------------------------------------*/ #define CD4020_DIP(_name) \ - NET_REGISTER_DEV_X(CD4020_DIP, _name) + NET_REGISTER_DEV(CD4020_DIP, _name) #define CD4066_DIP(_name) \ - NET_REGISTER_DEV_X(CD4066_DIP, _name) + NET_REGISTER_DEV(CD4066_DIP, _name) #define CD4016_DIP(_name) \ - NET_REGISTER_DEV_X(CD4016_DIP, _name) + NET_REGISTER_DEV(CD4016_DIP, _name) /* ---------------------------------------------------------------------------- * External declarations diff --git a/src/emu/netlist/macro/nlm_opamp.c b/src/emu/netlist/macro/nlm_opamp.c new file mode 100644 index 00000000000..143f4d8cfec --- /dev/null +++ b/src/emu/netlist/macro/nlm_opamp.c @@ -0,0 +1,47 @@ + +#include "nlm_opamp.h" + +#include "analog/nld_opamps.h" +#include "devices/nld_system.h" + +/* + * Generic layout with 4 opamps, VCC on pint 4 and GND on pin 11 + */ + +NETLIST_START(opamp_layout_4_4_11) + DIPPINS( /* +--------------+ */ + A.OUT, /* |1 ++ 14| */ D.OUT, + A.MINUS, /* |2 13| */ D.MINUS, + A.PLUS, /* |3 12| */ D.PLUS, + A.VCC, /* |4 11| */ A.GND, + B.PLUS, /* |5 10| */ C.PLUS, + B.MINUS, /* |6 9| */ C.MINUS, + B.OUT, /* |7 8| */ C.OUT + /* +--------------+ */ + ) + NET_C(A.GND, B.GND, C.GND, D.GND) + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) +NETLIST_END() + +NETLIST_START(MB3614_DIP) + /* The opamp actually has an FPF of about 500k. This doesn't work here and causes oscillations. + * FPF here therefore about half the Solver clock. + */ + OPAMP(A, "MB3614") + OPAMP(B, "MB3614") + OPAMP(C, "MB3614") + OPAMP(D, "MB3614") + + INCLUDE(opamp_layout_4_4_11) + +NETLIST_END() + +NETLIST_START(OPAMP_lib) + LOCAL_LIB_ENTRY(opamp_layout_4_4_11) + + NET_MODEL(".model MB3614 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=500k SLEW=0.6M RI=1000k RO=50 DAB=0.002)") + NET_MODEL(".model MB3614_SLOW OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=11k SLEW=0.6M RI=1000k RO=50 DAB=0.002)") + LOCAL_LIB_ENTRY(MB3614_DIP) + + +NETLIST_END() diff --git a/src/emu/netlist/macro/nlm_opamp.h b/src/emu/netlist/macro/nlm_opamp.h new file mode 100644 index 00000000000..d31a5f0b876 --- /dev/null +++ b/src/emu/netlist/macro/nlm_opamp.h @@ -0,0 +1,23 @@ +#ifndef NLM_OPAMP_H_ +#define NLM_OPAMP_H_ + +#include "../nl_setup.h" + +#ifndef __PLIB_PREPROCESSOR__ + +/* ---------------------------------------------------------------------------- + * Netlist Macros + * ---------------------------------------------------------------------------*/ + +#define MB3614_DIP(_name) \ + NET_REGISTER_DEV(MB3614_DIP, _name) + +/* ---------------------------------------------------------------------------- + * External declarations + * ---------------------------------------------------------------------------*/ + +NETLIST_EXTERNAL(OPAMP_lib) + +#endif + +#endif diff --git a/src/emu/netlist/macro/nlm_ttl74xx.h b/src/emu/netlist/macro/nlm_ttl74xx.h index 4ba6da0f660..91f757dbf7d 100644 --- a/src/emu/netlist/macro/nlm_ttl74xx.h +++ b/src/emu/netlist/macro/nlm_ttl74xx.h @@ -10,10 +10,10 @@ * ---------------------------------------------------------------------------*/ #define TTL_7416_GATE(_name) \ - NET_REGISTER_DEV_X(TTL_7416_GATE, _name) + NET_REGISTER_DEV(TTL_7416_GATE, _name) #define TTL_7416_DIP(_name) \ - NET_REGISTER_DEV_X(TTL7416_DIP, _name) + NET_REGISTER_DEV(TTL7416_DIP, _name) /* ---------------------------------------------------------------------------- * External declarations diff --git a/src/emu/netlist/nl_dice_compat.h b/src/emu/netlist/nl_dice_compat.h index c96f448af33..70661be23a7 100644 --- a/src/emu/netlist/nl_dice_compat.h +++ b/src/emu/netlist/nl_dice_compat.h @@ -40,10 +40,14 @@ sed -e 's/#define \(.*\)"\(.*\)"[ \t]*,[ \t]*\(.*\)/NET_ALIAS(\1,\2.\3)/' src/ma */ #ifndef NL_CONVERT_CPP -#ifdef NETLIST_DEVELOPMENT +#ifndef NETLIST_DEVELOPMENT +#define NETLIST_DEVELOPMENT 0 +#endif +#if (NETLIST_DEVELOPMENT) #define CHIP(_n, _t) setup.register_dev( palloc(netlist::devices::nld_ ## _t ## _dip), _n); #else -#define CHIP(_n, _t) setup.register_dev(NETLIB_NAME_STR(_t ## _dip), _n); +#define CHIP(_n, _t) setup.register_dev(NETLIB_NAME_STR_S(TTL_ ## _t ## _DIP), _n); +//#define CHIP(_n, _t) TTL_ ## _t ## _DIP(_n) #endif #define CONNECTION( ... ) CONNECTIONY( CONNECTIONX( __VA_ARGS__ ) ) @@ -114,7 +118,7 @@ public: #define CIRCUIT_LAYOUT_END NETLIST_END() #define CHIP_555_Mono(_name, _pdesc) \ - CHIP(# _name, NE555) \ + NE555_DIP(_name) \ NET_C(_name.6, _name.7) \ RES(_name ## _R, (_pdesc)->r) \ CAP(_name ## _C, (_pdesc)->c) \ @@ -126,7 +130,7 @@ public: NET_CSTR(# _name ".1", "GND") #define CHIP_555_Astable(_name, _pdesc) \ - CHIP(# _name, NE555) \ + NE555_DIP(_name) \ RES(_name ## _R1, (_pdesc)->r1) \ RES(_name ## _R2, (_pdesc)->r2) \ CAP(_name ## _C, (_pdesc)->c) \ diff --git a/src/emu/netlist/nl_factory.c b/src/emu/netlist/nl_factory.c index a62c889baed..665e1a74f40 100644 --- a/src/emu/netlist/nl_factory.c +++ b/src/emu/netlist/nl_factory.c @@ -48,6 +48,7 @@ factory_list_t::~factory_list_t() m_list.clear(); } +#if 0 device_t *factory_list_t::new_device_by_classname(const pstring &classname) const { for (std::size_t i=0; i < m_list.size(); i++) @@ -62,6 +63,7 @@ device_t *factory_list_t::new_device_by_classname(const pstring &classname) cons } return NULL; // appease code analysis } +#endif device_t *factory_list_t::new_device_by_name(const pstring &name, setup_t &setup) const { diff --git a/src/emu/netlist/nl_factory.h b/src/emu/netlist/nl_factory.h index a765840c487..c3e8577743a 100644 --- a/src/emu/netlist/nl_factory.h +++ b/src/emu/netlist/nl_factory.h @@ -82,7 +82,7 @@ namespace netlist m_list.add(factory); } - ATTR_COLD device_t *new_device_by_classname(const pstring &classname) const; + //ATTR_COLD device_t *new_device_by_classname(const pstring &classname) const; ATTR_COLD device_t *new_device_by_name(const pstring &name, setup_t &setup) const; ATTR_COLD base_factory_t * factory_by_name(const pstring &name, setup_t &setup) const; diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index cb36360362e..de5f377a548 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -21,21 +21,22 @@ static NETLIST_START(base) TTL_INPUT(ttlhigh, 1) TTL_INPUT(ttllow, 0) - NET_REGISTER_DEV(gnd, GND) - NET_REGISTER_DEV(netlistparams, NETLIST) + NET_REGISTER_DEV(GND, GND) + NET_REGISTER_DEV(PARAMETER, NETLIST) LOCAL_SOURCE(diode_models) LOCAL_SOURCE(bjt_models) LOCAL_SOURCE(family_models) LOCAL_SOURCE(TTL74XX_lib) LOCAL_SOURCE(CD4XXX_lib) - + LOCAL_SOURCE(OPAMP_lib) INCLUDE(diode_models); INCLUDE(bjt_models); INCLUDE(family_models); INCLUDE(TTL74XX_lib); INCLUDE(CD4XXX_lib); + INCLUDE(OPAMP_lib); NETLIST_END() @@ -128,34 +129,14 @@ device_t *setup_t::register_dev(const pstring &classname, const pstring &name) } else { - device_t *dev = factory().new_device_by_classname(classname); + device_t *dev = factory().new_device_by_name(classname, *this); + //device_t *dev = factory().new_device_by_classname(classname); if (dev == NULL) netlist().error("Class %s not found!\n", classname.cstr()); return register_dev(dev, name); } } -void setup_t::remove_dev(const pstring &name) -{ - device_t *dev = netlist().m_devices.find_by_name(name); - pstring temp = name + "."; - if (dev == NULL) - netlist().error("Device %s does not exist\n", name.cstr()); - - remove_start_with<tagmap_terminal_t>(m_terminals, temp); - remove_start_with<tagmap_param_t>(m_params, temp); - - const link_t *p = m_links.data(); - while (p != NULL) - { - const link_t *n = p+1; - if (temp.equals(p->e1.substr(0,temp.len())) || temp.equals(p->e2.substr(0,temp.len()))) - m_links.remove(*p); - p = n; - } - netlist().m_devices.remove_by_name(name); -} - void setup_t::register_model(const pstring &model) { m_models.add(model); @@ -163,7 +144,7 @@ void setup_t::register_model(const pstring &model) void setup_t::register_alias_nofqn(const pstring &alias, const pstring &out) { - if (!(m_alias.add(link_t(alias, out), false)==true)) + if (!m_alias.add(alias, out)) netlist().error("Error adding alias %s to alias list\n", alias.cstr()); } @@ -265,9 +246,9 @@ void setup_t::register_object(device_t &dev, const pstring &name, object_t &obj) { param_t ¶m = dynamic_cast<param_t &>(obj); //printf("name: %s\n", name.cstr()); - const pstring val = m_params_temp.find_by_name(name).e2; - if (val != "") + if (m_params_temp.contains(name)) { + const pstring val = m_params_temp[name]; switch (param.param_type()) { case param_t::DOUBLE: @@ -301,7 +282,7 @@ void setup_t::register_object(device_t &dev, const pstring &name, object_t &obj) netlist().error("Parameter is not supported %s : %s\n", name.cstr(), val.cstr()); } } - if (!(m_params.add(¶m, false)==true)) + if (!m_params.add(param.name(), ¶m)) netlist().error("Error adding parameter %s to parameter list\n", name.cstr()); } break; @@ -364,7 +345,7 @@ void setup_t::register_frontier(const pstring attach, const double r_IN, const d static int frontier_cnt = 0; pstring frontier_name = pstring::sprintf("frontier_%d", frontier_cnt); frontier_cnt++; - device_t *front = register_dev("nld_frontier", frontier_name); + device_t *front = register_dev("FRONTIER_DEV", frontier_name); register_param(frontier_name + ".RIN", r_IN); register_param(frontier_name + ".ROUT", r_OUT); register_link(frontier_name + ".G", "GND"); @@ -399,8 +380,17 @@ void setup_t::register_param(const pstring ¶m, const pstring &value) { pstring fqn = build_fqn(param); - if (!(m_params_temp.add(link_t(fqn, value), false)==true)) - netlist().error("Error adding parameter %s to parameter list\n", param.cstr()); + int idx = m_params_temp.index_of(fqn); + if (idx < 0) + { + if (!m_params_temp.add(fqn, value)) + netlist().error("Unexpected error adding parameter %s to parameter list\n", param.cstr()); + } + else + { + netlist().warning("Overwriting %s old <%s> new <%s>\n", fqn.cstr(), m_params_temp.value_at(idx).cstr(), value.cstr()); + m_params_temp[fqn] = value; + } } const pstring setup_t::resolve_alias(const pstring &name) const @@ -411,7 +401,8 @@ const pstring setup_t::resolve_alias(const pstring &name) const /* FIXME: Detect endless loop */ do { ret = temp; - temp = m_alias.find_by_name(ret).e2; + int p = m_alias.index_of(ret); + temp = (p>=0 ? m_alias.value_at(p) : ""); } while (temp != ""); NL_VERBOSE_OUT(("%s==>%s\n", name.cstr(), ret.cstr())); @@ -470,14 +461,14 @@ param_t *setup_t::find_param(const pstring ¶m_in, bool required) const pstring param_in_fqn = build_fqn(param_in); const pstring &outname = resolve_alias(param_in_fqn); - param_t *ret; + int ret; - ret = m_params.find_by_name(outname); - if (ret == NULL && required) + ret = m_params.index_of(outname); + if (ret < 0 && required) netlist().error("parameter %s(%s) not found!\n", param_in_fqn.cstr(), outname.cstr()); - if (ret != NULL) + if (ret != -1) NL_VERBOSE_OUT(("Found parameter %s\n", outname.cstr())); - return ret; + return (ret == -1 ? NULL : m_params.value_at(ret)); } // FIXME avoid dynamic cast here @@ -870,7 +861,7 @@ void setup_t::start_devices() { NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr())); NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr())); - device_t *nc = factory().new_device_by_classname("nld_log"); + device_t *nc = factory().new_device_by_name("LOG", *this); pstring name = "log_" + ll[i]; register_dev(nc, name); register_link(name + ".I", ll[i]); diff --git a/src/emu/netlist/nl_setup.h b/src/emu/netlist/nl_setup.h index 51800f4c199..129a6fef001 100644 --- a/src/emu/netlist/nl_setup.h +++ b/src/emu/netlist/nl_setup.h @@ -25,16 +25,10 @@ #define DIPPINS(_pin1, ...) \ setup.register_dippins_arr( #_pin1 ", " # __VA_ARGS__); -#define NET_REGISTER_DEV(_type, _name) \ - setup.register_dev(NETLIB_NAME_STR(_type), # _name); - /* to be used to reference new library truthtable devices */ -#define NET_REGISTER_DEV_X(_type, _name) \ +#define NET_REGISTER_DEV(_type, _name) \ setup.register_dev(# _type, # _name); -#define NET_REMOVE_DEV(_name) \ - setup.remove_dev(# _name); - #define NET_REGISTER_SIGNAL(_type, _name) \ NET_REGISTER_DEV(_type ## _ ## sig, _name) @@ -133,10 +127,8 @@ namespace netlist const pstring &name() const { return e1; } }; - typedef pnamedlist_t<link_t> tagmap_nstring_t; - typedef pnamedlist_t<param_t *> tagmap_param_t; + //typedef pnamedlist_t<link_t> tagmap_nstring_t; typedef pnamedlist_t<core_terminal_t *> tagmap_terminal_t; - typedef plist_t<link_t> tagmap_link_t; setup_t(netlist_t *netlist); ~setup_t(); @@ -217,10 +209,11 @@ namespace netlist netlist_t *m_netlist; - tagmap_nstring_t m_alias; - tagmap_param_t m_params; - tagmap_link_t m_links; - tagmap_nstring_t m_params_temp; + phashmap_t<pstring, pstring> m_alias; + phashmap_t<pstring, param_t *> m_params; + phashmap_t<pstring, pstring> m_params_temp; + + plist_t<link_t> m_links; factory_list_t *m_factory; @@ -245,6 +238,7 @@ namespace netlist const pstring resolve_alias(const pstring &name) const; devices::nld_base_proxy *get_d_a_proxy(core_terminal_t &out); +#if 0 template <class T> void remove_start_with(T &hm, pstring &sw) { @@ -258,6 +252,7 @@ namespace netlist } } } +#endif }; // ---------------------------------------------------------------------------------------- diff --git a/src/emu/netlist/plib/plists.h b/src/emu/netlist/plib/plists.h index e54c63f38e0..ab8ebf414c7 100644 --- a/src/emu/netlist/plib/plists.h +++ b/src/emu/netlist/plib/plists.h @@ -12,6 +12,7 @@ #include <cstring> #include <algorithm> +#include <cmath> #include "palloc.h" #include "pstring.h" @@ -66,6 +67,11 @@ public: ATTR_HOT std::size_t size() const { return m_capacity; } + void resize(const std::size_t new_size) + { + set_capacity(new_size); + } + protected: ATTR_COLD void set_capacity(const std::size_t new_capacity) { @@ -364,6 +370,14 @@ public: return _ListClass(NULL); } + int index_by_name(const pstring &name) const + { + for (std::size_t i=0; i < this->size(); i++) + if (get_name((*this)[i]) == name) + return (int) i; + return -1; + } + void remove_by_name(const pstring &name) { plist_t<_ListClass>::remove(find_by_name(name)); @@ -599,6 +613,219 @@ public: }; // ---------------------------------------------------------------------------------------- +// hashmap list +// ---------------------------------------------------------------------------------------- + + +template <class C> +struct phash_functor +{ + unsigned hash(const C &v) const { return (unsigned) v; } +}; + +template <> +struct phash_functor<pstring> +{ +#if 1 +#if 1 + unsigned hash(const pstring &v) const + { + const char *string = v.cstr(); + unsigned result = *string++; + for (UINT8 c = *string++; c != 0; c = *string++) + result = (result*33) ^ c; + return result; + } +#else + unsigned hash(const pstring &v) const + { + /* Fowler–Noll–Vo hash - FNV-1 */ + const char *string = v.cstr(); + unsigned result = 2166136261; + for (UINT8 c = *string++; c != 0; c = *string++) + result = (result * 16777619) ^ c; + // result = (result ^ c) * 16777619; FNV 1a + return result; + } +#endif +#else + unsigned hash(const pstring &v) const + { + /* jenkins one at a time algo */ + unsigned result = 0; + const char *string = v.cstr(); + while (*string) + { + result += *string; + string++; + result += (result << 10); + result ^= (result >> 6); + } + result += (result << 3); + result ^= (result >> 11); + result += (result << 15); + return result; + } +#endif +}; + +template <class K, class V, class H = phash_functor<K> > +class phashmap_t +{ +public: + phashmap_t() : m_hash(17) + { + for (unsigned i=0; i<m_hash.size(); i++) + m_hash[i] = -1; + } + + ~phashmap_t() + { + } + + struct element_t + { + element_t() { } + element_t(K key, unsigned hash, V value) + : m_key(key), m_hash(hash), m_value(value), m_next(-1) + {} + K m_key; + unsigned m_hash; + V m_value; + int m_next; + }; + + void clear() + { + if (0) + { + unsigned cnt = 0; + for (unsigned i=0; i<m_hash.size(); i++) + if (m_hash[i] >= 0) + cnt++; + const unsigned s = m_values.size(); + if (s>0) + printf("phashmap: %d elements %d hashsize, percent in overflow: %d\n", s, (unsigned) m_hash.size(), (s - cnt) * 100 / s); + else + printf("phashmap: No elements .. \n"); + } + m_values.clear(); + for (unsigned i=0; i<m_hash.size(); i++) + m_hash[i] = -1; + } + + bool contains(const K &key) const + { + return (get_idx(key) >= 0); + } + + int index_of(const K &key) const + { + return get_idx(key); + } + + unsigned size() const { return m_values.size(); } + + bool add(const K &key, const V &value) + { + /* + * we are using the Euler prime function here + * + * n * n + n + 41 | 40 >= n >=0 + * + * and accept that outside we will not have a prime + * + */ + if (m_values.size() > m_hash.size()) + { + unsigned n = std::sqrt( 2 * m_hash.size()); + n = n * n + n + 41; + m_hash.resize(n); + rebuild(); + } + const H h; + const unsigned hash=h.hash(key); + const unsigned pos = hash % m_hash.size(); + if (m_hash[pos] == -1) + { + unsigned vpos = m_values.size(); + m_values.add(element_t(key, hash, value)); + m_hash[pos] = vpos; + } + else + { + int ep = m_hash[pos]; + + for (; ep != -1; ep = m_values[ep].m_next) + { + if (m_values[ep].m_hash == hash && m_values[ep].m_key == key ) + return false; /* duplicate */ + } + unsigned vpos = m_values.size(); + m_values.add(element_t(key, hash, value)); + m_values[vpos].m_next = m_hash[pos]; + m_hash[pos] = vpos; + } + return true; + } + + V& operator[](const K &key) + { + int p = get_idx(key); + if (p == -1) + { + p = m_values.size(); + add(key, V()); + } + return m_values[p].m_value; + } + + const V& operator[](const K &key) const + { + int p = get_idx(key); + if (p == -1) + { + p = m_values.size(); + add(key, V()); + } + return m_values[p].m_value; + } + + V& value_at(const unsigned pos) { return m_values[pos].m_value; } + const V& value_at(const unsigned pos) const { return m_values[pos].m_value; } + + V& key_at(const unsigned pos) const { return m_values[pos].m_key; } +private: + + int get_idx(const K &key) const + { + H h; + const unsigned hash=h.hash(key); + const unsigned pos = hash % m_hash.size(); + + for (int ep = m_hash[pos]; ep != -1; ep = m_values[ep].m_next) + if (m_values[ep].m_hash == hash && m_values[ep].m_key == key ) + return ep; + return -1; + } + + void rebuild() + { + for (unsigned i=0; i<m_hash.size(); i++) + m_hash[i] = -1; + for (unsigned i=0; i<m_values.size(); i++) + { + unsigned pos = m_values[i].m_hash % m_hash.size(); + m_values[i].m_next = m_hash[pos]; + m_hash[pos] = i; + } + + } + plist_t<element_t> m_values; + parray_t<int> m_hash; +}; + +// ---------------------------------------------------------------------------------------- // sort a list ... slow, I am lazy // elements must support ">" operator. // ---------------------------------------------------------------------------------------- diff --git a/src/emu/netlist/plib/pstate.c b/src/emu/netlist/plib/pstate.c index 326eb13fe49..909bfcb2e58 100644 --- a/src/emu/netlist/plib/pstate.c +++ b/src/emu/netlist/plib/pstate.c @@ -75,3 +75,4 @@ template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state, m_save.add(p); state.register_state(*this, stname); } + diff --git a/src/emu/netlist/solver/nld_solver.h b/src/emu/netlist/solver/nld_solver.h index 978091ccfb2..682483dfde3 100644 --- a/src/emu/netlist/solver/nld_solver.h +++ b/src/emu/netlist/solver/nld_solver.h @@ -22,7 +22,7 @@ // ---------------------------------------------------------------------------------------- #define SOLVER(_name, _freq) \ - NET_REGISTER_DEV(solver, _name) \ + NET_REGISTER_DEV(SOLVER, _name) \ PARAM(_name.FREQ, _freq) // ---------------------------------------------------------------------------------------- diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c index 401bf2441f0..ae9b9e7dffc 100644 --- a/src/emu/sound/ymf278b.c +++ b/src/emu/sound/ymf278b.c @@ -690,6 +690,7 @@ WRITE8_MEMBER( ymf278b_device::write ) timer_busy_start(0); if (m_lastport) B_w(m_port_AB, data); else A_w(m_port_AB, data); + m_last_fm_data = data; break; case 4: @@ -737,6 +738,8 @@ READ8_MEMBER( ymf278b_device::read ) case 1: case 3: // but they're not implemented here yet + // This may be incorrect, but it makes the mbwave moonsound detection in msx drivers pass. + ret = m_last_fm_data; break; // PCM regs @@ -879,6 +882,7 @@ void ymf278b_device::register_save_state() save_item(NAME(m_port_AB)); save_item(NAME(m_port_C)); save_item(NAME(m_lastport)); + save_item(NAME(m_last_fm_data)); for (i = 0; i < 24; ++i) { @@ -979,7 +983,8 @@ ymf278b_device::ymf278b_device(const machine_config &mconfig, const char *tag, d device_sound_interface(mconfig, *this), device_memory_interface(mconfig, *this), m_space_config("samples", ENDIANNESS_BIG, 8, 22, 0, NULL), - m_irq_handler(*this) + m_irq_handler(*this), + m_last_fm_data(0) { m_address_map[0] = *ADDRESS_MAP_NAME(ymf278b); } diff --git a/src/emu/sound/ymf278b.h b/src/emu/sound/ymf278b.h index 5423aad65c8..8a3fdad12cb 100644 --- a/src/emu/sound/ymf278b.h +++ b/src/emu/sound/ymf278b.h @@ -131,6 +131,7 @@ private: direct_read_data * m_direct; const address_space_config m_space_config; devcb_write_line m_irq_handler; + UINT8 m_last_fm_data; }; extern const device_type YMF278B; diff --git a/src/emu/video/v9938.c b/src/emu/video/v9938.c index 3c1053f2776..3192593e76a 100644 --- a/src/emu/video/v9938.c +++ b/src/emu/video/v9938.c @@ -37,8 +37,13 @@ enum V9938_MODE_UNKNOWN }; +#define MODEL_V9938 (0) +#define MODEL_V9958 (1) + #define EXPMEM_OFFSET 0x20000 +#define LONG_WIDTH (512 + 32) + static const char *const v9938_modes[] = { "TEXT 1", "MULTICOLOR", "GRAPHIC 1", "GRAPHIC 2", "GRAPHIC 3", "GRAPHIC 4", "GRAPHIC 5", "GRAPHIC 6", "GRAPHIC 7", "TEXT 2", @@ -86,10 +91,6 @@ v99x8_device::v99x8_device(const machine_config &mconfig, device_type type, cons m_scanline(0), m_blink(0), m_blink_count(0), - m_size(0), - m_size_old(0), - m_size_auto(0), - m_size_now(0), m_mx_delta(0), m_my_delta(0), m_button_state(0), @@ -166,19 +167,6 @@ int v99x8_device::interrupt () return m_int_state; } -void v99x8_device::set_resolution (int i) -{ - if (i == RENDER_AUTO) - { - m_size_auto = 1; - } - else - { - m_size = i; - m_size_auto = 0; - } -} - /* Not really right... won't work with sprites in graphics 7 and with palette updated mid-screen @@ -569,7 +557,6 @@ void v99x8_device::device_start() m_vdp_engine = NULL; m_screen->register_screen_bitmap(m_bitmap); - m_size_old = -1; // Video RAM is allocated as an own address space m_vram_space = &space(AS_DATA); @@ -602,10 +589,6 @@ void v99x8_device::device_start() save_item(NAME(m_scanline)); save_item(NAME(m_blink)); save_item(NAME(m_blink_count)); - save_item(NAME(m_size)); - save_item(NAME(m_size_old)); - save_item(NAME(m_size_auto)); - save_item(NAME(m_size_now)); save_item(NAME(m_mx_delta)); save_item(NAME(m_my_delta)); save_item(NAME(m_button_state)); @@ -876,67 +859,43 @@ inline bool v99x8_device::v9938_second_field() return !(((m_cont_reg[9] & 0x04) && !(m_stat_reg[2] & 2)) || m_blink); } -/* -* This file is included for a number of different situations: -* _Width : can be 512 + 32 or 256 + 16 -* V9938_BPP : can be 8 or 16 -*/ - -template<typename _PixelType, int _Width> -void v99x8_device::default_border(const pen_t *pens, _PixelType *ln) +void v99x8_device::default_border(const pen_t *pens, UINT16 *ln) { - _PixelType pen; + UINT16 pen; int i; pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]]; - i = _Width; + i = LONG_WIDTH; while (i--) *ln++ = pen; - - if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW; } -template<typename _PixelType, int _Width> -void v99x8_device::graphic7_border(const pen_t *pens, _PixelType *ln) +void v99x8_device::graphic7_border(const pen_t *pens, UINT16 *ln) { - _PixelType pen; + UINT16 pen; int i; pen = pens[m_pal_ind256[m_cont_reg[7]]]; - i = _Width; + i = LONG_WIDTH; while (i--) *ln++ = pen; - - if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW; } -template<typename _PixelType, int _Width> -void v99x8_device::graphic5_border(const pen_t *pens, _PixelType *ln) +void v99x8_device::graphic5_border(const pen_t *pens, UINT16 *ln) { int i; - _PixelType pen0; - if (_Width > 512) - { - _PixelType pen1; + UINT16 pen0; + UINT16 pen1; - pen1 = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]]; - pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; - i = (_Width) / 2; - while (i--) { *ln++ = pen0; *ln++ = pen1; } - } - else - { - pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; - i = _Width; - while (i--) *ln++ = pen0; - } - m_size_now = RENDER_HIGH; + pen1 = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]]; + pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; + i = LONG_WIDTH / 2; + while (i--) { *ln++ = pen0; *ln++ = pen1; } } -template<typename _PixelType, int _Width> -void v99x8_device::mode_text1(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_text1(const pen_t *pens, UINT16 *ln, int line) { int pattern, x, xx, name, xxx; - _PixelType fg, bg, pen; + UINT16 fg, bg, pen; int nametbl_addr, patterntbl_addr; patterntbl_addr = m_cont_reg[4] << 11; @@ -949,9 +908,7 @@ void v99x8_device::mode_text1(const pen_t *pens, _PixelType *ln, int line) pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]]; - xxx = m_offset_x + 8; - if (_Width > 512) - xxx *= 2; + xxx = (m_offset_x + 8) * 2; while (xxx--) *ln++ = pen; for (x=0;x<40;x++) @@ -961,26 +918,21 @@ void v99x8_device::mode_text1(const pen_t *pens, _PixelType *ln, int line) for (xx=0;xx<6;xx++) { *ln++ = (pattern & 0x80) ? fg : bg; - if (_Width > 512) - *ln++ = (pattern & 0x80) ? fg : bg; + *ln++ = (pattern & 0x80) ? fg : bg; pattern <<= 1; } /* width height 212, characters start repeating at the bottom */ name = (name + 1) & 0x3ff; } - xxx = (16 - m_offset_x) + 8; - if (_Width > 512) - xxx *= 2; + xxx = ((16 - m_offset_x) + 8) * 2; while (xxx--) *ln++ = pen; - if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW; } -template<typename _PixelType, int _Width> -void v99x8_device::mode_text2(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_text2(const pen_t *pens, UINT16 *ln, int line) { int pattern, x, charcode, name, xxx, patternmask, colourmask; - _PixelType fg, bg, fg0, bg0, pen; + UINT16 fg, bg, fg0, bg0, pen; int nametbl_addr, patterntbl_addr, colourtbl_addr; patterntbl_addr = m_cont_reg[4] << 11; @@ -1000,10 +952,8 @@ void v99x8_device::mode_text2(const pen_t *pens, _PixelType *ln, int line) name = (line/8)*80; - xxx = m_offset_x + 8; + xxx = (m_offset_x + 8) * 2; pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]]; - if (_Width > 512) - xxx *= 2; while (xxx--) *ln++ = pen; for (x=0;x<80;x++) @@ -1017,21 +967,12 @@ void v99x8_device::mode_text2(const pen_t *pens, _PixelType *ln, int line) pattern = m_vram_space->read_byte(patterntbl_addr + ((charcode * 8) + ((line + m_cont_reg[23]) & 7))); - if (_Width > 512) - { - *ln++ = (pattern & 0x80) ? fg0 : bg0; - *ln++ = (pattern & 0x40) ? fg0 : bg0; - *ln++ = (pattern & 0x20) ? fg0 : bg0; - *ln++ = (pattern & 0x10) ? fg0 : bg0; - *ln++ = (pattern & 0x08) ? fg0 : bg0; - *ln++ = (pattern & 0x04) ? fg0 : bg0; - } - else - { - *ln++ = (pattern & 0x80) ? fg0 : bg0; - *ln++ = (pattern & 0x20) ? fg0 : bg0; - *ln++ = (pattern & 0x08) ? fg0 : bg0; - } + *ln++ = (pattern & 0x80) ? fg0 : bg0; + *ln++ = (pattern & 0x40) ? fg0 : bg0; + *ln++ = (pattern & 0x20) ? fg0 : bg0; + *ln++ = (pattern & 0x10) ? fg0 : bg0; + *ln++ = (pattern & 0x08) ? fg0 : bg0; + *ln++ = (pattern & 0x04) ? fg0 : bg0; name++; continue; @@ -1041,38 +982,25 @@ void v99x8_device::mode_text2(const pen_t *pens, _PixelType *ln, int line) pattern = m_vram_space->read_byte(patterntbl_addr + ((charcode * 8) + ((line + m_cont_reg[23]) & 7))); - if (_Width > 512) - { - *ln++ = (pattern & 0x80) ? fg : bg; - *ln++ = (pattern & 0x40) ? fg : bg; - *ln++ = (pattern & 0x20) ? fg : bg; - *ln++ = (pattern & 0x10) ? fg : bg; - *ln++ = (pattern & 0x08) ? fg : bg; - *ln++ = (pattern & 0x04) ? fg : bg; - } - else - { - *ln++ = (pattern & 0x80) ? fg : bg; - *ln++ = (pattern & 0x20) ? fg : bg; - *ln++ = (pattern & 0x08) ? fg : bg; - } + *ln++ = (pattern & 0x80) ? fg : bg; + *ln++ = (pattern & 0x40) ? fg : bg; + *ln++ = (pattern & 0x20) ? fg : bg; + *ln++ = (pattern & 0x10) ? fg : bg; + *ln++ = (pattern & 0x08) ? fg : bg; + *ln++ = (pattern & 0x04) ? fg : bg; name++; } - xxx = 16 - m_offset_x + 8; - if (_Width > 512) - xxx *= 2; + xxx = (16 - m_offset_x + 8) * 2; while (xxx--) *ln++ = pen; - m_size_now = RENDER_HIGH; } -template<typename _PixelType, int _Width> -void v99x8_device::mode_multi(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_multi(const pen_t *pens, UINT16 *ln, int line) { int nametbl_addr, patterntbl_addr, colour; int name, line2, x, xx; - _PixelType pen, pen_bg; + UINT16 pen, pen_bg; nametbl_addr = (m_cont_reg[2] << 10); patterntbl_addr = (m_cont_reg[4] << 11); @@ -1081,10 +1009,7 @@ void v99x8_device::mode_multi(const pen_t *pens, _PixelType *ln, int line) name = (line2/8)*32; pen_bg = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]]; - if (_Width < 512) - xx = m_offset_x; - else - xx = m_offset_x * 2; + xx = m_offset_x * 2; while (xx--) *ln++ = pen_bg; for (x=0;x<32;x++) @@ -1096,40 +1021,30 @@ void v99x8_device::mode_multi(const pen_t *pens, _PixelType *ln, int line) *ln++ = pen; *ln++ = pen; *ln++ = pen; - if (_Width > 512) - { - *ln++ = pen; - *ln++ = pen; - *ln++ = pen; - *ln++ = pen; - } + *ln++ = pen; + *ln++ = pen; + *ln++ = pen; + *ln++ = pen; pen = pens[m_pal_ind16[colour&15]]; /* eight pixels */ *ln++ = pen; *ln++ = pen; *ln++ = pen; *ln++ = pen; - if (_Width > 512) - { - *ln++ = pen; - *ln++ = pen; - *ln++ = pen; - *ln++ = pen; - } + *ln++ = pen; + *ln++ = pen; + *ln++ = pen; + *ln++ = pen; name++; } - xx = 16 - m_offset_x; - if (_Width > 512) - xx *= 2; + xx = (16 - m_offset_x) * 2; while (xx--) *ln++ = pen_bg; - if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW; } -template<typename _PixelType, int _Width> -void v99x8_device::mode_graphic1(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_graphic1(const pen_t *pens, UINT16 *ln, int line) { - _PixelType fg, bg, pen; + UINT16 fg, bg, pen; int nametbl_addr, patterntbl_addr, colourtbl_addr; int pattern, x, xx, line2, name, charcode, colour, xxx; @@ -1142,10 +1057,7 @@ void v99x8_device::mode_graphic1(const pen_t *pens, _PixelType *ln, int line) name = (line2/8)*32; pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]]; - if (_Width < 512) - xxx = m_offset_x; - else - xxx = m_offset_x * 2; + xxx = m_offset_x * 2; while (xxx--) *ln++ = pen; for (x=0;x<32;x++) @@ -1159,24 +1071,19 @@ void v99x8_device::mode_graphic1(const pen_t *pens, _PixelType *ln, int line) for (xx=0;xx<8;xx++) { *ln++ = (pattern & 0x80) ? fg : bg; - if (_Width > 512) - *ln++ = (pattern & 0x80) ? fg : bg; + *ln++ = (pattern & 0x80) ? fg : bg; pattern <<= 1; } name++; } - xx = 16 - m_offset_x; - if (_Width > 512) - xx *= 2; + xx = (16 - m_offset_x) * 2; while (xx--) *ln++ = pen; - if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW; } -template<typename _PixelType, int _Width> -void v99x8_device::mode_graphic23(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_graphic23(const pen_t *pens, UINT16 *ln, int line) { - _PixelType fg, bg, pen; + UINT16 fg, bg, pen; int nametbl_addr, patterntbl_addr, colourtbl_addr; int pattern, x, xx, line2, name, charcode, colour, colourmask, patternmask, xxx; @@ -1192,10 +1099,7 @@ void v99x8_device::mode_graphic23(const pen_t *pens, _PixelType *ln, int line) name = (line2/8)*32; pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]]; - if (_Width < 512) - xxx = m_offset_x; - else - xxx = m_offset_x * 2; + xxx = m_offset_x * 2; while (xxx--) *ln++ = pen; for (x=0;x<32;x++) @@ -1208,26 +1112,21 @@ void v99x8_device::mode_graphic23(const pen_t *pens, _PixelType *ln, int line) for (xx=0;xx<8;xx++) { *ln++ = (pattern & 0x80) ? fg : bg; - if (_Width > 512) - *ln++ = (pattern & 0x80) ? fg : bg; + *ln++ = (pattern & 0x80) ? fg : bg; pattern <<= 1; } name++; } - xx = 16 - m_offset_x; - if (_Width > 512) - xx *= 2; + xx = (16 - m_offset_x) * 2; while (xx--) *ln++ = pen; - if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW; } -template<typename _PixelType, int _Width> -void v99x8_device::mode_graphic4(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_graphic4(const pen_t *pens, UINT16 *ln, int line) { int nametbl_addr, colour; int line2, linemask, x, xx; - _PixelType pen, pen_bg; + UINT16 pen, pen_bg; linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7; @@ -1238,10 +1137,7 @@ void v99x8_device::mode_graphic4(const pen_t *pens, _PixelType *ln, int line) nametbl_addr += 0x8000; pen_bg = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]]; - if (_Width < 512) - xx = m_offset_x; - else - xx = m_offset_x * 2; + xx = m_offset_x * 2; while (xx--) *ln++ = pen_bg; for (x=0;x<128;x++) @@ -1249,28 +1145,22 @@ void v99x8_device::mode_graphic4(const pen_t *pens, _PixelType *ln, int line) colour = m_vram_space->read_byte(nametbl_addr++); pen = pens[m_pal_ind16[colour>>4]]; *ln++ = pen; - if (_Width > 512) - *ln++ = pen; + *ln++ = pen; pen = pens[m_pal_ind16[colour&15]]; *ln++ = pen; - if (_Width > 512) - *ln++ = pen; + *ln++ = pen; } - xx = 16 - m_offset_x; - if (_Width > 512) - xx *= 2; + xx = (16 - m_offset_x) * 2; while (xx--) *ln++ = pen_bg; - if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW; } -template<typename _PixelType, int _Width> -void v99x8_device::mode_graphic5(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_graphic5(const pen_t *pens, UINT16 *ln, int line) { int nametbl_addr, colour; int line2, linemask, x, xx; - _PixelType pen_bg0[4]; - _PixelType pen_bg1[4]; + UINT16 pen_bg0[4]; + UINT16 pen_bg1[4]; linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7; @@ -1280,70 +1170,42 @@ void v99x8_device::mode_graphic5(const pen_t *pens, _PixelType *ln, int line) if ( (m_cont_reg[2] & 0x20) && v9938_second_field() ) nametbl_addr += 0x8000; - if (_Width > 512) - { - pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]]; - pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; - - xx = m_offset_x; - while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; } - - x = (m_cont_reg[8] & 0x20) ? 0 : 1; - - for (;x<4;x++) - { - pen_bg0[x] = pens[m_pal_ind16[x]]; - pen_bg1[x] = pens[m_pal_ind16[x]]; - } + pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]]; + pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; - for (x=0;x<128;x++) - { - colour = m_vram_space->read_byte(nametbl_addr++); + xx = m_offset_x; + while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; } - *ln++ = pen_bg0[colour>>6]; - *ln++ = pen_bg1[(colour>>4)&3]; - *ln++ = pen_bg0[(colour>>2)&3]; - *ln++ = pen_bg1[(colour&3)]; - } + x = (m_cont_reg[8] & 0x20) ? 0 : 1; - pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]]; - pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; - xx = 16 - m_offset_x; - while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; } - } - else + for (;x<4;x++) { - pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; - - x = (m_cont_reg[8] & 0x20) ? 0 : 1; - - for (;x<4;x++) - pen_bg0[x] = pens[m_pal_ind16[x]]; - - xx = m_offset_x; - while (xx--) *ln++ = pen_bg0[0]; + pen_bg0[x] = pens[m_pal_ind16[x]]; + pen_bg1[x] = pens[m_pal_ind16[x]]; + } - for (x=0;x<128;x++) - { - colour = m_vram_space->read_byte(nametbl_addr++); - *ln++ = pen_bg0[colour>>6]; - *ln++ = pen_bg0[(colour>>2)&3]; - } + for (x=0;x<128;x++) + { + colour = m_vram_space->read_byte(nametbl_addr++); - pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; - xx = 16 - m_offset_x; - while (xx--) *ln++ = pen_bg0[0]; + *ln++ = pen_bg0[colour>>6]; + *ln++ = pen_bg1[(colour>>4)&3]; + *ln++ = pen_bg0[(colour>>2)&3]; + *ln++ = pen_bg1[(colour&3)]; } - m_size_now = RENDER_HIGH; + + pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]]; + pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]]; + xx = 16 - m_offset_x; + while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; } } -template<typename _PixelType, int _Width> -void v99x8_device::mode_graphic6(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_graphic6(const pen_t *pens, UINT16 *ln, int line) { UINT8 colour; int line2, linemask, x, xx, nametbl_addr; - _PixelType pen_bg, fg0; - _PixelType fg1; + UINT16 pen_bg, fg0; + UINT16 fg1; linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7; @@ -1354,10 +1216,7 @@ void v99x8_device::mode_graphic6(const pen_t *pens, _PixelType *ln, int line) nametbl_addr += 0x10000; pen_bg = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]]; - if (_Width < 512) - xx = m_offset_x; - else - xx = m_offset_x * 2; + xx = m_offset_x * 2; while (xx--) *ln++ = pen_bg; if (m_cont_reg[2] & 0x40) @@ -1367,21 +1226,11 @@ void v99x8_device::mode_graphic6(const pen_t *pens, _PixelType *ln, int line) nametbl_addr++; colour = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1)); fg0 = pens[m_pal_ind16[colour>>4]]; - if (_Width < 512) - { - *ln++ = fg0; *ln++ = fg0; - *ln++ = fg0; *ln++ = fg0; - *ln++ = fg0; *ln++ = fg0; - *ln++ = fg0; *ln++ = fg0; - } - else - { - fg1 = pens[m_pal_ind16[colour&15]]; - *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; - *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; - *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; - *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; - } + fg1 = pens[m_pal_ind16[colour&15]]; + *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; + *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; + *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; + *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1; nametbl_addr += 7; } } @@ -1391,25 +1240,20 @@ void v99x8_device::mode_graphic6(const pen_t *pens, _PixelType *ln, int line) { colour = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1)); *ln++ = pens[m_pal_ind16[colour>>4]]; - if (_Width > 512) - *ln++ = pens[m_pal_ind16[colour&15]]; + *ln++ = pens[m_pal_ind16[colour&15]]; nametbl_addr++; } } - xx = 16 - m_offset_x; - if (_Width > 512) - xx *= 2; + xx = (16 - m_offset_x) * 2; while (xx--) *ln++ = pen_bg; - m_size_now = RENDER_HIGH; } -template<typename _PixelType, int _Width> -void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_graphic7(const pen_t *pens, UINT16 *ln, int line) { UINT8 colour; int line2, linemask, x, xx, nametbl_addr; - _PixelType pen, pen_bg; + UINT16 pen, pen_bg; linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7; @@ -1420,10 +1264,7 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line) nametbl_addr += 0x10000; pen_bg = pens[m_pal_ind256[m_cont_reg[7]]]; - if (_Width < 512) - xx = m_offset_x; - else - xx = m_offset_x * 2; + xx = m_offset_x * 2; while (xx--) *ln++ = pen_bg; if ((m_v9958_sp_mode & 0x18) == 0x08) // v9958 screen 12, puzzle star title screen @@ -1445,23 +1286,16 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line) (colour[2] & 7) << 5 | (colour[3] & 7) << 8; *ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)]; - if (_Width > 512) - *ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)]; + *ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)]; *ln++ = s_pal_indYJK[ind | ((colour[1] >> 3) & 31)]; - - if (_Width > 512) - *ln++ = s_pal_indYJK[ind | ((colour[1] >> 3) & 31)]; + *ln++ = s_pal_indYJK[ind | ((colour[1] >> 3) & 31)]; *ln++ = s_pal_indYJK[ind | ((colour[2] >> 3) & 31)]; - - if (_Width > 512) - *ln++ = s_pal_indYJK[ind | ((colour[2] >> 3) & 31)]; + *ln++ = s_pal_indYJK[ind | ((colour[2] >> 3) & 31)]; *ln++ = s_pal_indYJK[ind | ((colour[3] >> 3) & 31)]; - - if (_Width > 512) - *ln++ = s_pal_indYJK[ind | ((colour[3] >> 3) & 31)]; + *ln++ = s_pal_indYJK[ind | ((colour[3] >> 3) & 31)]; nametbl_addr++; } @@ -1485,23 +1319,16 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line) (colour[2] & 7) << 5 | (colour[3] & 7) << 8; *ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)]; - if (_Width > 512) - *ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)]; + *ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)]; *ln++ = colour[1] & 8 ? m_pal_ind16[colour[1] >> 4] : s_pal_indYJK[ind | ((colour[1] >> 3) & 30)]; - - if (_Width > 512) - *ln++ = colour[1] & 8 ? m_pal_ind16[colour[1] >> 4] : s_pal_indYJK[ind | ((colour[1] >> 3) & 30)]; + *ln++ = colour[1] & 8 ? m_pal_ind16[colour[1] >> 4] : s_pal_indYJK[ind | ((colour[1] >> 3) & 30)]; *ln++ = colour[2] & 8 ? m_pal_ind16[colour[2] >> 4] : s_pal_indYJK[ind | ((colour[2] >> 3) & 30)]; - - if (_Width > 512) - *ln++ = colour[2] & 8 ? m_pal_ind16[colour[2] >> 4] : s_pal_indYJK[ind | ((colour[2] >> 3) & 30)]; + *ln++ = colour[2] & 8 ? m_pal_ind16[colour[2] >> 4] : s_pal_indYJK[ind | ((colour[2] >> 3) & 30)]; *ln++ = colour[3] & 8 ? m_pal_ind16[colour[3] >> 4] : s_pal_indYJK[ind | ((colour[3] >> 3) & 30)]; - - if (_Width > 512) - *ln++ = colour[3] & 8 ? m_pal_ind16[colour[3] >> 4] : s_pal_indYJK[ind | ((colour[3] >> 3) & 30)]; + *ln++ = colour[3] & 8 ? m_pal_ind16[colour[3] >> 4] : s_pal_indYJK[ind | ((colour[3] >> 3) & 30)]; nametbl_addr++; } @@ -1517,13 +1344,10 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line) *ln++ = pen; *ln++ = pen; *ln++ = pen; *ln++ = pen; *ln++ = pen; *ln++ = pen; - if (_Width > 512) - { - *ln++ = pen; *ln++ = pen; - *ln++ = pen; *ln++ = pen; - *ln++ = pen; *ln++ = pen; - *ln++ = pen; *ln++ = pen; - } + *ln++ = pen; *ln++ = pen; + *ln++ = pen; *ln++ = pen; + *ln++ = pen; *ln++ = pen; + *ln++ = pen; *ln++ = pen; nametbl_addr++; } } @@ -1534,134 +1358,91 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line) colour = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1)); pen = pens[m_pal_ind256[colour]]; *ln++ = pen; - if (_Width > 512) - *ln++ = pen; + *ln++ = pen; nametbl_addr++; } } - xx = 16 - m_offset_x; - if (_Width > 512) - xx *= 2; + xx = (16 - m_offset_x) * 2; while (xx--) *ln++ = pen_bg; - if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW; } -template<typename _PixelType, int _Width> -void v99x8_device::mode_unknown(const pen_t *pens, _PixelType *ln, int line) +void v99x8_device::mode_unknown(const pen_t *pens, UINT16 *ln, int line) { - _PixelType fg, bg; + UINT16 fg, bg; int x; fg = pens[m_pal_ind16[m_cont_reg[7] >> 4]]; bg = pens[m_pal_ind16[m_cont_reg[7] & 15]]; - if (_Width < 512) - { - x = m_offset_x; - while (x--) *ln++ = bg; + x = m_offset_x * 2; + while (x--) *ln++ = bg; - x = 256; - while (x--) *ln++ = fg; + x = 512; + while (x--) *ln++ = fg; - x = 16 - m_offset_x; - while (x--) *ln++ = bg; - } - else - { - x = m_offset_x * 2; - while (x--) *ln++ = bg; - - x = 512; - while (x--) *ln++ = fg; - - x = (16 - m_offset_x) * 2; - while (x--) *ln++ = bg; - } - if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW; + x = (16 - m_offset_x) * 2; + while (x--) *ln++ = bg; } -template<typename _PixelType, int _Width> -void v99x8_device::default_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col) +void v99x8_device::default_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col) { int i; - if (_Width > 512) - ln += m_offset_x * 2; - else - ln += m_offset_x; + ln += m_offset_x * 2; for (i=0;i<256;i++) { if (col[i] & 0x80) { *ln++ = pens[m_pal_ind16[col[i]&0x0f]]; - if (_Width > 512) - *ln++ = pens[m_pal_ind16[col[i]&0x0f]]; + *ln++ = pens[m_pal_ind16[col[i]&0x0f]]; } else { - if (_Width > 512) - ln += 2; - else - ln++; + ln += 2; } } } -template<typename _PixelType, int _Width> -void v99x8_device::graphic5_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col) + +void v99x8_device::graphic5_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col) { int i; - if (_Width > 512) - ln += m_offset_x * 2; - else - ln += m_offset_x; + ln += m_offset_x * 2; for (i=0;i<256;i++) { if (col[i] & 0x80) { *ln++ = pens[m_pal_ind16[(col[i]>>2)&0x03]]; - if (_Width > 512) - *ln++ = pens[m_pal_ind16[col[i]&0x03]]; + *ln++ = pens[m_pal_ind16[col[i]&0x03]]; } else { - if (_Width > 512) - ln += 2; - else - ln++; + ln += 2; } } } -template<typename _PixelType, int _Width> -void v99x8_device::graphic7_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col) +void v99x8_device::graphic7_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col) { static const UINT16 g7_ind16[16] = { 0, 2, 192, 194, 48, 50, 240, 242, 482, 7, 448, 455, 56, 63, 504, 511 }; int i; - if (_Width > 512) - ln += m_offset_x * 2; - else - ln += m_offset_x; + ln += m_offset_x * 2; for (i=0;i<256;i++) { if (col[i] & 0x80) { *ln++ = pens[g7_ind16[col[i]&0x0f]]; - if (_Width > 512) - *ln++ = pens[g7_ind16[col[i]&0x0f]]; + *ln++ = pens[g7_ind16[col[i]&0x0f]]; } else { - if (_Width > 512) - ln += 2; - else - ln++; + ln += 2; } } } @@ -1917,98 +1698,74 @@ void v99x8_device::sprite_mode2 (int line, UINT8 *col) m_stat_reg[0] = (m_stat_reg[0] & 0xa0) | p; } -#define SHORT_WIDTH (256 + 16) -#define LONG_WIDTH (512 + 32) const v99x8_device::v99x8_mode v99x8_device::s_modes[] = { { 0x02, - &v99x8_device::mode_text1<UINT16, LONG_WIDTH>, - &v99x8_device::mode_text1<UINT16, SHORT_WIDTH>, - &v99x8_device::default_border<UINT16, LONG_WIDTH>, - &v99x8_device::default_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_text1, + &v99x8_device::default_border, NULL, - NULL, - NULL }, + NULL + }, { 0x01, - &v99x8_device::mode_multi<UINT16, LONG_WIDTH>, - &v99x8_device::mode_multi<UINT16, SHORT_WIDTH>, - &v99x8_device::default_border<UINT16, LONG_WIDTH>, - &v99x8_device::default_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_multi, + &v99x8_device::default_border, &v99x8_device::sprite_mode1, - &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>, - &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> }, + &v99x8_device::default_draw_sprite + }, { 0x00, - &v99x8_device::mode_graphic1<UINT16, LONG_WIDTH>, - &v99x8_device::mode_graphic1<UINT16, SHORT_WIDTH>, - &v99x8_device::default_border<UINT16, LONG_WIDTH>, - &v99x8_device::default_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_graphic1, + &v99x8_device::default_border, &v99x8_device::sprite_mode1, - &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>, - &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> }, + &v99x8_device::default_draw_sprite + }, { 0x04, - &v99x8_device::mode_graphic23<UINT16, LONG_WIDTH>, - &v99x8_device::mode_graphic23<UINT16, SHORT_WIDTH>, - &v99x8_device::default_border<UINT16, LONG_WIDTH>, - &v99x8_device::default_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_graphic23, + &v99x8_device::default_border, &v99x8_device::sprite_mode1, - &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>, - &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> }, + &v99x8_device::default_draw_sprite + }, { 0x08, - &v99x8_device::mode_graphic23<UINT16, LONG_WIDTH>, - &v99x8_device::mode_graphic23<UINT16, SHORT_WIDTH>, - &v99x8_device::default_border<UINT16, LONG_WIDTH>, - &v99x8_device::default_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_graphic23, + &v99x8_device::default_border, &v99x8_device::sprite_mode2, - &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>, - &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> }, + &v99x8_device::default_draw_sprite + }, { 0x0c, - &v99x8_device::mode_graphic4<UINT16, LONG_WIDTH>, - &v99x8_device::mode_graphic4<UINT16, SHORT_WIDTH>, - &v99x8_device::default_border<UINT16, LONG_WIDTH>, - &v99x8_device::default_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_graphic4, + &v99x8_device::default_border, &v99x8_device::sprite_mode2, - &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>, - &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> }, + &v99x8_device::default_draw_sprite + }, { 0x10, - &v99x8_device::mode_graphic5<UINT16, LONG_WIDTH>, - &v99x8_device::mode_graphic5<UINT16, SHORT_WIDTH>, - &v99x8_device::graphic5_border<UINT16, LONG_WIDTH>, - &v99x8_device::graphic5_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_graphic5, + &v99x8_device::graphic5_border, &v99x8_device::sprite_mode2, - &v99x8_device::graphic5_draw_sprite<UINT16, LONG_WIDTH>, - &v99x8_device::graphic5_draw_sprite<UINT16, SHORT_WIDTH> }, + &v99x8_device::graphic5_draw_sprite + }, { 0x14, - &v99x8_device::mode_graphic6<UINT16, LONG_WIDTH>, - &v99x8_device::mode_graphic6<UINT16, SHORT_WIDTH>, - &v99x8_device::default_border<UINT16, LONG_WIDTH>, - &v99x8_device::default_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_graphic6, + &v99x8_device::default_border, &v99x8_device::sprite_mode2, - &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>, - &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> }, + &v99x8_device::default_draw_sprite + }, { 0x1c, - &v99x8_device::mode_graphic7<UINT16, LONG_WIDTH>, - &v99x8_device::mode_graphic7<UINT16, SHORT_WIDTH>, - &v99x8_device::graphic7_border<UINT16, LONG_WIDTH>, - &v99x8_device::graphic7_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_graphic7, + &v99x8_device::graphic7_border, &v99x8_device::sprite_mode2, - &v99x8_device::graphic7_draw_sprite<UINT16, LONG_WIDTH>, - &v99x8_device::graphic7_draw_sprite<UINT16, SHORT_WIDTH> }, + &v99x8_device::graphic7_draw_sprite + }, { 0x0a, - &v99x8_device::mode_text2<UINT16, LONG_WIDTH>, - &v99x8_device::mode_text2<UINT16, SHORT_WIDTH>, - &v99x8_device::default_border<UINT16, LONG_WIDTH>, - &v99x8_device::default_border<UINT16, SHORT_WIDTH>, - NULL, + &v99x8_device::mode_text2, + &v99x8_device::default_border, NULL, - NULL }, + NULL + }, { 0xff, - &v99x8_device::mode_unknown<UINT16, LONG_WIDTH>, - &v99x8_device::mode_unknown<UINT16, SHORT_WIDTH>, - &v99x8_device::default_border<UINT16, LONG_WIDTH>, - &v99x8_device::default_border<UINT16, SHORT_WIDTH>, + &v99x8_device::mode_unknown, + &v99x8_device::default_border, NULL, - NULL, - NULL }, + NULL + } }; void v99x8_device::set_mode() @@ -2026,56 +1783,33 @@ void v99x8_device::set_mode() void v99x8_device::refresh_16(int line) { const pen_t *pens = m_palette->pens(); - int i, double_lines; + bool double_lines = false; UINT8 col[256]; UINT16 *ln, *ln2 = NULL; - double_lines = 0; - - if (m_size == RENDER_HIGH) + if (m_cont_reg[9] & 0x08) { - if (m_cont_reg[9] & 0x08) - { - m_size_now = RENDER_HIGH; - ln = &m_bitmap.pix16(line*2+((m_stat_reg[2]>>1)&1)); - } - else - { - ln = &m_bitmap.pix16(line*2); - ln2 = &m_bitmap.pix16(line*2+1); - double_lines = 1; - } + ln = &m_bitmap.pix16(line*2+((m_stat_reg[2]>>1)&1)); } else - ln = &m_bitmap.pix16(line); + { + ln = &m_bitmap.pix16(line*2); + ln2 = &m_bitmap.pix16(line*2+1); + double_lines = true; + } if ( !(m_cont_reg[1] & 0x40) || (m_stat_reg[2] & 0x40) ) { - if (m_size == RENDER_HIGH) - (this->*s_modes[m_mode].border_16) (pens, ln); - else - (this->*s_modes[m_mode].border_16s) (pens, ln); + (this->*s_modes[m_mode].border_16) (pens, ln); } else { - i = (line - m_offset_y) & 255; - if (m_size == RENDER_HIGH) - { - (this->*s_modes[m_mode].visible_16) (pens, ln, i); - if (s_modes[m_mode].sprites) - { - (this->*s_modes[m_mode].sprites) (i, col); - (this->*s_modes[m_mode].draw_sprite_16) (pens, ln, col); - } - } - else + int i = (line - m_offset_y) & 255; + (this->*s_modes[m_mode].visible_16) (pens, ln, i); + if (s_modes[m_mode].sprites) { - (this->*s_modes[m_mode].visible_16s) (pens, ln, i); - if (s_modes[m_mode].sprites) - { - (this->*s_modes[m_mode].sprites) (i, col); - (this->*s_modes[m_mode].draw_sprite_16s) (pens, ln, col); - } + (this->*s_modes[m_mode].sprites) (i, col); + (this->*s_modes[m_mode].draw_sprite_16) (pens, ln, col); } } @@ -2241,22 +1975,6 @@ void v99x8_device::interrupt_start_vblank() m_blink_count = (m_cont_reg[13] & 0x0f) * 10; } } - - // check screen rendering size - if (m_size_auto && (m_size_now >= 0) && (m_size != m_size_now) ) - m_size = m_size_now; - - if (m_size != m_size_old) - { - if (m_size == RENDER_HIGH) - m_screen->set_visible_area (0, 512 + 32 - 1, 0, 424 + 56 - 1); - else - m_screen->set_visible_area (0, 256 + 16 - 1, 0, 212 + 28 - 1); - - m_size_old = m_size; - } - - m_size_now = -1; } /*************************************************************************** diff --git a/src/emu/video/v9938.h b/src/emu/video/v9938.h index 4af159b5ae3..1393765ace3 100644 --- a/src/emu/video/v9938.h +++ b/src/emu/video/v9938.h @@ -29,16 +29,6 @@ #define MCFG_V99X8_INTERRUPT_CALLBACK(_irq) \ downcast<v99x8_device *>(device)->set_interrupt_callback(DEVCB_##_irq); -// init functions - -#define MODEL_V9938 (0) -#define MODEL_V9958 (1) - -// resolutions -#define RENDER_HIGH (0) -#define RENDER_LOW (1) -#define RENDER_AUTO (2) - //************************************************************************** // GLOBAL VARIABLES @@ -50,7 +40,6 @@ extern const device_type V9958; - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -70,7 +59,6 @@ public: m_int_callback.set_callback(irq); } int interrupt (); - void set_resolution (int); int get_transpen(); bitmap_ind16 &get_bitmap() { return m_bitmap; } void update_mouse_state(int mx_delta, int my_delta, int button_state); @@ -113,24 +101,24 @@ private: void check_int(); void register_write(int reg, int data); - template<typename _PixelType, int _Width> void default_border(const pen_t *pens, _PixelType *ln); - template<typename _PixelType, int _Width> void graphic7_border(const pen_t *pens, _PixelType *ln); - template<typename _PixelType, int _Width> void graphic5_border(const pen_t *pens, _PixelType *ln); - template<typename _PixelType, int _Width> void mode_text1(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void mode_text2(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void mode_multi(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void mode_graphic1(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void mode_graphic23(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void mode_graphic4(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void mode_graphic5(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void mode_graphic6(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void mode_graphic7(const pen_t *pens, _PixelType *ln, int line); + void default_border(const pen_t *pens, UINT16 *ln); + void graphic7_border(const pen_t *pens, UINT16 *ln); + void graphic5_border(const pen_t *pens, UINT16 *ln); + void mode_text1(const pen_t *pens, UINT16 *ln, int line); + void mode_text2(const pen_t *pens, UINT16 *ln, int line); + void mode_multi(const pen_t *pens, UINT16 *ln, int line); + void mode_graphic1(const pen_t *pens, UINT16 *ln, int line); + void mode_graphic23(const pen_t *pens, UINT16 *ln, int line); + void mode_graphic4(const pen_t *pens, UINT16 *ln, int line); + void mode_graphic5(const pen_t *pens, UINT16 *ln, int line); + void mode_graphic6(const pen_t *pens, UINT16 *ln, int line); + void mode_graphic7(const pen_t *pens, UINT16 *ln, int line); // template<typename _PixelType, int _Width> void mode_yae(const pen_t *pens, _PixelType *ln, int line); // template<typename _PixelType, int _Width> void mode_yjk(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void mode_unknown(const pen_t *pens, _PixelType *ln, int line); - template<typename _PixelType, int _Width> void default_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col); - template<typename _PixelType, int _Width> void graphic5_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col); - template<typename _PixelType, int _Width> void graphic7_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col); + void mode_unknown(const pen_t *pens, UINT16 *ln, int line); + void default_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col); + void graphic5_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col); + void graphic7_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col); void sprite_mode1(int line, UINT8 *col); void sprite_mode2(int line, UINT8 *col); @@ -197,8 +185,6 @@ private: int m_scanline; // blinking int m_blink, m_blink_count; - // size - int m_size, m_size_old, m_size_auto, m_size_now; // mouse UINT8 m_mx_delta, m_my_delta; // mouse & lightpen @@ -228,12 +214,9 @@ private: { UINT8 m; void (v99x8_device::*visible_16)(const pen_t *, UINT16*, int); - void (v99x8_device::*visible_16s)(const pen_t *, UINT16*, int); void (v99x8_device::*border_16)(const pen_t *, UINT16*); - void (v99x8_device::*border_16s)(const pen_t *, UINT16*); void (v99x8_device::*sprites)(int, UINT8*); void (v99x8_device::*draw_sprite_16)(const pen_t *, UINT16*, UINT8*); - void (v99x8_device::*draw_sprite_16s)(const pen_t *, UINT16*, UINT8*); } ; static const v99x8_mode s_modes[]; required_device<palette_device> m_palette; diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst index d25b76e0ca9..b1c33b43c24 100644 --- a/src/mame/arcade.lst +++ b/src/mame/arcade.lst @@ -3139,7 +3139,7 @@ cawingj // 12/10/1990 (c) 1990 (Japan) cawingbl // bootleg cawingb2 // bootleg nemo // 30/11/1990 (c) 1990 (World) -nemor1 // 09/11/1990 (c) 1990 (World) +nemor1 // 09/11/1990 (c) 1990 (World) nemoj // 20/11/1990 (c) 1990 (Japan) sf2 // 22/05/1991 (c) 1991 (World) sf2eb // 14/02/1991 (c) 1991 (World) @@ -3206,7 +3206,7 @@ sf2red // hack sf2v004 // hack sf2acc // hack sf2acca // hack -sf2ceblp // hack +sf2ceblp // hack sf2accp2 // hack sf2amf // bootleg sf2amf2 // bootleg @@ -3234,6 +3234,7 @@ varth // 14/07/1992 (c) 1992 (World) varthr1 // 12/06/1992 (c) 1992 (World) varthu // 12/06/1992 (c) 1992 (USA) varthj // 14/07/1992 (c) 1992 (Japan) +varthjr // 14/07/1992 (c) 1992 (Japan) qad // 01/07/1992 (c) 1992 (USA) qadjr // 21/09/1994 (c) 1994 (Japan) wof // 31/10/1992 (c) 1992 (World) (CPS1 + QSound) @@ -4819,6 +4820,7 @@ rchasej // 1991.09 Rail Chase (Japan) // Sega System 24 games // disk based hotrodj // 1988.03 Hot Rod (Japan) +hotrodja // 1988.03 Hot Rod (Japan) hotrod // 1988.?? Hot Rod (World) hotroda // 1988.07 Hot Rod (US) @@ -5760,6 +5762,7 @@ scg06nt // 2005.12 Sega Golf Club 2006: Next Tours (Rev A) // 2006.09 Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) // 2006.10 Quest of D Oukoku no Syugosya Ver.3.00 // 2006.11 Quest of D Oukoku no Syugosya Ver.3.01 +mj3evo // 2007.06 Sega Network Taisen Mahjong MJ 3 Evolution (Rev B) // 2007.11 Quest of D The Battle Kingdom Ver.4.00 // 2008.01 Quest of D The Battle Kingdom Ver.4.00b // 2008.02 Quest of D The Battle Kingdom Ver.4.00c diff --git a/src/mame/audio/nl_kidniki.c b/src/mame/audio/nl_kidniki.c index 07097837026..71f6ea1a14a 100644 --- a/src/mame/audio/nl_kidniki.c +++ b/src/mame/audio/nl_kidniki.c @@ -16,16 +16,16 @@ #ifndef __PLIB_PREPROCESSOR__ #define MC14584B_GATE(_name) \ - NET_REGISTER_DEV_X(MC14584B_GATE, _name) + NET_REGISTER_DEV(MC14584B_GATE, _name) #define MC14584B_DIP(_name) \ - NET_REGISTER_DEV_X(MC14584B_DIP, _name) + NET_REGISTER_DEV(MC14584B_DIP, _name) #define LM324_DIP(_name) \ - NET_REGISTER_DEV_X(LM324_DIP, _name) + NET_REGISTER_DEV(LM324_DIP, _name) #define LM358_DIP(_name) \ - NET_REGISTER_DEV_X(LM358_DIP, _name) + NET_REGISTER_DEV(LM358_DIP, _name) NETLIST_EXTERNAL(kidniki_lib) diff --git a/src/mame/audio/poolshrk.c b/src/mame/audio/poolshrk.c index a1b2899375d..188d072dda3 100644 --- a/src/mame/audio/poolshrk.c +++ b/src/mame/audio/poolshrk.c @@ -157,22 +157,22 @@ DISCRETE_SOUND_END * *************************************/ -WRITE8_MEMBER(poolshrk_state::poolshrk_scratch_sound_w) +WRITE8_MEMBER(poolshrk_state::scratch_sound_w) { m_discrete->write(space, POOLSHRK_SCRATCH_SND, offset & 1); } -WRITE8_MEMBER(poolshrk_state::poolshrk_score_sound_w) +WRITE8_MEMBER(poolshrk_state::score_sound_w) { m_discrete->write(space, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */ } -WRITE8_MEMBER(poolshrk_state::poolshrk_click_sound_w) +WRITE8_MEMBER(poolshrk_state::click_sound_w) { m_discrete->write(space, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */ } -WRITE8_MEMBER(poolshrk_state::poolshrk_bump_sound_w) +WRITE8_MEMBER(poolshrk_state::bump_sound_w) { m_discrete->write(space, POOLSHRK_BUMP_EN, offset & 1); } diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c index 3cd3c4c1e32..cc9fe4c26b6 100644 --- a/src/mame/drivers/chihiro.c +++ b/src/mame/drivers/chihiro.c @@ -52,6 +52,7 @@ Games on this system include.... |*| 2005 | Sega Club Golf 2006: Next Tours (Rev A) | Sega | GDROM | GDX-0018A | | | | 2006 | Sega Network Taisen Mahjong MJ 3 Evolution | Sega | GDROM | GDX-0021 | | | | 2006 | Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) | Sega | GDROM | GDX-0021A | | +|*| 2007 | Sega Network Taisen Mahjong MJ 3 Evolution (Rev B) | Sega | GDROM | GDX-0021B | | | | 2009 | Firmware Update For Compact Flash Box | Sega | GDROM | GDX-0024 | | |*| 2009 | Firmware Update For Compact Flash Box (Rev A) | Sega | GDROM | GDX-0024A | 317-0567-EXP | |*| 2004 | Quest Of D (Ver.1.01C) | Sega | CDROM | CDV-10005C | | @@ -2931,6 +2932,17 @@ ROM_START( scg06nt ) ROM_LOAD("gdx-0018.data", 0x00, 0x50, CRC(1a210abd) SHA1(43a54d028315d2dfa9f8ea6fb59265e0b980b02f) ) ROM_END +ROM_START( mj3evo ) + CHIHIRO_BIOS + + DISK_REGION( "gdrom" ) + DISK_IMAGE_READONLY( "gdx-0021b", 0, SHA1(c97d1dc95cdf1b4bd5d7cf6b4db0757f3d6bd723) ) + + // PIC label is unknown + ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) + ROM_LOAD( "317-xxxx-jpn.pic", 0x000000, 0x004000, CRC(650fcc94) SHA1(c88488900460fb3deecb3cf376fc043b10c020ef) ) +ROM_END + /* Title BOX GDROM CF-BOX FIRM Media ID EB08 @@ -3009,8 +3021,9 @@ ROM_END /* 0018A */ GAME( 2005, scg06nt, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Club Golf 2006 Next Tours (Rev A) (GDX-0018A)", GAME_NO_SOUND|GAME_NOT_WORKING ) // 0019 // 0020 -// 0021 GAME( 2005, mj3evo, mj3ev, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (GDX-0021)", GAME_NO_SOUND|GAME_NOT_WORKING ) -// 0021A GAME( 2005, mj3ev, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) (GDX-0021A)", GAME_NO_SOUND|GAME_NOT_WORKING ) +// 0021 GAME( 2006, mj3evoo, mj3evo, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (GDX-0021)", GAME_NO_SOUND|GAME_NOT_WORKING ) +// 0021A GAME( 2006, mj3evoa, mj3evo, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) (GDX-0021A)", GAME_NO_SOUND|GAME_NOT_WORKING ) +/* 0021B */ GAME( 2007, mj3evo, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (Rev B) (GDX-0021B)", GAME_NO_SOUND|GAME_NOT_WORKING ) // 0022 // 0023 // 0024 GAME( 2009, ccfboxo, ccfboxa, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Chihiro Firmware Update For Compact Flash Box (GDX-0024)", GAME_NO_SOUND|GAME_NOT_WORKING ) diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c index cf3055a71ce..bdb22c80e1b 100644 --- a/src/mame/drivers/cps1.c +++ b/src/mame/drivers/cps1.c @@ -9601,6 +9601,42 @@ ROM_START( varthj ) ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) ROM_END +/* B-Board 91634B-2, Japan Resale Ver. */ +ROM_START( varthjr ) + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_WORD_SWAP( "vaj_23b.8f", 0x00000, 0x80000, CRC(ad3d3522) SHA1(db627233f9d8a03c2d4bb31614951a0cdc81600d) ) + ROM_LOAD16_WORD_SWAP( "vaj_22b.7f", 0x80000, 0x80000, CRC(034e3e55) SHA1(eeb85a827cf18dafbdf0a2828aa39128352857f3) ) + + ROM_REGION( 0x200000, "gfx", 0 ) + ROMX_LOAD( "va_01.3a", 0x000000, 0x80000, CRC(b1fb726e) SHA1(5ac0876b6c49d0a99710dda68653664f4d8c1167) , ROM_GROUPWORD | ROM_SKIP(6) ) // == va-5m.7a + ROMX_LOAD( "va_02.4a", 0x000002, 0x80000, CRC(4c6588cd) SHA1(d14e8cf051ac934ccc989d8c571c6cc9eed34af5) , ROM_GROUPWORD | ROM_SKIP(6) ) // == va-7m.9a + ROMX_LOAD( "va_03.5a", 0x000004, 0x80000, CRC(0b1ace37) SHA1(6f9493c22f667f683db2789972fd16bb94724679) , ROM_GROUPWORD | ROM_SKIP(6) ) // == va-1m.3a + ROMX_LOAD( "va_04.6a", 0x000006, 0x80000, CRC(44dfe706) SHA1(a013a434df3161a91aafbb35dc4e20dfb3f177f4) , ROM_GROUPWORD | ROM_SKIP(6) ) // == va-3m.5a + + ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ + ROM_LOAD( "va_09.12a", 0x00000, 0x08000, CRC(7a99446e) SHA1(ca027f41e3e58be5abc33ad7380746658cb5380a) ) + ROM_CONTINUE( 0x10000, 0x08000 ) + + ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ + ROM_LOAD( "va_18.11c", 0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) ) + ROM_LOAD( "va_19.12c", 0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) ) + + ROM_REGION( 0x0200, "aboardplds", 0 ) + ROM_LOAD( "buf1", 0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) ) + ROM_LOAD( "ioa1", 0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) ) + ROM_LOAD( "prg1", 0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) ) + ROM_LOAD( "rom1", 0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) ) + ROM_LOAD( "sou1", 0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) ) + + ROM_REGION( 0x0200, "bboardplds", 0 ) + ROM_LOAD( "va63b.1a", 0x0000, 0x0117, BAD_DUMP CRC(38540e86) SHA1(86e0aba363108f80a8eff84b99d11528ad6db099) ) /* Handcrafted but works on actual US PCB. Redump needed */ + ROM_LOAD( "iob1.12d", 0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) ) + ROM_LOAD( "bprg1.11d", 0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) ) + + ROM_REGION( 0x0200, "cboardplds", 0 ) + ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) +ROM_END + /* B-Board 89625B-1 */ ROM_START( qad ) ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ @@ -11819,6 +11855,7 @@ GAME( 1992, varth, 0, cps1_12MHz, varth, cps_state, cps1, GAME( 1992, varthr1, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920612)", GAME_SUPPORTS_SAVE ) // "ETC" GAME( 1992, varthu, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom (Romstar license)", "Varth: Operation Thunderstorm (USA 920612)", GAME_SUPPORTS_SAVE ) GAME( 1992, varthj, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (Japan 920714)", GAME_SUPPORTS_SAVE ) +GAME( 1992, varthjr, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (Japan Resale Ver. 920714)", GAME_SUPPORTS_SAVE ) GAME( 1992, qad, 0, cps1_12MHz, qad, cps_state, cps1, ROT0, "Capcom", "Quiz & Dragons: Capcom Quiz Game (USA 920701)", GAME_SUPPORTS_SAVE ) // 12MHz verified GAME( 1994, qadjr, qad, cps1_12MHz, qadjr, cps_state, cps1, ROT0, "Capcom", "Quiz & Dragons: Capcom Quiz Game (Japan Resale Ver. 940921)", GAME_SUPPORTS_SAVE ) GAME( 1992, wof, 0, qsound, wof, cps_state, wof, ROT0, "Capcom", "Warriors of Fate (World 921031)", GAME_SUPPORTS_SAVE ) // "ETC" diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c index 0bc3fae7e59..3a4bd6a0c47 100644 --- a/src/mame/drivers/csplayh5.c +++ b/src/mame/drivers/csplayh5.c @@ -443,7 +443,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(csplayh5_state::csplayh5_irq) if((scanline % 2) == 0) { - m_v9958->set_resolution(RENDER_HIGH); m_v9958->interrupt(); } } diff --git a/src/mame/drivers/kurukuru.c b/src/mame/drivers/kurukuru.c index 1f8932d863d..048fe8d335a 100644 --- a/src/mame/drivers/kurukuru.c +++ b/src/mame/drivers/kurukuru.c @@ -266,7 +266,6 @@ WRITE_LINE_MEMBER(kurukuru_state::kurukuru_vdp_interrupt) TIMER_DEVICE_CALLBACK_MEMBER(kurukuru_state::kurukuru_vdp_scanline) { - m_v9938->set_resolution(0); m_v9938->interrupt(); } diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c index 0e0ac92dba2..c36f3be3b97 100644 --- a/src/mame/drivers/meritm.c +++ b/src/mame/drivers/meritm.c @@ -301,10 +301,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(meritm_state::meritm_interrupt) if((scanline % 2) == 0) { - m_v9938_0->set_resolution(RENDER_HIGH); m_v9938_0->interrupt(); - - m_v9938_1->set_resolution(RENDER_HIGH); m_v9938_1->interrupt(); } } diff --git a/src/mame/drivers/nl_breakout.c b/src/mame/drivers/nl_breakout.c index ddc3592513c..96da4942764 100644 --- a/src/mame/drivers/nl_breakout.c +++ b/src/mame/drivers/nl_breakout.c @@ -133,7 +133,7 @@ CIRCUIT_LAYOUT( breakout ) CHIP("F1", 9316) NET_C(Y1.Q, F1.2) - CONNECTION("F1", 14, "H1", 13) + CONNECTION("F1", 14, d, 13) CONNECTION("F1", 13, "H1", 12) CONNECTION("F1", 15, "E1", 5) CONNECTION(P, "F1", 1) diff --git a/src/mame/drivers/nl_pong.c b/src/mame/drivers/nl_pong.c index 99fb0ad9330..5192b2ec1c7 100644 --- a/src/mame/drivers/nl_pong.c +++ b/src/mame/drivers/nl_pong.c @@ -16,7 +16,7 @@ #define TTL_7400A_NAND(_name, _A, _B) TTL_7400_NAND(_name, _A, _B) #else #define TTL_7400A_NAND(_name, _A, _B) \ - NET_REGISTER_DEV_X(TTL_7400A_NAND, _name) \ + NET_REGISTER_DEV(TTL_7400A_NAND, _name) \ NET_CONNECT(_name, A, _A) \ NET_CONNECT(_name, B, _B) #endif diff --git a/src/mame/drivers/poolshrk.c b/src/mame/drivers/poolshrk.c index 78e6d6f16fc..b8794ba80bc 100644 --- a/src/mame/drivers/poolshrk.c +++ b/src/mame/drivers/poolshrk.c @@ -19,14 +19,11 @@ DRIVER_INIT_MEMBER(poolshrk_state,poolshrk) UINT8* pSprite = memregion("gfx1")->base(); UINT8* pOffset = memregion("proms")->base(); - int i; - int j; - /* re-arrange sprite data using the PROM */ - for (i = 0; i < 16; i++) + for (int i = 0; i < 16; i++) { - for (j = 0; j < 16; j++) + for (int j = 0; j < 16; j++) { UINT16 v = (pSprite[0] << 0xC) | @@ -44,16 +41,18 @@ DRIVER_INIT_MEMBER(poolshrk_state,poolshrk) pSprite += 4; } } + + save_item(NAME(m_da_latch)); } -WRITE8_MEMBER(poolshrk_state::poolshrk_da_latch_w) +WRITE8_MEMBER(poolshrk_state::da_latch_w) { m_da_latch = data & 15; } -WRITE8_MEMBER(poolshrk_state::poolshrk_led_w) +WRITE8_MEMBER(poolshrk_state::led_w) { if (offset & 2) set_led_status(machine(), 0, offset & 1); @@ -62,7 +61,7 @@ WRITE8_MEMBER(poolshrk_state::poolshrk_led_w) } -WRITE8_MEMBER(poolshrk_state::poolshrk_watchdog_w) +WRITE8_MEMBER(poolshrk_state::watchdog_w) { if ((offset & 3) == 3) { @@ -71,7 +70,7 @@ WRITE8_MEMBER(poolshrk_state::poolshrk_watchdog_w) } -READ8_MEMBER(poolshrk_state::poolshrk_input_r) +READ8_MEMBER(poolshrk_state::input_r) { static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; UINT8 val = ioport(portnames[offset & 3])->read(); @@ -91,7 +90,7 @@ READ8_MEMBER(poolshrk_state::poolshrk_input_r) } -READ8_MEMBER(poolshrk_state::poolshrk_irq_reset_r) +READ8_MEMBER(poolshrk_state::irq_reset_r) { m_maincpu->set_input_line(0, CLEAR_LINE); @@ -105,15 +104,15 @@ static ADDRESS_MAP_START( poolshrk_cpu_map, AS_PROGRAM, 8, poolshrk_state ) AM_RANGE(0x0400, 0x07ff) AM_MIRROR(0x2000) AM_WRITEONLY AM_SHARE("playfield_ram") AM_RANGE(0x0800, 0x080f) AM_MIRROR(0x23f0) AM_WRITEONLY AM_SHARE("hpos_ram") AM_RANGE(0x0c00, 0x0c0f) AM_MIRROR(0x23f0) AM_WRITEONLY AM_SHARE("vpos_ram") - AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x2000) AM_READWRITE(poolshrk_input_r, poolshrk_watchdog_w) - AM_RANGE(0x1400, 0x17ff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_scratch_sound_w) - AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_score_sound_w) - AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_click_sound_w) + AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x2000) AM_READWRITE(input_r, watchdog_w) + AM_RANGE(0x1400, 0x17ff) AM_MIRROR(0x2000) AM_WRITE(scratch_sound_w) + AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x2000) AM_WRITE(score_sound_w) + AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x2000) AM_WRITE(click_sound_w) AM_RANGE(0x4000, 0x4000) AM_NOP /* diagnostic ROM location */ - AM_RANGE(0x6000, 0x63ff) AM_WRITE(poolshrk_da_latch_w) - AM_RANGE(0x6400, 0x67ff) AM_WRITE(poolshrk_bump_sound_w) - AM_RANGE(0x6800, 0x6bff) AM_READ(poolshrk_irq_reset_r) - AM_RANGE(0x6c00, 0x6fff) AM_WRITE(poolshrk_led_w) + AM_RANGE(0x6000, 0x63ff) AM_WRITE(da_latch_w) + AM_RANGE(0x6400, 0x67ff) AM_WRITE(bump_sound_w) + AM_RANGE(0x6800, 0x6bff) AM_READ(irq_reset_r) + AM_RANGE(0x6c00, 0x6fff) AM_WRITE(led_w) AM_RANGE(0x7000, 0x7fff) AM_ROM ADDRESS_MAP_END @@ -225,7 +224,7 @@ static MACHINE_CONFIG_START( poolshrk, poolshrk_state ) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_VISIBLE_AREA(1, 255, 24, 255) - MCFG_SCREEN_UPDATE_DRIVER(poolshrk_state, screen_update_poolshrk) + MCFG_SCREEN_UPDATE_DRIVER(poolshrk_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", poolshrk) @@ -258,4 +257,4 @@ ROM_START( poolshrk ) ROM_END -GAME( 1977, poolshrk, 0, poolshrk, poolshrk, poolshrk_state, poolshrk, 0, "Atari", "Poolshark", 0 ) +GAME( 1977, poolshrk, 0, poolshrk, poolshrk, poolshrk_state, poolshrk, 0, "Atari", "Poolshark", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/sangho.c b/src/mame/drivers/sangho.c index 6d1bd3e73d3..ae13e716046 100644 --- a/src/mame/drivers/sangho.c +++ b/src/mame/drivers/sangho.c @@ -444,7 +444,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(sangho_state::sangho_interrupt) if((scanline % 2) == 0) { - m_v9958->set_resolution(RENDER_HIGH); m_v9958->interrupt(); } } diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c index 1620ba04bcc..ee2d6004428 100644 --- a/src/mame/drivers/sbowling.c +++ b/src/mame/drivers/sbowling.c @@ -55,33 +55,37 @@ public: m_videoram(*this, "videoram"), m_gfxdecode(*this, "gfxdecode") { } - int m_bgmap; required_device<cpu_device> m_maincpu; required_shared_ptr<UINT8> m_videoram; required_device<gfxdecode_device> m_gfxdecode; - int m_sbw_system; - tilemap_t *m_sb_tilemap; + int m_bgmap; + int m_system; + tilemap_t *m_tilemap; bitmap_ind16 *m_tmpbitmap; UINT32 m_color_prom_address; UINT8 m_pix_sh; UINT8 m_pix[2]; - DECLARE_WRITE8_MEMBER(sbw_videoram_w); + DECLARE_WRITE8_MEMBER(videoram_w); DECLARE_WRITE8_MEMBER(pix_shift_w); DECLARE_WRITE8_MEMBER(pix_data_w); DECLARE_READ8_MEMBER(pix_data_r); DECLARE_WRITE8_MEMBER(system_w); DECLARE_WRITE8_MEMBER(graph_control_w); DECLARE_READ8_MEMBER(controls_r); - TILE_GET_INFO_MEMBER(get_sb_tile_info); + + TILE_GET_INFO_MEMBER(get_tile_info); + TIMER_DEVICE_CALLBACK_MEMBER(interrupt); + virtual void video_start(); DECLARE_PALETTE_INIT(sbowling); - UINT32 screen_update_sbowling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_DEVICE_CALLBACK_MEMBER(sbw_interrupt); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void postload(); }; -TILE_GET_INFO_MEMBER(sbowling_state::get_sb_tile_info) +TILE_GET_INFO_MEMBER(sbowling_state::get_tile_info) { UINT8 *rom = memregion("user1")->base(); int tileno = rom[tile_index + m_bgmap * 1024]; @@ -96,13 +100,14 @@ static void plot_pixel_sbw(bitmap_ind16 *tmpbitmap, int x, int y, int col, int f y = 255-y; x = 247-x; } + tmpbitmap->pix16(y, x) = col; } -WRITE8_MEMBER(sbowling_state::sbw_videoram_w) +WRITE8_MEMBER(sbowling_state::videoram_w) { int flip = flip_screen(); - int x,y,i,v1,v2; + int x,y,v1,v2; m_videoram[offset] = data; @@ -114,7 +119,7 @@ WRITE8_MEMBER(sbowling_state::sbw_videoram_w) v1 = m_videoram[offset]; v2 = m_videoram[offset+0x2000]; - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { plot_pixel_sbw(m_tmpbitmap, x++, y, m_color_prom_address | ( ((v1&1)*0x20) | ((v2&1)*0x40) ), flip); v1 >>= 1; @@ -122,10 +127,10 @@ WRITE8_MEMBER(sbowling_state::sbw_videoram_w) } } -UINT32 sbowling_state::screen_update_sbowling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 sbowling_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { bitmap.fill(0x18, cliprect); - m_sb_tilemap->draw(screen, bitmap, cliprect, 0, 0); + m_tilemap->draw(screen, bitmap, cliprect, 0, 0); copybitmap_trans(bitmap, *m_tmpbitmap, 0, 0, 0, 0, cliprect, m_color_prom_address); return 0; } @@ -133,7 +138,21 @@ UINT32 sbowling_state::screen_update_sbowling(screen_device &screen, bitmap_ind1 void sbowling_state::video_start() { m_tmpbitmap = auto_bitmap_ind16_alloc(machine(),32*8,32*8); - m_sb_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sbowling_state::get_sb_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sbowling_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + + save_item(NAME(m_bgmap)); + save_item(NAME(m_system)); + save_item(NAME(m_color_prom_address)); + save_item(NAME(m_pix_sh)); + save_item(NAME(m_pix)); + machine().save().register_postload(save_prepost_delegate(FUNC(sbowling_state::postload), this)); +} + +void sbowling_state::postload() +{ + address_space &space = m_maincpu->space(AS_PROGRAM); + for (int offs = 0; offs < 0x4000; offs++) + videoram_w(space, offs, m_videoram[offs]); } WRITE8_MEMBER(sbowling_state::pix_shift_w) @@ -161,7 +180,7 @@ READ8_MEMBER(sbowling_state::pix_data_r) -TIMER_DEVICE_CALLBACK_MEMBER(sbowling_state::sbw_interrupt) +TIMER_DEVICE_CALLBACK_MEMBER(sbowling_state::interrupt) { int scanline = param; @@ -186,13 +205,13 @@ WRITE8_MEMBER(sbowling_state::system_w) flip_screen_set(data&1); - if ((m_sbw_system^data)&1) + if ((m_system^data)&1) { int offs; for (offs = 0;offs < 0x4000; offs++) - sbw_videoram_w(space, offs, m_videoram[offs]); + videoram_w(space, offs, m_videoram[offs]); } - m_sbw_system = data; + m_system = data; } WRITE8_MEMBER(sbowling_state::graph_control_w) @@ -210,12 +229,12 @@ WRITE8_MEMBER(sbowling_state::graph_control_w) m_color_prom_address = ((data&0x07)<<7) | ((data&0xc0)>>3); m_bgmap = ((data>>4)^3) & 0x3; - m_sb_tilemap->mark_all_dirty(); + m_tilemap->mark_all_dirty(); } READ8_MEMBER(sbowling_state::controls_r) { - if (m_sbw_system & 2) + if (m_system & 2) return ioport("TRACKY")->read(); else return ioport("TRACKX")->read(); @@ -223,7 +242,7 @@ READ8_MEMBER(sbowling_state::controls_r) static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, sbowling_state ) AM_RANGE(0x0000, 0x2fff) AM_ROM - AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(sbw_videoram_w) AM_SHARE("videoram") + AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") AM_RANGE(0xf800, 0xf801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) AM_RANGE(0xf801, 0xf801) AM_DEVREAD("aysnd", ay8910_device, data_r) AM_RANGE(0xfc00, 0xffff) AM_RAM @@ -343,7 +362,6 @@ GFXDECODE_END PALETTE_INIT_MEMBER(sbowling_state, sbowling) { const UINT8 *color_prom = memregion("proms")->base(); - int i; static const int resistances_rg[3] = { 470, 270, 100 }; static const int resistances_b[2] = { 270, 100 }; @@ -355,7 +373,7 @@ PALETTE_INIT_MEMBER(sbowling_state, sbowling) 3, resistances_rg, outputs_g, 0, 100, 2, resistances_b, outputs_b, 0, 100); - for (i = 0;i < palette.entries();i++) + for (int i = 0;i < palette.entries();i++) { int bit0,bit1,bit2,r,g,b; @@ -384,14 +402,14 @@ static MACHINE_CONFIG_START( sbowling, sbowling_state ) MCFG_CPU_ADD("maincpu", I8080, XTAL_19_968MHz/10) /* ? */ MCFG_CPU_PROGRAM_MAP(main_map) MCFG_CPU_IO_MAP(port_map) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sbowling_state, sbw_interrupt, "screen", 0, 1) + MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sbowling_state, interrupt, "screen", 0, 1) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_SIZE(32*8, 262) /* vert size taken from mw8080bw */ MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 32*8-1) - MCFG_SCREEN_UPDATE_DRIVER(sbowling_state, screen_update_sbowling) + MCFG_SCREEN_UPDATE_DRIVER(sbowling_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", sbowling) @@ -425,4 +443,4 @@ ROM_START( sbowling ) ROM_LOAD( "kb09.6m", 0x0400, 0x0400, CRC(e29191a6) SHA1(9a2c78a96ef6d118f4dacbea0b7d454b66a452ae)) ROM_END -GAME( 1982, sbowling, 0, sbowling, sbowling, driver_device, 0, ROT90, "Taito Corporation", "Strike Bowling",GAME_IMPERFECT_SOUND) +GAME( 1982, sbowling, 0, sbowling, sbowling, driver_device, 0, ROT90, "Taito Corporation", "Strike Bowling", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c index 4c691aa7898..c7f49105306 100644 --- a/src/mame/drivers/segas24.c +++ b/src/mame/drivers/segas24.c @@ -1978,7 +1978,7 @@ ROM_START( hotrod ) ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) ) ROM_REGION( 0x1d6000, "floppy", 0) - ROM_LOAD( "ds3-5000-01d_3p_turbo.img", 0x000000, 0x1d6000, CRC(627e8053) SHA1(d1a95f99078f5a29cccacfb1b30c3c9ead7b605c) ) + ROM_LOAD( "ds3-5000-01d_3p_turbo.img", 0x000000, 0x1d6000, CRC(842006fd) SHA1(d5432f58c0fb39f2bf62786a0d842bdd469ab2cb) ) ROM_END ROM_START( hotroda ) @@ -1987,7 +1987,16 @@ ROM_START( hotroda ) ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) ) ROM_REGION( 0x1d6000, "floppy", 0) - ROM_LOAD( "ds3-5000-01d.img", 0x000000, 0x1d6000, CRC(abf67b02) SHA1(f397435eaad691ff5a38d6d1d27840ed95a62df3) ) // World? 3 Player TURBO + ROM_LOAD( "ds3-5000-01d.img", 0x000000, 0x1d6000, CRC(e25c6b63) SHA1(fbf86d2ebccd8053b990939f63f5497907d18321) ) +ROM_END + +ROM_START( hotrodja ) + ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE( "epr-11339.ic2", 0x000000, 0x20000, CRC(75130e73) SHA1(e079739f4a3da3807aac570442c5afef1a7d7b0e) ) + ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) ) + + ROM_REGION( 0x1d6000, "floppy", 0) + ROM_LOAD( "ds3-5000-01a-rev-b.img", 0x000000, 0x1d6000, CRC(c18f6dca) SHA1(6f2b5a9567a340324a5f3fb57a3b744de0924a23) ) ROM_END ROM_START( hotrodj ) @@ -1996,7 +2005,7 @@ ROM_START( hotrodj ) ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) ) ROM_REGION( 0x1d6000, "floppy", 0) - ROM_LOAD( "ds3-5000-01a-rev-b.img", 0x000000, 0x1d6000, CRC(a39a0c2d) SHA1(ea8104c2266c48f480837aa7679c0a6f0c5e5452) ) // Japanese 4 Player + ROM_LOAD( "ds3-5000-01a-rev-c.img", 0x000000, 0x1d6000, CRC(852f9b5f) SHA1(159e161f55beed0f90cce8a73b0aeb4564d6af90) ) ROM_END ROM_START( qgh ) @@ -2071,7 +2080,7 @@ ROM_START( bnzabros ) ROM_RELOAD ( 0x180001, 0x40000) ROM_REGION( 0x1c2000, "floppy", 0) - ROM_LOAD( "ds3-5000-07d.img", 0x000000, 0x1c2000, CRC(ea7a3302) SHA1(5f92efb2e1135c1f3eeca38ba5789739a22dbd11) ) /* Region letter needs to be verfied */ + ROM_LOAD( "ds3-5000-07d.img", 0x000000, 0x1c2000, CRC(2e70251f) SHA1(1c2616dfa5cc15e8ebf1424012f2dd66f3a001a1) ) /* Region letter needs to be verfied */ ROM_END ROM_START( bnzabrosj ) @@ -2111,7 +2120,7 @@ ROM_START( sspirits ) ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) ) ROM_REGION( 0x1c2000, "floppy", 0) - ROM_LOAD( "ds3-5000-02-.img", 0x000000, 0x1c2000, CRC(cefbda69) SHA1(5b47ae0f1584ce1eb697246273ba761bd9e981c1) ) + ROM_LOAD( "ds3-5000-02-.img", 0x000000, 0x1c2000, CRC(179b98e9) SHA1(f6fc52c599c336d5c6f7aa199515268b4b3218a8) ) ROM_END ROM_START( sspiritj ) @@ -2157,7 +2166,7 @@ ROM_START( sgmastc ) ROM_LOAD( "317-0058-05c.key", 0x0000, 0x2000, CRC(ae0eabe5) SHA1(692d7565bf9c5b32cc80bb4bd88c9193aa04cbb0) ) ROM_REGION( 0x1c2000, "floppy", 0) - ROM_LOAD( "ds3-5000-05c.img", 0x000000, 0x1c2000, CRC(06c4f834) SHA1(5e178ed0edff7721c93f76da2e03ae188dc5efa4) ) + ROM_LOAD( "ds3-5000-05c.img", 0x000000, 0x1c2000, CRC(63a6ef3a) SHA1(f39fe0bf8930de994b1a77e0ba787d249d73c5e5) ) ROM_END ROM_START( sgmastj ) @@ -2466,7 +2475,8 @@ DRIVER_INIT_MEMBER(segas24_state,roughrac) /* Disk Based Games */ /* 01 */GAME( 1988, hotrod, 0, system24_floppy, hotrod, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (World, 3 Players, Turbo set 1, Floppy Based)", 0 ) /* 01 */GAME( 1988, hotroda, hotrod, system24_floppy, hotrod, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (World, 3 Players, Turbo set 2, Floppy Based)", 0 ) -/* 01 */GAME( 1988, hotrodj, hotrod, system24_floppy, hotrodj, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (Japan, 4 Players, Floppy Based)", 0 ) +/* 01 */GAME( 1988, hotrodj, hotrod, system24_floppy, hotrodj, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (Japan, 4 Players, Floppy Based, Rev C)", 0 ) +/* 01 */GAME( 1988, hotrodja, hotrod, system24_floppy, hotrodj, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (Japan, 4 Players, Floppy Based, Rev B)", 0 ) /* 02 */GAME( 1988, sspirits, 0, system24_floppy, sspirits, segas24_state, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based)", 0 ) /* 02 */GAME( 1988, sspiritj, sspirits, system24_floppy, sspirits, segas24_state, sspiritj, ROT270, "Sega", "Scramble Spirits (Japan, Floppy DS3-5000-02-REV-A Based)", 0 ) /* 02 */GAME( 1988, sspirtfc, sspirits, system24_floppy_fd1094, sspirits, segas24_state, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based, FD1094 317-0058-02c)", GAME_NOT_WORKING ) /* MISSING disk image */ diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c index f000803d50f..1088dd68140 100644 --- a/src/mame/drivers/snk.c +++ b/src/mame/drivers/snk.c @@ -3979,12 +3979,6 @@ static MACHINE_CONFIG_DERIVED( chopper1, bermudat ) MCFG_CPU_MODIFY("audiocpu") MCFG_CPU_PROGRAM_MAP(YM3812_Y8950_sound_map) - /* video hardware */ - MCFG_SCREEN_MODIFY("screen") - // this visible area matches the flyer - MCFG_SCREEN_SIZE(51*8, 28*8) - MCFG_SCREEN_VISIBLE_AREA(1*8, 50*8-1, 0*8, 28*8-1) - /* sound hardware */ MCFG_SOUND_REPLACE("ym1", YM3812, 4000000) MCFG_YM3812_IRQ_HANDLER(WRITELINE(snk_state, ymirq_callback_1)) diff --git a/src/mame/drivers/spbactn.c b/src/mame/drivers/spbactn.c index d4fcfec56a1..e05ddd35483 100644 --- a/src/mame/drivers/spbactn.c +++ b/src/mame/drivers/spbactn.c @@ -84,7 +84,7 @@ The manual defines the controls as 4 push buttons: TODO : (also check the notes from the galspnbl.c driver) - - coin insertion is not recognized consistenly. + - coin insertion is not recognized consistently. - rewrite video, do single pass sprite render, move sprite code to device, share with gaiden.c etc. - convert to tilemaps - all the unknown regs @@ -580,7 +580,7 @@ ROM_START( spbactnp ) /* does this have an extra (horizontal) screen maybe, with the girls being displayed on that instead of the main one.. */ - ROM_REGION( 0x10000, "extracpu", 0 ) // what? it's annother z80 rom... unused for now + ROM_REGION( 0x10000, "extracpu", 0 ) // what? it's another z80 rom... unused for now ROM_LOAD( "6204_6-6.29c", 0x00000, 0x10000, CRC(e8250c26) SHA1(9b669878790c8e3c5d80f165b5ffa1d6830f4696) ) ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8 BG Tiles */ // more 8x8 tiles, with the girl graphics? unused for now .. for horizontal orientation?? @@ -592,6 +592,6 @@ ROM_START( spbactnp ) ROM_LOAD( "tcm1.19g.bin", 0x00000, 0x53, CRC(2c54354a) SHA1(11d8b6cdaf052b5a9fbcf6b6fbf99c5f89575cfa) ) ROM_END -GAME( 1991, spbactn, 0, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (US)", GAME_IMPERFECT_GRAPHICS ) -GAME( 1991, spbactnj, spbactn, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (Japan)", GAME_IMPERFECT_GRAPHICS ) -GAME( 1989, spbactnp, spbactn, spbactnp, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (prototype)", GAME_NOT_WORKING ) // early proto, (c) date is 2 years earlier! +GAME( 1991, spbactn, 0, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (US)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +GAME( 1991, spbactnj, spbactn, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) +GAME( 1989, spbactnp, spbactn, spbactnp, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // early proto, (c) date is 2 years earlier! diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c index 7b0aa2defaa..46bf1bb2e65 100644 --- a/src/mame/drivers/taito_x.c +++ b/src/mame/drivers/taito_x.c @@ -1054,7 +1054,7 @@ ROM_START( superman ) ROM_REGION( 0x80000, "ymsnd", 0 ) /* ADPCM samples */ ROM_LOAD( "b61-01.e18", 0x00000, 0x80000, CRC(3cf99786) SHA1(f6febf9bda87ca04f0a5890d0e8001c26dfa6c81) ) - ROM_REGION( 0x10000, "cchip", 0 ) /* 64k for TC0030CMD (C-Chip protection, Z80 with embedded 64K rom + 64K RAM) */ + ROM_REGION( 0x10000, "cchip", 0 ) /* 64k for TC0030CMD (C-Chip protection, uPD78C11 with embedded 4K maskrom, 8k eprom, 8k RAM) */ ROM_LOAD( "b61_11.m11", 0x00000, 0x10000, NO_DUMP ) ROM_END diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c index 07b4b8b563a..7dab98b981e 100644 --- a/src/mame/drivers/tmnt.c +++ b/src/mame/drivers/tmnt.c @@ -2198,7 +2198,7 @@ static MACHINE_CONFIG_START( lgtnfght, tmnt_state ) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(64*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 ) + MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 ) MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_lgtnfght) MCFG_SCREEN_PALETTE("palette") diff --git a/src/mame/drivers/tonton.c b/src/mame/drivers/tonton.c index 49130852c45..204d1bec059 100644 --- a/src/mame/drivers/tonton.c +++ b/src/mame/drivers/tonton.c @@ -215,7 +215,6 @@ void tonton_state::machine_reset() TIMER_DEVICE_CALLBACK_MEMBER(tonton_state::tonton_interrupt) { - m_v9938->set_resolution(0); m_v9938->interrupt(); } diff --git a/src/mame/includes/poolshrk.h b/src/mame/includes/poolshrk.h index 530f113bf95..f19ce377095 100644 --- a/src/mame/includes/poolshrk.h +++ b/src/mame/includes/poolshrk.h @@ -15,37 +15,43 @@ class poolshrk_state : public driver_device public: poolshrk_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_playfield_ram(*this, "playfield_ram"), - m_hpos_ram(*this, "hpos_ram"), - m_vpos_ram(*this, "vpos_ram"), - m_discrete(*this, "discrete"), m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_discrete(*this, "discrete"), + m_playfield_ram(*this, "playfield_ram"), + m_hpos_ram(*this, "hpos_ram"), + m_vpos_ram(*this, "vpos_ram") { } + + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; + required_device<discrete_device> m_discrete; - int m_da_latch; required_shared_ptr<UINT8> m_playfield_ram; required_shared_ptr<UINT8> m_hpos_ram; required_shared_ptr<UINT8> m_vpos_ram; - required_device<discrete_device> m_discrete; + tilemap_t* m_bg_tilemap; - DECLARE_WRITE8_MEMBER(poolshrk_da_latch_w); - DECLARE_WRITE8_MEMBER(poolshrk_led_w); - DECLARE_WRITE8_MEMBER(poolshrk_watchdog_w); - DECLARE_READ8_MEMBER(poolshrk_input_r); - DECLARE_READ8_MEMBER(poolshrk_irq_reset_r); - DECLARE_DRIVER_INIT(poolshrk); + int m_da_latch; + + DECLARE_WRITE8_MEMBER(da_latch_w); + DECLARE_WRITE8_MEMBER(led_w); + DECLARE_WRITE8_MEMBER(watchdog_w); + DECLARE_READ8_MEMBER(input_r); + DECLARE_READ8_MEMBER(irq_reset_r); + DECLARE_WRITE8_MEMBER(scratch_sound_w); + DECLARE_WRITE8_MEMBER(score_sound_w); + DECLARE_WRITE8_MEMBER(click_sound_w); + DECLARE_WRITE8_MEMBER(bump_sound_w); + TILE_GET_INFO_MEMBER(get_tile_info); + + DECLARE_DRIVER_INIT(poolshrk); virtual void video_start(); DECLARE_PALETTE_INIT(poolshrk); - UINT32 screen_update_poolshrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE8_MEMBER(poolshrk_scratch_sound_w); - DECLARE_WRITE8_MEMBER(poolshrk_score_sound_w); - DECLARE_WRITE8_MEMBER(poolshrk_click_sound_w); - DECLARE_WRITE8_MEMBER(poolshrk_bump_sound_w); - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/includes/spbactn.h b/src/mame/includes/spbactn.h index fd8074c28a3..9924a0e46fe 100644 --- a/src/mame/includes/spbactn.h +++ b/src/mame/includes/spbactn.h @@ -9,20 +9,28 @@ class spbactn_state : public driver_device public: spbactn_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_bgvideoram(*this, "bgvideoram"), - m_fgvideoram(*this, "fgvideoram"), - m_spvideoram(*this, "spvideoram"), - m_extraram(*this, "extraram"), - m_extraram2(*this, "extraram2"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), m_sprgen(*this, "spritegen"), - m_mixer(*this, "mixer") + m_mixer(*this, "mixer"), + m_bgvideoram(*this, "bgvideoram"), + m_fgvideoram(*this, "fgvideoram"), + m_spvideoram(*this, "spvideoram"), + m_extraram(*this, "extraram"), + m_extraram2(*this, "extraram2") { } + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_audiocpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<screen_device> m_screen; + required_device<palette_device> m_palette; + required_device<tecmo_spr_device> m_sprgen; + required_device<tecmo_mix_device> m_mixer; + required_shared_ptr<UINT16> m_bgvideoram; required_shared_ptr<UINT16> m_fgvideoram; required_shared_ptr<UINT16> m_spvideoram; @@ -74,14 +82,4 @@ public: { return 0xffff; } - required_device<cpu_device> m_maincpu; - required_device<cpu_device> m_audiocpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<screen_device> m_screen; - required_device<palette_device> m_palette; - required_device<tecmo_spr_device> m_sprgen; - required_device<tecmo_mix_device> m_mixer; - - - }; diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index e45331e2192..73e51719582 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -151,6 +151,7 @@ Varth: Operation Thunderstorm (World 920612) 1992 89624B-? VA Varth: Operation Thunderstorm (World 920714) 89624B-3 VA24B IOB1 88622-C-5 CPS-B-04 DL-0411-10005 None Varth: Operation Thunderstorm (USA 920612) 91635B-2 VA63B BPRG1 IOB1 88622-C-5 CPS-B-04 DL-0411-10005 None Varth: Operation Thunderstorm* (Japan 920714) 88622B-3 VA22B LWIO 92641C-1 CPS-B-21 DL-0921-10014 IOC1 +Varth: Operation Thunderstorm* (Japan Resale Ver. 920714) 91634B-2 VA63B BPRG1 IOB1 92641C-1 CPS-B-21 DL-0921-10014 IOC1 Quiz & Dragons: Capcom Quiz Game* (USA 920701) 1992 89625B-1 QD22B IOB1 92641C-1 CPS-B-21 DL-0921-10014 IOC1 Quiz & Dragons: Capcom Quiz Game (Japan Resale Ver. 940921) 1994 91634B-2 QAD63B BPRG1 IOB1 92631C-6 CPS-B-21 DL-0921-10014 C632 IOC1 @@ -1536,6 +1537,7 @@ static const struct CPS1config cps1_config_table[]= {"varthr1", CPS_B_04, mapper_VA63B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */ // wrong, this set uses VA24B, dumped but equations still not added {"varthu", CPS_B_04, mapper_VA63B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */ {"varthj", CPS_B_21_BT5, mapper_VA22B }, /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */ + {"varthjr", CPS_B_21_BT5, mapper_VA63B }, /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */ {"cworld2j", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, /* (ports 36, 34 probably leftover input code from another game) */ {"cworld2ja", CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided // wrong, this set uses Q529B, still not dumped {"cworld2jb", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, // wrong, this set uses Q563B, still not dumped diff --git a/src/mame/video/poolshrk.c b/src/mame/video/poolshrk.c index 939380ff7f1..fe5169bcf27 100644 --- a/src/mame/video/poolshrk.c +++ b/src/mame/video/poolshrk.c @@ -27,17 +27,15 @@ void poolshrk_state::video_start() } -UINT32 poolshrk_state::screen_update_poolshrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 poolshrk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int i; - m_bg_tilemap->mark_all_dirty(); bitmap.fill(0, cliprect); /* draw sprites */ - for (i = 0; i < 16; i++) + for (int i = 0; i < 16; i++) { int hpos = m_hpos_ram[i]; int vpos = m_vpos_ram[i]; diff --git a/src/mess/drivers/advision.c b/src/mess/drivers/advision.c index cc940c75896..324e04ba842 100644 --- a/src/mess/drivers/advision.c +++ b/src/mess/drivers/advision.c @@ -78,7 +78,7 @@ static MACHINE_CONFIG_START( advision, advision_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ MCFG_SCREEN_UPDATE_DRIVER(advision_state, screen_update) MCFG_SCREEN_SIZE(320, 200) - MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1) + MCFG_SCREEN_VISIBLE_AREA(84, 235, 60, 142) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 8) MCFG_PALETTE_INIT_OWNER(advision_state, advision) diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c index 4de9a7160e0..b66ebdd2a11 100644 --- a/src/mess/drivers/hh_hmcs40.c +++ b/src/mess/drivers/hh_hmcs40.c @@ -1580,6 +1580,7 @@ INPUT_CHANGED_MEMBER(cgalaxn_state::player_switch) { // 2-player switch directly enables plate 14 m_plate = (m_plate & 0x3fff) | (newval ? 0 : 0x4000); + prepare_display(); } diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c index d0ef6b1e105..f2bbe1685f3 100644 --- a/src/mess/drivers/hh_ucom4.c +++ b/src/mess/drivers/hh_ucom4.c @@ -47,16 +47,14 @@ *060 uPD650C 1979, Mattel Computer Gin *085 uPD650C 1980, Roland TR-808 *127 uPD650C 198?, Sony OA-S1100 Typecorder (subcpu, have dump) - *128 uPD650C 1982, Roland TR-606 + *128 uPD650C 1981, Roland TR-606 133 uPD650C 1982, Roland TB-303 -> tb303.c (* denotes not yet emulated by MESS, @ denotes it's in this driver) ***************************************************************************/ -#include "emu.h" -#include "cpu/ucom4/ucom4.h" -#include "sound/speaker.h" +#include "includes/hh_ucom4.h" // internal artwork #include "efball.lh" @@ -65,54 +63,6 @@ #include "hh_ucom4_test.lh" // common test-layout - use external artwork -class hh_ucom4_state : public driver_device -{ -public: - hh_ucom4_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_inp_matrix(*this, "IN"), - m_speaker(*this, "speaker"), - m_display_wait(33), - m_display_maxy(1), - m_display_maxx(0) - { } - - // devices - required_device<cpu_device> m_maincpu; - optional_ioport_array<5> m_inp_matrix; // max 5 - optional_device<speaker_sound_device> m_speaker; - - // misc common - UINT8 m_port[9]; // MCU port A-I write data (optional) - UINT16 m_inp_mux; // multiplexed inputs mask - - UINT8 read_inputs(int columns); - - // display common - int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) - int m_display_maxy; // display matrix number of rows - int m_display_maxx; // display matrix number of columns (max 31 for now) - - UINT32 m_grid; // VFD current row data - UINT32 m_plate; // VFD current column data - - UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) - UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments - UINT32 m_display_cache[0x20]; // (internal use) - UINT8 m_display_decay[0x20][0x20]; // (internal use) - - TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); - void display_update(); - void set_display_size(int maxx, int maxy); - void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); - -protected: - virtual void machine_start(); - virtual void machine_reset(); -}; - - // machine start/reset void hh_ucom4_state::machine_start() diff --git a/src/mess/drivers/monty.c b/src/mess/drivers/monty.c index 1881370a3d0..42172a6c357 100644 --- a/src/mess/drivers/monty.c +++ b/src/mess/drivers/monty.c @@ -19,14 +19,19 @@ by adding chips and wires to the inside of the game. TODO: - - Input from the keyboard + - Need instructions - Proper SED1503F emulation (it's simulated in-driver for now) + - After each keypress it hits a HALT instruction. I guess the controller's + sync pin is involved somehow. + - When it wants tiles, put 64 into FD1B (monty), 7D1B (mmonty) and press + Enter. ****************************************************************************/ #include "emu.h" #include "cpu/z80/z80.h" #include "video/sed1520.h" +#include "sound/speaker.h" class monty_state : public driver_device @@ -35,6 +40,7 @@ public: monty_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_speaker(*this, "speaker") , m_sed0(*this, "sed1520_0") , m_writeUpper(false) { @@ -42,78 +48,130 @@ public: m_pixels[i] = 0xff000000; } - DECLARE_READ8_MEMBER(ioInputRead); - - DECLARE_WRITE8_MEMBER(ioDisplayWrite); - DECLARE_WRITE8_MEMBER(ioCommandWrite0); - DECLARE_WRITE8_MEMBER(ioCommandWrite1); + DECLARE_WRITE8_MEMBER(sound_w); + DECLARE_WRITE8_MEMBER(ioDisplayWrite_w); + DECLARE_WRITE8_MEMBER(ioCommandWrite0_w); + DECLARE_WRITE8_MEMBER(ioCommandWrite1_w); // screen updates UINT32 lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); private: required_device<cpu_device> m_maincpu; + required_device<speaker_sound_device> m_speaker; required_device<sed1520_device> m_sed0; // TODO: This isn't actually a SED1520, it's a SED1503F //required_device<sed1520_device> m_sed1; // TODO: Also, there are 2 SED1503Fs on the board - one is flipped upside down // Test UINT8 m_writeUpper; UINT32 m_pixels[42*32]; + bool m_sound_sw; + bool m_dirty; }; -static ADDRESS_MAP_START(monty_mem, AS_PROGRAM, 8, monty_state) - AM_RANGE(0x0000, 0x3fff) AM_ROM +static ADDRESS_MAP_START( monty_mem, AS_PROGRAM, 8, monty_state ) + AM_RANGE(0x0000, 0xbfff) AM_ROM //AM_RANGE(0x4000, 0x4000) // The main rom checks to see if another program is here on startup AM_RANGE(0xf800, 0xffff) AM_RAM ADDRESS_MAP_END +static ADDRESS_MAP_START( mmonty_mem, AS_PROGRAM, 8, monty_state ) + AM_RANGE(0x0000, 0x3fff) AM_ROM + //AM_RANGE(0xc000, 0xc000) // The main rom checks to see if another program is here on startup + AM_RANGE(0x8000, 0xffff) AM_ROM + AM_RANGE(0x7800, 0x7fff) AM_RAM +ADDRESS_MAP_END + -static ADDRESS_MAP_START(monty_io, AS_IO, 8, monty_state) +static ADDRESS_MAP_START( monty_io, AS_IO, 8, monty_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_WRITE(ioCommandWrite0) - AM_RANGE(0x02, 0x02) AM_WRITE(ioCommandWrite1) - AM_RANGE(0x80, 0xff) AM_WRITE(ioDisplayWrite) + AM_RANGE(0x00, 0x00) AM_WRITE(ioCommandWrite0_w) + AM_RANGE(0x01, 0x01) AM_WRITE(sound_w) + AM_RANGE(0x02, 0x02) AM_WRITE(ioCommandWrite1_w) + AM_RANGE(0x80, 0xff) AM_WRITE(ioDisplayWrite_w) // 7 reads from a bit shifted IO port - AM_RANGE(0x01, 0x01) AM_READ(ioInputRead) - AM_RANGE(0x02, 0x02) AM_READ(ioInputRead) - AM_RANGE(0x04, 0x04) AM_READ(ioInputRead) - AM_RANGE(0x08, 0x08) AM_READ(ioInputRead) - AM_RANGE(0x10, 0x10) AM_READ(ioInputRead) - AM_RANGE(0x20, 0x20) AM_READ(ioInputRead) - AM_RANGE(0x40, 0x40) AM_READ(ioInputRead) + AM_RANGE(0x01, 0x01) AM_READ_PORT("X1") + AM_RANGE(0x02, 0x02) AM_READ_PORT("X2") + AM_RANGE(0x04, 0x04) AM_READ_PORT("X3") + AM_RANGE(0x08, 0x08) AM_READ_PORT("X4") + AM_RANGE(0x10, 0x10) AM_READ_PORT("X5") + AM_RANGE(0x20, 0x20) AM_READ_PORT("X6") + AM_RANGE(0x40, 0x40) AM_READ_PORT("X7") ADDRESS_MAP_END // Input ports static INPUT_PORTS_START( monty ) + PORT_START("X1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') + PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("X2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') + PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("X3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') + PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("X4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') + PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("X5") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') + PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("X6") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') + PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("X7") + PORT_BIT( 0xFF, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -READ8_MEMBER( monty_state::ioInputRead ) +WRITE8_MEMBER( monty_state::sound_w ) { - //UINT8 foo; // = machine().rand() & 0xff; - //if (m_maincpu->pc() == 0x135f) - // foo = 0x14; - //if (m_maincpu->pc() == 0x1371) - // foo = 0x1f; - - UINT8 foo = (machine().rand() & 0xff) | 0x14; - - //printf("(%04x) %02x %02x\n", m_maincpu->pc(), foo, (foo & 0x14)); - return foo; + m_sound_sw ^= 1; + m_speaker->level_w(m_sound_sw); } -WRITE8_MEMBER( monty_state::ioCommandWrite0 ) +WRITE8_MEMBER( monty_state::ioCommandWrite0_w ) { //printf("(%04x) Command Port 0 write : %02x\n", m_maincpu->pc(), data); m_writeUpper = false; } -WRITE8_MEMBER( monty_state::ioCommandWrite1 ) +WRITE8_MEMBER( monty_state::ioCommandWrite1_w ) { //if (data == 0xfe) // printf("---\n"); @@ -123,43 +181,49 @@ WRITE8_MEMBER( monty_state::ioCommandWrite1 ) } -WRITE8_MEMBER( monty_state::ioDisplayWrite ) +WRITE8_MEMBER( monty_state::ioDisplayWrite_w ) { + m_dirty = true; // Offset directly corresponds to sed1503, DD RAM address (offset 0x7f may be special?) //printf("(%04x) %02x %02x\n", m_maincpu->pc(), offset, data); - const UINT8 localUpper = (offset & 0x40) >> 6; - const UINT8 seg = offset & 0x3f; - const UINT8 com = data; + UINT8 x = offset & 0x3f; + UINT8 y = (BIT(offset, 6) + (m_writeUpper ? 2 : 0)) << 3; // Skip the controller and write straight to the LCD (pc=134f) for (int i = 0; i < 8; i++) { - // Pixel location - const int upperSedOffset = m_writeUpper ? 8*2 : 0; - - const size_t x = seg; - const size_t y = i + (localUpper*8) + upperSedOffset; - // Pixel color - const bool on = (com >> i) & 0x01; if (x < 42) - m_pixels[(y*42) + x] = on ? 0xffffffff : 0xff000000; + m_pixels[(y*42) + x] = BIT(data, i) ? 0xffffffff : 0xff000000; + + y++; } } UINT32 monty_state::lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect) { - for (int y = 0; y < 32; y++) + if (!m_dirty) + return 1; + + UINT8 x,y,z; + m_dirty = false; + for (y = 0; y < 32; y++) { - for (int x = 0; x < 42; x++) + for (z = 0; z < 8; z++) { - bitmap.pix32(y, x) = m_pixels[(y*42) + x]; + for (x = 0; x < 5; x++) + { + bitmap.pix32(y, x+z*6) = m_pixels[y*42 + z*5 + x]; + } + bitmap.pix32(y, 5+z*6) = 0; // space between letters } + bitmap.pix32(y, 48) = m_pixels[y*42 + 40]; + bitmap.pix32(y, 49) = m_pixels[y*42 + 41]; } - return 0x00; + return 0; } @@ -181,14 +245,24 @@ static MACHINE_CONFIG_START( monty, monty_state ) MCFG_SCREEN_ADD("screen", LCD) MCFG_SCREEN_REFRESH_RATE(50) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // Not accurate - MCFG_SCREEN_SIZE(42, 32) // Two SED1503s (42x16 pixels) control the top and bottom halves - MCFG_SCREEN_VISIBLE_AREA(0, 42-1, 0, 32-1) + MCFG_SCREEN_SIZE(50, 32) // Two SED1503s (42x16 pixels) control the top and bottom halves + MCFG_SCREEN_VISIBLE_AREA(0, 50-1, 0, 32-1) MCFG_SCREEN_UPDATE_DRIVER(monty_state, lcd_update) + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + // LCD controller interfaces MCFG_SED1520_ADD("sed1520_0", monty_screen_update) MACHINE_CONFIG_END +static MACHINE_CONFIG_DERIVED( mmonty, monty ) + MCFG_CPU_MODIFY( "maincpu" ) + MCFG_CPU_PROGRAM_MAP(mmonty_mem) +MACHINE_CONFIG_END + // ROM definitions ROM_START( monty ) @@ -196,6 +270,7 @@ ROM_START( monty ) ROM_LOAD( "monty_main.bin", 0x0000, 0x4000, CRC(720b4f55) SHA1(0106eb88d3fbbf25a745b9b6ee785ba13689d095) ) // 27128 ROM_LOAD( "monty_module1.bin", 0x4000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) ) // 27128 ROM_LOAD( "monty_module2.bin", 0x8000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) ) // 27128 + ROM_FILL(0x1193,1,0) // patch out HALT so we can type in our names ROM_END ROM_START( mmonty ) @@ -203,10 +278,11 @@ ROM_START( mmonty ) ROM_LOAD( "master_monty_main.bin", 0x0000, 0x8000, CRC(bb5ef4d4) SHA1(ba2c759e429f8740df419f9abb60832eddfba8ab) ) // 27C256 ROM_LOAD( "monty_module1.bin", 0x8000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) ) // 27128 ROM_LOAD( "monty_module2.bin", 0xc000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) ) // 27128 + ROM_FILL(0x1487,1,0) // patch out HALT so we can type in our names ROM_END // Drivers // YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS -COMP( 1980, monty, 0, 0, monty, monty, driver_device, 0, "Ritam", "Monty Plays Scrabble", GAME_IS_SKELETON ) -COMP( 1980, mmonty, 0, 0, monty, monty, driver_device, 0, "Ritam", "Master Monty", GAME_IS_SKELETON ) +COMP( 1980, monty, 0, 0, monty, monty, driver_device, 0, "Ritam", "Monty Plays Scrabble", GAME_NOT_WORKING ) +COMP( 1982, mmonty, 0, 0, mmonty, monty, driver_device, 0, "Ritam", "Master Monty", GAME_NOT_WORKING ) diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c index f3d3af7a5d0..56c10c6c865 100644 --- a/src/mess/drivers/msx.c +++ b/src/mess/drivers/msx.c @@ -635,10 +635,6 @@ static INPUT_PORTS_START( msx_dips ) PORT_DIPNAME( 0x40, 0, "Swap game port 1 and 2") PORT_DIPSETTING( 0, DEF_STR( No ) ) PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) - PORT_DIPNAME ( 0x03, 0, "Render resolution") - PORT_DIPSETTING( 0, DEF_STR( High )) - PORT_DIPSETTING( 1, DEF_STR( Low )) - PORT_DIPSETTING( 2, "Auto" ) PORT_START("MOUSE0") PORT_BIT( 0xff00, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) diff --git a/src/mess/drivers/sdk80.c b/src/mess/drivers/sdk80.c index 1d05a18f217..240bb0cfc49 100644 --- a/src/mess/drivers/sdk80.c +++ b/src/mess/drivers/sdk80.c @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Nigel Barnes +// copyright-holders:Nigel Barnes,Ryan Holtz /*************************************************************************** Intel SDK-80 @@ -24,14 +24,14 @@ Please note this rom set boots into BASIC, not monitor. #include "emu.h" #include "cpu/i8085/i8085.h" -//#include "machine/pit8253.h" -//#include "machine/i8251.h" -//#include "machine/i8255.h" -//#include "machine/i8279.h" +#include "machine/i8251.h" +#include "machine/clock.h" +#include "bus/rs232/rs232.h" //#include "machine/ay31015.h" -//#include "bus/rs232/rs232.h" -#include "machine/terminal.h" +#define I8251A_TAG "usart" +#define I8251A_BAUD_TAG "usart_baud" +#define RS232_TAG "rs232" class sdk80_state : public driver_device { @@ -39,21 +39,25 @@ public: sdk80_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - , m_terminal(*this, "terminal") + , m_usart(*this, I8251A_TAG) + , m_rs232(*this, RS232_TAG) + , m_usart_baud_rate(*this, I8251A_BAUD_TAG) + , m_usart_divide_counter(0) + , m_usart_clock_state(0) { } - DECLARE_WRITE8_MEMBER(scanlines_w); - DECLARE_WRITE8_MEMBER(digit_w); - DECLARE_READ8_MEMBER(kbd_r); - DECLARE_READ8_MEMBER(portec_r); - DECLARE_READ8_MEMBER(ported_r); - DECLARE_WRITE8_MEMBER(kbd_put); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + DECLARE_WRITE_LINE_MEMBER( usart_clock_tick ); + private: - UINT8 m_digit; - UINT8 m_term_data; required_device<cpu_device> m_maincpu; - required_device<generic_terminal_device> m_terminal; + required_device<i8251_device> m_usart; + required_device<rs232_port_device> m_rs232; + required_ioport m_usart_baud_rate; + + UINT8 m_usart_divide_counter; + UINT8 m_usart_clock_state; }; static ADDRESS_MAP_START(sdk80_mem, AS_PROGRAM, 8, sdk80_state) @@ -65,27 +69,22 @@ ADDRESS_MAP_END static ADDRESS_MAP_START(sdk80_io, AS_IO, 8, sdk80_state) ADDRESS_MAP_UNMAP_HIGH ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0xec, 0xec) AM_READ(portec_r) AM_DEVWRITE("terminal", generic_terminal_device, write) - AM_RANGE(0xed, 0xed) AM_READ(ported_r) - //AM_RANGE(0xec, 0xec) AM_DEVREADWRITE("uart", i8251_device, data_r, data_w) - //AM_RANGE(0xed, 0xed) AM_DEVREADWRITE("uart", i8251_device, status_r, control_w) + AM_RANGE(0xec, 0xec) AM_DEVREADWRITE(I8251A_TAG, i8251_device, data_r, data_w) + AM_RANGE(0xed, 0xed) AM_DEVREADWRITE(I8251A_TAG, i8251_device, status_r, control_w) ADDRESS_MAP_END static INPUT_PORTS_START( sdk80 ) + PORT_START(I8251A_BAUD_TAG) + PORT_DIPNAME( 0x3f, 0x01, "i8251 Baud Rate" ) + PORT_DIPSETTING( 0x01, "4800") + PORT_DIPSETTING( 0x02, "2400") + PORT_DIPSETTING( 0x04, "1200") + PORT_DIPSETTING( 0x08, "600") + PORT_DIPSETTING( 0x10, "300") + PORT_DIPSETTING( 0x20, "150") + PORT_DIPSETTING( 0x40, "75") INPUT_PORTS_END -READ8_MEMBER( sdk80_state::portec_r ) -{ - UINT8 ret = m_term_data; - m_term_data = 0; - return ret; -} - -READ8_MEMBER( sdk80_state::ported_r ) -{ - return (m_term_data) ? 3 : 1; -} - #if 0 /* Graphics Output */ const gfx_layout sdk80_charlayout = @@ -111,67 +110,37 @@ UINT32 sdk80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c return 0; } -WRITE8_MEMBER( sdk80_state::scanlines_w ) -{ - m_digit = data; -} - -WRITE8_MEMBER( sdk80_state::digit_w ) -{ - if (m_digit < 6) - output_set_digit_value(m_digit, BITSWAP8(data, 3, 2, 1, 0, 7, 6, 5, 4)^0xff); -} - -READ8_MEMBER( sdk80_state::kbd_r ) +WRITE_LINE_MEMBER( sdk80_state::usart_clock_tick ) { - UINT8 data = 0xff; + UINT8 old_counter = m_usart_divide_counter; + m_usart_divide_counter++; - if (m_digit < 3) + UINT8 transition = (old_counter ^ m_usart_divide_counter) & m_usart_baud_rate->read(); + if (transition) { - char kbdrow[6]; - sprintf(kbdrow,"X%X",m_digit); - data = ioport(kbdrow)->read(); + m_usart->write_txc(m_usart_clock_state); + m_usart->write_rxc(m_usart_clock_state); + m_usart_clock_state ^= 1; } - return data; -} - -WRITE8_MEMBER( sdk80_state::kbd_put ) -{ - m_term_data = data; } static MACHINE_CONFIG_START( sdk80, sdk80_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", I8080A, 500000) + MCFG_CPU_ADD("maincpu", I8080A, XTAL_18_432MHz/9) MCFG_CPU_PROGRAM_MAP(sdk80_mem) MCFG_CPU_IO_MAP(sdk80_io) -// MCFG_DEVICE_ADD("uart", I8251, 0) -// MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) -// MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr)) -// MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) - -// MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") -// MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart", i8251_device, write_rxd)) -// MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart", i8251_device, write_dsr)) - -// old references to other drivers have been left in -// MCFG_DEVICE_ADD("pit8253", PIT8253, 0) -// MCFG_PIT8253_CLK0(MAIN_CLOCK_X1) /* heartbeat IRQ */ -// MCFG_PIT8253_OUT0_HANDLER(DEVWRITELINE("pic8259_master", pic8259_device, ir0_w)) -// MCFG_PIT8253_CLK1(MAIN_CLOCK_X1) /* Memory Refresh */ -// MCFG_PIT8253_CLK2(MAIN_CLOCK_X1) /* RS-232c */ -// MCFG_PIT8253_OUT2_HANDLER(WRITELINE(pc9801_state, write_uart_clock)) - -// MCFG_DEVICE_ADD("ppi8255_sys", I8255, 0) -// MCFG_I8255_IN_PORTA_CB(IOPORT("DSW2")) -// MCFG_I8255_IN_PORTB_CB(IOPORT("DSW1")) -// MCFG_I8255_IN_PORTC_CB(CONSTANT(0xa0)) // 0x80 cpu triple fault reset flag? -// MCFG_I8255_OUT_PORTC_CB(WRITE8(pc9801_state, ppi_sys_portc_w)) - -// MCFG_DEVICE_ADD("ppi8255_prn", I8255, 0) - /* TODO: check this one */ -// MCFG_I8255_IN_PORTB_CB(IOPORT("DSW5")) + MCFG_DEVICE_ADD(I8251A_TAG, I8251, 0) + MCFG_I8251_TXD_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) + MCFG_I8251_DTR_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) + MCFG_I8251_RTS_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) + + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "null_modem") + MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_rxd)) + MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_dsr)) + + MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL_18_432MHz/60) + MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(sdk80_state, usart_clock_tick)) /* video hardware */ // 96364 crt controller @@ -195,7 +164,7 @@ static MACHINE_CONFIG_START( sdk80, sdk80_state ) // MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") - // uart + // Video board UART // MCFG_DEVICE_ADD( "hd6402", AY31015, 0 ) // MCFG_AY31015_TX_CLOCK(( XTAL_16MHz / 16 ) / 256) // MCFG_AY31015_RX_CLOCK(( XTAL_16MHz / 16 ) / 256) @@ -211,8 +180,8 @@ static MACHINE_CONFIG_START( sdk80, sdk80_state ) // MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key // MCFG_I8279_IN_CTRL_CB(VCC) - MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0) - MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(sdk80_state, kbd_put)) + //MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0) + //MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(sdk80_state, kbd_put)) MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mess/drivers/tb303.c b/src/mess/drivers/tb303.c index 1631ce2b0a6..175e2492946 100644 --- a/src/mess/drivers/tb303.c +++ b/src/mess/drivers/tb303.c @@ -2,6 +2,8 @@ // copyright-holders:hap /*************************************************************************** + ** subclass of hh_ucom4_state (includes/hh_ucom4.h, drivers/hh_ucom4.c) ** + Roland TB-303 Bass Line, 1982, designed by Tadao Kikumoto * NEC uCOM-43 MCU, labeled D650C 133 * 3*uPD444C 1024x4 Static CMOS SRAM @@ -11,23 +13,34 @@ ***************************************************************************/ -#include "emu.h" -#include "cpu/ucom4/ucom4.h" +#include "includes/hh_ucom4.h" #include "tb303.lh" -class tb303_state : public driver_device +class tb303_state : public hh_ucom4_state { public: tb303_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), + : hh_ucom4_state(mconfig, type, tag), m_t3_off_timer(*this, "t3_off") { } - required_device<cpu_device> m_maincpu; required_device<timer_device> m_t3_off_timer; + + UINT8 m_ram[0xc00]; + UINT16 m_ram_address; + bool m_ram_ce; + bool m_ram_we; + + DECLARE_WRITE8_MEMBER(ram_w); + DECLARE_READ8_MEMBER(ram_r); + void refresh_ram(); + + DECLARE_WRITE8_MEMBER(led_w); + DECLARE_WRITE8_MEMBER(switch_w); + DECLARE_WRITE8_MEMBER(strobe_w); + DECLARE_READ8_MEMBER(input_r); TIMER_DEVICE_CALLBACK_MEMBER(t3_clock); TIMER_DEVICE_CALLBACK_MEMBER(t3_off); @@ -36,6 +49,12 @@ public: }; +/*************************************************************************** + + Timer/Interrupt + +***************************************************************************/ + // T2 to MCU CLK: LC circuit, stable sine wave, 2.2us interval #define TB303_T2_CLOCK_HZ 454545 /* in hz */ @@ -56,8 +75,152 @@ TIMER_DEVICE_CALLBACK_MEMBER(tb303_state::t3_clock) +/*************************************************************************** + + I/O + +***************************************************************************/ + +void tb303_state::refresh_ram() +{ + // MCU E2,E3 goes through a 4556 IC(pin 14,13) to one of uPD444 _CE: + // _Q0: N/C, _Q1: IC-5, _Q2: IC-3, _Q3: IC-4 + m_ram_ce = true; + UINT8 hi = 0; + switch (m_port[NEC_UCOM4_PORTE] >> 2 & 3) + { + case 0: m_ram_ce = false; break; + case 1: hi = 0; break; + case 2: hi = 1; break; + case 3: hi = 2; break; + } + + if (m_ram_ce) + { + // _WE must be high(read mode) for address transitions + if (!m_ram_we) + m_ram_address = hi << 10 | (m_port[NEC_UCOM4_PORTE] << 8 & 0x300) | m_port[NEC_UCOM4_PORTF] << 4 | m_port[NEC_UCOM4_PORTD]; + else + m_ram[m_ram_address] = m_port[NEC_UCOM4_PORTC]; + } + + // to switchboard pin 19-22 + //.. +} + +WRITE8_MEMBER(tb303_state::ram_w) +{ + // MCU C: RAM data + // MCU D,F,E: RAM address + m_port[offset] = data; + refresh_ram(); + + // MCU D,F01: pitch data + //.. +} + +READ8_MEMBER(tb303_state::ram_r) +{ + // MCU C: RAM data + if (m_ram_ce && !m_ram_we) + return m_ram[m_ram_address]; + else + return 0; +} + +WRITE8_MEMBER(tb303_state::led_w) +{ + // MCU G: leds state + display_matrix(4, 4, data, m_inp_mux); +} + +WRITE8_MEMBER(tb303_state::switch_w) +{ + // MCU H: input/led mux + m_inp_mux = data; +} + +WRITE8_MEMBER(tb303_state::strobe_w) +{ + // MCU I0: RAM _WE + m_ram_we = (data & 1) ? false : true; + refresh_ram(); + + // MCU I1: pitch data latch strobe + // MCU I2: gate signal +} + +READ8_MEMBER(tb303_state::input_r) +{ + // MCU A,B: multiplexed inputs + // if input mux(port H) is 0, port A status buffer & gate is selected (via Q5 NAND) + if (offset == NEC_UCOM4_PORTA && m_inp_mux == 0) + { + // todo.. + return m_inp_matrix[4]->read(); + } + else + return read_inputs(4) >> (offset*4) & 0xf; +} + + + +/*************************************************************************** + + Inputs + +***************************************************************************/ static INPUT_PORTS_START( tb303 ) + PORT_START("IN.0") // H0 port A/B + PORT_CONFNAME( 0x03, 0x03, "Mode" ) + PORT_CONFSETTING( 0x03, "Track Write" ) + PORT_CONFSETTING( 0x02, "Track Play" ) + PORT_CONFSETTING( 0x00, "Pattern Play" ) + PORT_CONFSETTING( 0x01, "Pattern Write" ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("DEL C#") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("INS D#") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_NAME("1 C") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_NAME("2 D") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("3 E") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_NAME("4 F") + + PORT_START("IN.1") // H1 port A/B + PORT_CONFNAME( 0x07, 0x00, "Track / Patt.Group" ) + PORT_CONFSETTING( 0x00, "1 / I" ) + PORT_CONFSETTING( 0x01, "2 / I" ) + PORT_CONFSETTING( 0x02, "3 / II" ) + PORT_CONFSETTING( 0x03, "4 / II" ) + PORT_CONFSETTING( 0x04, "5 / III" ) + PORT_CONFSETTING( 0x05, "6 / III" ) + PORT_CONFSETTING( 0x06, "7 / IV" ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_NAME("5 G") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_NAME("6 A") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_NAME("7 B") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_NAME("8 C") + + PORT_START("IN.2") // H2 port A/B + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Pattern Clear") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Function") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Pitch Mode") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Time Mode") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("9 Step") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("0 3n") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("100 A") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("200 B") + + PORT_START("IN.3") // H3 port B + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("F#") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("G#") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("A#") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Back") + + PORT_START("IN.4") // H=0 port A + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Run/Stop") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Tap") + PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END @@ -70,18 +233,41 @@ INPUT_PORTS_END void tb303_state::machine_start() { + hh_ucom4_state::machine_start(); + + // zerofill + memset(m_ram, 0, sizeof(m_ram)); + m_ram_address = 0; + m_ram_ce = false; + m_ram_we = false; + + // register for savestates + save_item(NAME(m_ram)); + save_item(NAME(m_ram_address)); + save_item(NAME(m_ram_ce)); + save_item(NAME(m_ram_we)); } - static MACHINE_CONFIG_START( tb303, tb303_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D650, TB303_T2_CLOCK_HZ) + MCFG_UCOM4_READ_A_CB(READ8(tb303_state, input_r)) + MCFG_UCOM4_READ_B_CB(READ8(tb303_state, input_r)) + MCFG_UCOM4_READ_C_CB(READ8(tb303_state, ram_r)) + MCFG_UCOM4_WRITE_C_CB(WRITE8(tb303_state, ram_w)) + MCFG_UCOM4_WRITE_D_CB(WRITE8(tb303_state, ram_w)) + MCFG_UCOM4_WRITE_E_CB(WRITE8(tb303_state, ram_w)) + MCFG_UCOM4_WRITE_F_CB(WRITE8(tb303_state, ram_w)) + MCFG_UCOM4_WRITE_G_CB(WRITE8(tb303_state, led_w)) + MCFG_UCOM4_WRITE_H_CB(WRITE8(tb303_state, switch_w)) + MCFG_UCOM4_WRITE_I_CB(WRITE8(tb303_state, strobe_w)) MCFG_TIMER_DRIVER_ADD_PERIODIC("t3_clock", tb303_state, t3_clock, TB303_T3_CLOCK) MCFG_TIMER_START_DELAY(TB303_T3_CLOCK) MCFG_TIMER_DRIVER_ADD("t3_off", tb303_state, t3_off) + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1)) MCFG_DEFAULT_LAYOUT(layout_tb303) /* no video! */ diff --git a/src/mess/drivers/vk100.c b/src/mess/drivers/vk100.c index f169bfe0141..a549d9904a2 100644 --- a/src/mess/drivers/vk100.c +++ b/src/mess/drivers/vk100.c @@ -1073,7 +1073,7 @@ ROM_START( vk100 ) * Complement: M=A^(P^N) * Erase: M=N */ - ROM_LOAD( "wb8201_656f1.m1-7643-5.pr4.ic17", 0x0000, 0x0400, CRC(e8ecf59f) SHA1(49e9d109dad3d203d45471a3f4ca4985d556161f)) // label verified from nigwil's board + ROM_LOAD( "wb8201_656f1.m1-7643-5.pr4.ic14", 0x0000, 0x0400, CRC(e8ecf59f) SHA1(49e9d109dad3d203d45471a3f4ca4985d556161f)) // label verified from nigwil's board ROM_REGION(0x100, "trans", ROMREGION_ERASEFF ) /* this is the "TRANSLATOR ROM" described in figure 5-17 on page 5-27 (256*8, 82s135) @@ -1087,7 +1087,7 @@ ROM_START( vk100 ) * \\\\\\\\- X'9 thru X'2 * The VT125 prom @ E60 is literally identical to this, the same exact part: 23-060B1 */ - ROM_LOAD( "wb---0_060b1.mmi6309.pr2.ic77", 0x0000, 0x0100, CRC(198317fc) SHA1(00e97104952b3fbe03a4f18d800d608b837d10ae)) // label verified from nigwil's board + ROM_LOAD( "wb---0_060b1.mmi6309.pr2.ic82", 0x0000, 0x0100, CRC(198317fc) SHA1(00e97104952b3fbe03a4f18d800d608b837d10ae)) // label verified from nigwil's board ROM_REGION(0x100, "dir", ROMREGION_ERASEFF ) /* this is the "DIRECTION ROM" == mb6309 (256x8, 82s135) @@ -1114,7 +1114,7 @@ ROM_START( vk100 ) * \--------- UNUSED, always 0 * The VT125 prom @ E41 is literally identical to this, the same exact part: 23-059B1 */ - ROM_LOAD( "wb8141_059b1.tbp18s22.pr5.ic108", 0x0000, 0x0100, CRC(4b63857a) SHA1(3217247d983521f0b0499b5c4ef6b5de9844c465)) // label verified from andy's board + ROM_LOAD( "wb8141_059b1.tbp18s22.pr5.ic111", 0x0000, 0x0100, CRC(4b63857a) SHA1(3217247d983521f0b0499b5c4ef6b5de9844c465)) // label verified from andy's board ROM_REGION( 0x100, "ras_erase", ROMREGION_ERASEFF ) /* this is the "RAS/ERASE ROM" involved with driving the RAS lines and erasing VRAM dram (256*4, 82s129) @@ -1155,10 +1155,11 @@ ROM_START( vk100 ) X'2 inputs lend credence to this. * */ - ROM_LOAD( "wb8151_573a2.mmi6301.pr3.ic44", 0x0000, 0x0100, CRC(75885a9f) SHA1(c721dad6a69c291dd86dad102ed3a8ddd620ecc4)) // label verified from nigwil's and andy's board + ROM_LOAD( "wb8151_573a2.mmi6301.pr3.ic41", 0x0000, 0x0100, CRC(75885a9f) SHA1(c721dad6a69c291dd86dad102ed3a8ddd620ecc4)) // label verified from nigwil's and andy's board ROM_REGION( 0x100, "vector", ROMREGION_ERASEFF ) // WARNING: it is possible that the first two bytes of this prom are bad! + // The PROM on andy's board appears to be damaged, this will need to be redumped from another board. /* this is the "VECTOR ROM" (256*8, 82s135) which runs the vector generator state machine * the vector rom bits are complex and are unfortunately poorly documented * in the tech manual. see figure 5-23. @@ -1194,7 +1195,7 @@ ROM_START( vk100 ) * * The VT125 prom E71 and its latch E70 is mostly equivalent to the vector prom, but the address order is different */ - ROM_LOAD( "wb8146_058b1.mmi6309.pr1.ic99", 0x0000, 0x0100, CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf)) // label verified from nigwil's and andy's board + ROM_LOAD( "wb8146_058b1.mmi6309.pr1.ic99", 0x0000, 0x0100, BAD_DUMP CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf)) // label verified from nigwil's and andy's board ROM_REGION( 0x20, "sync", ROMREGION_ERASEFF ) /* this is the "SYNC ROM" == mb6331 (32x8, 82s123) diff --git a/src/mess/includes/hh_ucom4.h b/src/mess/includes/hh_ucom4.h new file mode 100644 index 00000000000..79d51afccb9 --- /dev/null +++ b/src/mess/includes/hh_ucom4.h @@ -0,0 +1,66 @@ +// license:BSD-3-Clause +// copyright-holders:hap, Kevin Horton +/* + + NEC uCOM4 MCU tabletops/handhelds or other simple devices, + +*/ + +#ifndef _HH_UCOM4_H_ +#define _HH_UCOM4_H_ + + +#include "emu.h" +#include "cpu/ucom4/ucom4.h" +#include "sound/speaker.h" + + +class hh_ucom4_state : public driver_device +{ +public: + hh_ucom4_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_inp_matrix(*this, "IN"), + m_speaker(*this, "speaker"), + m_display_wait(33), + m_display_maxy(1), + m_display_maxx(0) + { } + + // devices + required_device<cpu_device> m_maincpu; + optional_ioport_array<5> m_inp_matrix; // max 5 + optional_device<speaker_sound_device> m_speaker; + + // misc common + UINT8 m_port[9]; // MCU port A-I write data (optional) + UINT16 m_inp_mux; // multiplexed inputs mask + + UINT8 read_inputs(int columns); + + // display common + int m_display_wait; // led/lamp off-delay in microseconds (default 33ms) + int m_display_maxy; // display matrix number of rows + int m_display_maxx; // display matrix number of columns (max 31 for now) + + UINT32 m_grid; // VFD current row data + UINT32 m_plate; // VFD current column data + + UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on) + UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments + UINT32 m_display_cache[0x20]; // (internal use) + UINT8 m_display_decay[0x20][0x20]; // (internal use) + + TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); + void display_update(); + void set_display_size(int maxx, int maxy); + void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); + +protected: + virtual void machine_start(); + virtual void machine_reset(); +}; + + +#endif /* _HH_UCOM4_H_ */ diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c index b5c9589f102..75488dad92a 100644 --- a/src/mess/machine/msx.c +++ b/src/mess/machine/msx.c @@ -214,13 +214,11 @@ void msx_state::post_load() TIMER_DEVICE_CALLBACK_MEMBER(msx_state::msx2_interrupt) { - m_v9938->set_resolution(m_io_dsw->read() & 0x03); m_v9938->interrupt(); } TIMER_DEVICE_CALLBACK_MEMBER(msx_state::msx2p_interrupt) { - m_v9958->set_resolution(m_io_dsw->read() & 0x03); m_v9958->interrupt(); } diff --git a/src/osd/modules/render/drawogl.c b/src/osd/modules/render/drawogl.c index c8a535d0e94..f071428972f 100644 --- a/src/osd/modules/render/drawogl.c +++ b/src/osd/modules/render/drawogl.c @@ -447,11 +447,11 @@ private: // Textures //============================================================ -/* texture_info holds information about a texture */ -class texture_info +/* ogl_texture_info holds information about a texture */ +class ogl_texture_info { public: - texture_info() + ogl_texture_info() : hash(0), flags(0), rawwidth(0), rawheight(0), rawwidth_create(0), rawheight_create(0), type(0), format(0), borderpix(0), xprescale(0), yprescale(0), nocopy(0), @@ -567,19 +567,19 @@ private: void loadGLExtensions(); void initialize_gl(); void set_blendmode(int blendmode); - void texture_compute_type_subroutine(const render_texinfo *texsource, texture_info *texture, UINT32 flags); - void texture_compute_size_subroutine(texture_info *texture, UINT32 flags, + void texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags); + void texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags, UINT32 width, UINT32 height, int* p_width, int* p_height, int* p_width_create, int* p_height_create); - void texture_compute_size_type(const render_texinfo *texsource, texture_info *texture, UINT32 flags); - texture_info *texture_create(const render_texinfo *texsource, UINT32 flags); - int texture_shader_create(const render_texinfo *texsource, texture_info *texture, UINT32 flags); - texture_info *texture_find(const render_primitive *prim); - void texture_coord_update(texture_info *texture, const render_primitive *prim, int shaderIdx); - void texture_mpass_flip(texture_info *texture, int shaderIdx); - void texture_shader_update(texture_info *texture, render_container *container, int shaderIdx); - texture_info * texture_update(const render_primitive *prim, int shaderIdx); - void texture_disable(texture_info * texture); + void texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags); + ogl_texture_info *texture_create(const render_texinfo *texsource, UINT32 flags); + int texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags); + ogl_texture_info *texture_find(const render_primitive *prim); + void texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx); + void texture_mpass_flip(ogl_texture_info *texture, int shaderIdx); + void texture_shader_update(ogl_texture_info *texture, render_container *container, int shaderIdx); + ogl_texture_info * texture_update(const render_primitive *prim, int shaderIdx); + void texture_disable(ogl_texture_info * texture); void texture_all_disable(); INT32 m_blittimer; @@ -591,7 +591,7 @@ private: int m_initialized; // is everything well initialized, i.e. all GL stuff etc. // 3D info (GL mode only) - texture_info * m_texhash[HASH_SIZE + OVERFLOW_SIZE]; + ogl_texture_info * m_texhash[HASH_SIZE + OVERFLOW_SIZE]; int m_last_blendmode; // previous blendmode INT32 m_texture_max_width; // texture maximum width INT32 m_texture_max_height; // texture maximum height @@ -734,7 +734,7 @@ static int glsl_shader_feature = GLSL_SHADER_FEAT_PLAIN; // Textures //============================================================ -static void texture_set_data(texture_info *texture, const render_texinfo *texsource, UINT32 flags); +static void texture_set_data(ogl_texture_info *texture, const render_texinfo *texsource, UINT32 flags); //============================================================ // Static Variables @@ -1106,7 +1106,7 @@ int sdl_info_ogl::xy_to_render_target(int x, int y, int *xt, int *yt) void sdl_info_ogl::destroy_all_textures() { - texture_info *texture = NULL; + ogl_texture_info *texture = NULL; int lock=FALSE; int i; @@ -1499,7 +1499,7 @@ void sdl_info_ogl::loadGLExtensions() int sdl_info_ogl::draw(const int update) { render_primitive *prim; - texture_info *texture=NULL; + ogl_texture_info *texture=NULL; float vofs, hofs; int pendingPrimitive=GL_NO_PRIMITIVE, curPrimitive=GL_NO_PRIMITIVE; @@ -1946,7 +1946,7 @@ static void drawogl_exit(void) // we also don't want to use PBO's in the case of nocopy==TRUE, // since we now might have GLSL shaders - this decision simplifies out life ;-) // -void sdl_info_ogl::texture_compute_type_subroutine(const render_texinfo *texsource, texture_info *texture, UINT32 flags) +void sdl_info_ogl::texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags) { texture->type = TEXTURE_TYPE_NONE; texture->nocopy = FALSE; @@ -2000,7 +2000,7 @@ INLINE int get_valid_pow2_value(int v, int needPow2) return (needPow2)?gl_round_to_pow2(v):v; } -void sdl_info_ogl::texture_compute_size_subroutine(texture_info *texture, UINT32 flags, +void sdl_info_ogl::texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags, UINT32 width, UINT32 height, int* p_width, int* p_height, int* p_width_create, int* p_height_create) { @@ -2051,7 +2051,7 @@ void sdl_info_ogl::texture_compute_size_subroutine(texture_info *texture, UINT32 *p_height_create=height_create; } -void sdl_info_ogl::texture_compute_size_type(const render_texinfo *texsource, texture_info *texture, UINT32 flags) +void sdl_info_ogl::texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags) { int finalheight, finalwidth; int finalheight_create, finalwidth_create; @@ -2204,7 +2204,7 @@ static int texture_fbo_create(UINT32 text_unit, UINT32 text_name, UINT32 fbo_nam return 0; } -int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, texture_info *texture, UINT32 flags) +int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags) { int uniform_location; int i; @@ -2377,12 +2377,12 @@ int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, texture return 0; } -texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, UINT32 flags) +ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, UINT32 flags) { - texture_info *texture; + ogl_texture_info *texture; // allocate a new texture - texture = global_alloc(texture_info); + texture = global_alloc(ogl_texture_info); // fill in the core data texture->hash = texture_compute_hash(texsource, flags); @@ -2832,7 +2832,7 @@ INLINE void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int width, co // texture_set_data //============================================================ -static void texture_set_data(texture_info *texture, const render_texinfo *texsource, UINT32 flags) +static void texture_set_data(ogl_texture_info *texture, const render_texinfo *texsource, UINT32 flags) { if ( texture->type == TEXTURE_TYPE_DYNAMIC ) { @@ -2955,7 +2955,7 @@ static void texture_set_data(texture_info *texture, const render_texinfo *texsou // texture_find //============================================================ -static int compare_texture_primitive(const texture_info *texture, const render_primitive *prim) +static int compare_texture_primitive(const ogl_texture_info *texture, const render_primitive *prim) { if (texture->texinfo.base == prim->texture.base && texture->texinfo.width == prim->texture.width && @@ -2968,10 +2968,10 @@ static int compare_texture_primitive(const texture_info *texture, const render_p return 0; } -texture_info *sdl_info_ogl::texture_find(const render_primitive *prim) +ogl_texture_info *sdl_info_ogl::texture_find(const render_primitive *prim) { HashT texhash = texture_compute_hash(&prim->texture, prim->flags); - texture_info *texture; + ogl_texture_info *texture; texture = m_texhash[texhash]; if (texture != NULL) @@ -2993,7 +2993,7 @@ texture_info *sdl_info_ogl::texture_find(const render_primitive *prim) // texture_update //============================================================ -void sdl_info_ogl::texture_coord_update(texture_info *texture, const render_primitive *prim, int shaderIdx) +void sdl_info_ogl::texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx) { float ustart = 0.0f, ustop = 0.0f; // beginning/ending U coordinates float vstart = 0.0f, vstop = 0.0f; // beginning/ending V coordinates @@ -3070,7 +3070,7 @@ void sdl_info_ogl::texture_coord_update(texture_info *texture, const render_prim } } -void sdl_info_ogl::texture_mpass_flip(texture_info *texture, int shaderIdx) +void sdl_info_ogl::texture_mpass_flip(ogl_texture_info *texture, int shaderIdx) { UINT32 mpass_src_idx = texture->mpass_dest_idx; @@ -3141,7 +3141,7 @@ void sdl_info_ogl::texture_mpass_flip(texture_info *texture, int shaderIdx) } } -void sdl_info_ogl::texture_shader_update(texture_info *texture, render_container *container, int shaderIdx) +void sdl_info_ogl::texture_shader_update(ogl_texture_info *texture, render_container *container, int shaderIdx) { int uniform_location; GLfloat vid_attributes[4]; @@ -3166,9 +3166,9 @@ void sdl_info_ogl::texture_shader_update(texture_info *texture, render_container } } -texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int shaderIdx) +ogl_texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int shaderIdx) { - texture_info *texture = texture_find(prim); + ogl_texture_info *texture = texture_find(prim); int texBound = 0; // if we didn't find one, create a new texture @@ -3239,7 +3239,7 @@ texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int sh return texture; } -void sdl_info_ogl::texture_disable(texture_info * texture) +void sdl_info_ogl::texture_disable(ogl_texture_info * texture) { if ( texture->type == TEXTURE_TYPE_SHADER ) { diff --git a/src/tools/nltool.c b/src/tools/nltool.c index 479d7eacf83..9d346746fad 100644 --- a/src/tools/nltool.c +++ b/src/tools/nltool.c @@ -210,7 +210,7 @@ public: for (int i=0; i < ll.size(); i++) { pstring name = "log_" + ll[i]; - /*netlist_device_t *nc = */ m_setup->register_dev("nld_log", name); + /*netlist_device_t *nc = */ m_setup->register_dev("LOG", name); m_setup->register_link(name + ".I", ll[i]); } } |