diff --git a/hash/bml3_flop.xml b/hash/bml3_flop.xml index 79351487fbf..027a12c984f 100644 --- a/hash/bml3_flop.xml +++ b/hash/bml3_flop.xml @@ -3,7 +3,7 @@ - MA5370 + + MA-5370 Disk BASIC (Version 1.1) 19?? <unknown> - + - Disk Basic and Utilities + Disk BASIC and Utilities 19?? <unknown> diff --git a/hash/lk3000.xml b/hash/lk3000.xml index 9c3381ce085..2a77cba4602 100644 --- a/hash/lk3000.xml +++ b/hash/lk3000.xml @@ -25,6 +25,7 @@ LK-3100: English-Polish LK-3110: English-Portuguese LK-3120: English-Russian LK-3130: English-Greek +LK-3160: English-Japanese LK-3200: English-Spanish-French-German-Italian-Greek LK-3500: Electronic Notebook LK-3900: Calculator @@ -33,12 +34,11 @@ unreleased?: LK-3140: English-Arabic LK-3150: English-Hebrew -LK-3160: English-Japanese LK-3170: English-Chinese --> - + Calculator diff --git a/hash/supracan.xml b/hash/supracan.xml index b12fd7a8dd1..d31d96d350b 100644 --- a/hash/supracan.xml +++ b/hash/supracan.xml @@ -9,9 +9,9 @@ license:CC0-1.0 1995 AV Artisan Corp. @@ -29,8 +29,11 @@ Gameplay logic falls apart once either side attacks (side becomes unresponsive, + @@ -44,12 +47,14 @@ Gameplay logic falls apart once either side attacks (side becomes unresponsive, Funtech + @@ -63,7 +68,7 @@ Broken [video] sprites during gameplay @@ -79,13 +84,12 @@ Broken [video] sprites during gameplay 1995 C&E Soft + @@ -96,6 +100,9 @@ Unresponsive [joy] inputs Journey to the Laugh ~ Xi You Ji 1995 Funtech + @@ -110,13 +117,13 @@ Unresponsive [joy] inputs 1996 Kingformation + @@ -131,6 +138,7 @@ Wrong [video] layer 1 priority and colors during intro + @@ -142,8 +150,9 @@ Wrong [video] layer 1 priority and colors during intro 1996 Funtech @@ -156,15 +165,13 @@ Too fast in gameplay, controls [irq 3] as FRC Magical Pool ~ Mo Bang Zhuang Qiu - 199? + 1996 Funtech @@ -179,6 +186,10 @@ Crashes after few seconds in attract, controls [irq 3] as FRC Boom Zoo ~ Bao Bao Dong Wu Yuan 1996 Funtech + + diff --git a/src/devices/bus/bml3/bml3mp1805.cpp b/src/devices/bus/bml3/bml3mp1805.cpp index e16c924a62d..13c8d59ea85 100644 --- a/src/devices/bus/bml3/bml3mp1805.cpp +++ b/src/devices/bus/bml3/bml3mp1805.cpp @@ -5,8 +5,7 @@ bml3mp1805.c Hitachi MP-1805 floppy disk controller card for the MB-6890 - Floppy drive is attached - TODO: make sure disk can be read + Floppy drive is attached (single-sided, single density) *********************************************************************/ @@ -32,11 +31,9 @@ ROM_START( mp1805 ) ROM_LOAD( "mp1805.rom", 0x000, 0x800, BAD_DUMP CRC(b532d8d9) SHA1(6f1160356d5bf64b5926b1fdb60db414edf65f22)) ROM_END -// Although the drive is single-sided, D88 images are double-sided, -// so we need to allocate enough space or MAME will crash. void bml3bus_mp1805_device::floppy_drives(device_slot_interface &device) { - device.option_add("mb_6890", FLOPPY_3_DSDD); + device.option_add("mb_6890", FLOPPY_3_SSSD); } diff --git a/src/devices/bus/s100/vectordualmode.cpp b/src/devices/bus/s100/vectordualmode.cpp index 1182fe7388d..fbf66d0d06e 100644 --- a/src/devices/bus/s100/vectordualmode.cpp +++ b/src/devices/bus/s100/vectordualmode.cpp @@ -334,7 +334,7 @@ void s100_vector_dualmode_device::device_reset() static void vector4_floppies(device_slot_interface &device) { - device.option_add("525", FLOPPY_525_QD16); + device.option_add("525", FLOPPY_525_QD); } static void vector4_formats(format_registration &fr) @@ -346,9 +346,13 @@ static void vector4_formats(format_registration &fr) void s100_vector_dualmode_device::device_add_mconfig(machine_config &config) { FLOPPY_CONNECTOR(config, m_floppy[0], vector4_floppies, "525", vector4_formats).enable_sound(true); + m_floppy[0]->set_sectoring_type(floppy_image::H16); FLOPPY_CONNECTOR(config, m_floppy[1], vector4_floppies, "525", vector4_formats).enable_sound(true); + m_floppy[1]->set_sectoring_type(floppy_image::H16); FLOPPY_CONNECTOR(config, m_floppy[2], vector4_floppies, "525", vector4_formats).enable_sound(true); + m_floppy[2]->set_sectoring_type(floppy_image::H16); FLOPPY_CONNECTOR(config, m_floppy[3], vector4_floppies, "525", vector4_formats).enable_sound(true); + m_floppy[3]->set_sectoring_type(floppy_image::H16); } DEFINE_DEVICE_TYPE(S100_VECTOR_DUALMODE, s100_vector_dualmode_device, "vectordualmode", "Vector Dual-Mode Disk Controller") diff --git a/src/devices/cpu/h8/h8.h b/src/devices/cpu/h8/h8.h index 37f2661f984..58929688ca5 100644 --- a/src/devices/cpu/h8/h8.h +++ b/src/devices/cpu/h8/h8.h @@ -24,6 +24,28 @@ class h8_device; class h8_device : public cpu_device, public device_nvram_interface { public: + enum { + H8_PC = 1, + H8_R0, + H8_R1, + H8_R2, + H8_R3, + H8_R4, + H8_R5, + H8_R6, + H8_R7, + H8_E0, + H8_E1, + H8_E2, + H8_E3, + H8_E4, + H8_E5, + H8_E6, + H8_E7, + H8_CCR, + H8_EXR + }; + enum { STATE_RESET = 0x10000, STATE_IRQ = 0x10001, @@ -438,26 +460,4 @@ class h8_device : public cpu_device, public device_nvram_interface { #undef O }; -enum { - H8_PC = 1, - H8_R0, - H8_R1, - H8_R2, - H8_R3, - H8_R4, - H8_R5, - H8_R6, - H8_R7, - H8_E0, - H8_E1, - H8_E2, - H8_E3, - H8_E4, - H8_E5, - H8_E6, - H8_E7, - H8_CCR, - H8_EXR -}; - #endif // MAME_CPU_H8_H8_H diff --git a/src/devices/cpu/hmcs40/hmcs40.cpp b/src/devices/cpu/hmcs40/hmcs40.cpp index 61b50e73123..c73df981000 100644 --- a/src/devices/cpu/hmcs40/hmcs40.cpp +++ b/src/devices/cpu/hmcs40/hmcs40.cpp @@ -572,7 +572,7 @@ void hmcs40_cpu_device::execute_run() // handle opcode switch (m_op) { - /* 0x000 */ + // 0x000 case 0x000: case 0x001: case 0x002: case 0x003: op_xsp(); break; @@ -647,7 +647,7 @@ void hmcs40_cpu_device::execute_run() op_xamr(); break; - /* 0x100 */ + // 0x100 case 0x110: case 0x111: op_lmaiy(); break; @@ -695,7 +695,7 @@ void hmcs40_cpu_device::execute_run() op_br(); break; - /* 0x200 */ + // 0x200 case 0x200: case 0x201: case 0x202: case 0x203: op_tm(); break; @@ -763,7 +763,8 @@ void hmcs40_cpu_device::execute_run() op_lrb(); break; - /* 0x300 */ + // 0x300 + case 0x320: op_comb(); break; case 0x324: @@ -797,6 +798,6 @@ void hmcs40_cpu_device::execute_run() default: op_illegal(); break; - } /* big switch */ + } // big switch } } diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index aaa822642e0..78902d7aab2 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -51,8 +51,10 @@ DEFINE_DEVICE_TYPE(FLOPPY_CONNECTOR, floppy_connector, "floppy_connector", "Floppy drive connector abstraction") // generic 3" drives -DEFINE_DEVICE_TYPE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3_ssdd", "3\" single-sided floppy drive") -DEFINE_DEVICE_TYPE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3_dsdd", "3\" double-sided floppy drive") +DEFINE_DEVICE_TYPE(FLOPPY_3_SSSD, floppy_3_sssd, "floppy_3_sssd", "3\" single-sided single density floppy drive") +DEFINE_DEVICE_TYPE(FLOPPY_3_DSSD, floppy_3_dssd, "floppy_3_dssd", "3\" double-sided single density floppy drive") +DEFINE_DEVICE_TYPE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3_ssdd", "3\" single-sided double density floppy drive") +DEFINE_DEVICE_TYPE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3_dsdd", "3\" double-sided double density floppy drive") // generic 3.5" drives DEFINE_DEVICE_TYPE(FLOPPY_35_SSDD, floppy_35_ssdd, "floppy_35_ssdd", "3.5\" single-sided double density floppy drive") @@ -70,7 +72,6 @@ DEFINE_DEVICE_TYPE(FLOPPY_525_SSDD, floppy_525_ssdd, "floppy_525_ssdd", DEFINE_DEVICE_TYPE(FLOPPY_525_DD, floppy_525_dd, "floppy_525_dd", "5.25\" double density floppy drive") DEFINE_DEVICE_TYPE(FLOPPY_525_SSQD, floppy_525_ssqd, "floppy_525_ssqd", "5.25\" single-sided quad density floppy drive") DEFINE_DEVICE_TYPE(FLOPPY_525_QD, floppy_525_qd, "floppy_525_qd", "5.25\" quad density floppy drive") -DEFINE_DEVICE_TYPE(FLOPPY_525_QD16, floppy_525_qd16, "floppy_525_qd16", "5.25\" quad density 16 hard sector floppy drive") DEFINE_DEVICE_TYPE(FLOPPY_525_HD, floppy_525_hd, "floppy_525_hd", "5.25\" high density floppy drive") // generic 8" drives @@ -210,7 +211,8 @@ floppy_connector::floppy_connector(const machine_config &mconfig, const char *ta device_t(mconfig, FLOPPY_CONNECTOR, tag, owner, clock), device_slot_interface(mconfig, *this), formats(nullptr), - m_enable_sound(true) + m_enable_sound(true), // MESSUI + m_sectoring_type(floppy_image::SOFT) { } @@ -229,6 +231,7 @@ void floppy_connector::device_config_complete() { dev->set_formats(formats); dev->enable_sound(m_enable_sound); + dev->set_sectoring_type(m_sectoring_type); } } @@ -251,6 +254,7 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t m_tracks(0), m_sides(0), m_form_factor(0), + m_sectoring_type(floppy_image::SOFT), m_motor_always_on(false), m_dskchg_writable(false), m_has_trk00_sensor(true), @@ -359,6 +363,72 @@ void floppy_image_device::register_formats() } } +void floppy_image_device::add_variant(uint32_t variant) +{ + uint32_t actual_variant = variant; + + if (m_sectoring_type == floppy_image::H10) { + switch (variant) { + case floppy_image::SSSD: + actual_variant = floppy_image::SSSD10; + break; + case floppy_image::SSDD: + actual_variant = floppy_image::SSDD10; + break; + case floppy_image::SSQD: + actual_variant = floppy_image::SSQD10; + break; + case floppy_image::DSSD: + actual_variant = floppy_image::DSSD10; + break; + case floppy_image::DSDD: + actual_variant = floppy_image::DSDD10; + break; + case floppy_image::DSQD: + actual_variant = floppy_image::DSQD10; + break; + } + } else if (m_sectoring_type == floppy_image::H16) { + switch (variant) { + case floppy_image::SSSD: + actual_variant = floppy_image::SSDD16; + break; + case floppy_image::SSDD: + actual_variant = floppy_image::SSSD16; + break; + case floppy_image::SSQD: + actual_variant = floppy_image::SSQD16; + break; + case floppy_image::DSSD: + actual_variant = floppy_image::DSSD16; + break; + case floppy_image::DSDD: + actual_variant = floppy_image::DSDD16; + break; + case floppy_image::DSQD: + actual_variant = floppy_image::DSQD16; + break; + } + } else if (m_sectoring_type == floppy_image::H32) { + switch (variant) { + case floppy_image::SSSD: + actual_variant = floppy_image::SSSD32; + break; + case floppy_image::SSDD: + actual_variant = floppy_image::SSDD32; + break; + case floppy_image::DSSD: + actual_variant = floppy_image::DSSD32; + break; + case floppy_image::DSDD: + actual_variant = floppy_image::DSDD32; + break; + } + } + + m_variants.push_back(actual_variant); +} + void floppy_image_device::set_formats(std::function formats) { m_format_registration_cb = formats; @@ -384,6 +454,16 @@ void floppy_image_device::set_rpm(float _rpm) m_angular_speed = m_rpm/60.0*2e8; } +void floppy_image_device::set_sectoring_type(uint32_t sectoring_type) +{ + m_sectoring_type = sectoring_type; +} + +uint32_t floppy_image_device::get_sectoring_type() +{ + return m_sectoring_type; +} + void floppy_image_device::setup_write(const floppy_image_format_t *_output_format) { m_output_format = _output_format; @@ -1634,6 +1714,53 @@ DEFINE_DEVICE_TYPE(FLOPPYSOUND, floppy_sound_device, "flopsnd", "Floppy sound") // GENERIC FLOPPY DRIVE DEFINITIONS //************************************************************************** +//------------------------------------------------- +// 3" single-sided single density +//------------------------------------------------- + +floppy_3_sssd::floppy_3_sssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + floppy_image_device(mconfig, FLOPPY_3_SSSD, tag, owner, clock) +{ +} + +floppy_3_sssd::~floppy_3_sssd() +{ +} + +void floppy_3_sssd::setup_characteristics() +{ + m_form_factor = floppy_image::FF_3; + m_tracks = 42; + m_sides = 1; + set_rpm(300); + + add_variant(floppy_image::SSSD); +} + +//------------------------------------------------- +// 3" double-sided single density +//------------------------------------------------- + +floppy_3_dssd::floppy_3_dssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + floppy_image_device(mconfig, FLOPPY_3_DSSD, tag, owner, clock) +{ +} + +floppy_3_dssd::~floppy_3_dssd() +{ +} + +void floppy_3_dssd::setup_characteristics() +{ + m_form_factor = floppy_image::FF_3; + m_tracks = 42; + m_sides = 2; + set_rpm(300); + + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); +} + //------------------------------------------------- // 3" single-sided double density //------------------------------------------------- @@ -1654,7 +1781,8 @@ void floppy_3_ssdd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -1677,8 +1805,10 @@ void floppy_3_dsdd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -1701,8 +1831,8 @@ void floppy_35_ssdd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -1725,9 +1855,9 @@ void floppy_35_dd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -1750,10 +1880,10 @@ void floppy_35_hd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSHD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSHD); } //------------------------------------------------- @@ -1776,11 +1906,11 @@ void floppy_35_ed::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSHD); - m_variants.push_back(floppy_image::DSED); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSHD); + add_variant(floppy_image::DSED); } //------------------------------------------------- @@ -1803,7 +1933,7 @@ void floppy_525_sssd_35t::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -1826,8 +1956,8 @@ void floppy_525_sd_35t::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::DSSD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); } //------------------------------------------------- @@ -1851,7 +1981,7 @@ void floppy_525_vtech::setup_characteristics() m_sides = 1; set_rpm(85); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -1874,7 +2004,7 @@ void floppy_525_sssd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -1897,7 +2027,7 @@ void floppy_525_sd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -1920,8 +2050,8 @@ void floppy_525_ssdd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -1944,9 +2074,9 @@ void floppy_525_dd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -1969,9 +2099,9 @@ void floppy_525_ssqd::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); } //------------------------------------------------- @@ -1994,38 +2124,12 @@ void floppy_525_qd::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); - m_variants.push_back(floppy_image::DSSD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSQD); -} - -//------------------------------------------------- -// 5.25" double-sided quad density 16 hard sector -//------------------------------------------------- - -floppy_525_qd16::floppy_525_qd16(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - floppy_image_device(mconfig, FLOPPY_525_QD16, tag, owner, clock) -{ -} - -floppy_525_qd16::~floppy_525_qd16() -{ -} - -void floppy_525_qd16::setup_characteristics() -{ - m_form_factor = floppy_image::FF_525; - m_tracks = 84; - m_sides = 2; - set_rpm(300); - - m_variants.push_back(floppy_image::SSDD16); - m_variants.push_back(floppy_image::SSQD16); - m_variants.push_back(floppy_image::DSDD16); - m_variants.push_back(floppy_image::DSQD16); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); + add_variant(floppy_image::DSSD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSQD); } //------------------------------------------------- @@ -2048,12 +2152,12 @@ void floppy_525_hd::setup_characteristics() m_sides = 2; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSQD); - m_variants.push_back(floppy_image::DSHD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSQD); + add_variant(floppy_image::DSHD); } //------------------------------------------------- @@ -2077,7 +2181,7 @@ void floppy_8_sssd::setup_characteristics() m_motor_always_on = true; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -2101,8 +2205,8 @@ void floppy_8_dssd::setup_characteristics() m_motor_always_on = true; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::DSSD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); } //------------------------------------------------- @@ -2126,8 +2230,8 @@ void floppy_8_ssdd::setup_characteristics() m_motor_always_on = true; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2151,9 +2255,9 @@ void floppy_8_dsdd::setup_characteristics() m_motor_always_on = true; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } @@ -2187,8 +2291,8 @@ void epson_smd_165::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::DSSD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::DSSD); } //------------------------------------------------- @@ -2234,9 +2338,9 @@ void epson_sd_320::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -2262,9 +2366,9 @@ void epson_sd_321::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } @@ -2295,9 +2399,9 @@ void pana_ju_363::setup_characteristics() m_dskchg_writable = true; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -2327,8 +2431,8 @@ void sony_oa_d31v::setup_characteristics() m_dskchg_writable = true; set_rpm(600); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2359,9 +2463,9 @@ void sony_oa_d32w::setup_characteristics() m_dskchg_writable = true; set_rpm(600); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -2392,8 +2496,8 @@ void sony_oa_d32v::setup_characteristics() m_dskchg_writable = true; set_rpm(600); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2422,7 +2526,7 @@ void teac_fd_30a::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2451,8 +2555,8 @@ void teac_fd_55a::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); } //------------------------------------------------- @@ -2481,10 +2585,10 @@ void teac_fd_55b::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSSD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSSD); + add_variant(floppy_image::DSDD); } //------------------------------------------------- @@ -2513,9 +2617,9 @@ void teac_fd_55e::setup_characteristics() m_sides = 1; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); } //------------------------------------------------- @@ -2544,12 +2648,12 @@ void teac_fd_55f::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); - m_variants.push_back(floppy_image::DSSD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSQD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); + add_variant(floppy_image::DSSD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSQD); } //------------------------------------------------- @@ -2578,12 +2682,12 @@ void teac_fd_55g::setup_characteristics() m_sides = 2; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::SSQD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSQD); - m_variants.push_back(floppy_image::DSHD); + add_variant(floppy_image::SSSD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::SSQD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSQD); + add_variant(floppy_image::DSHD); } //------------------------------------------------- @@ -2609,7 +2713,7 @@ void alps_3255190x::setup_characteristics() set_rpm(300); m_cyl = 34; - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } //------------------------------------------------- @@ -2634,7 +2738,7 @@ void ibm_6360::setup_characteristics() m_has_trk00_sensor = false; set_rpm(360); - m_variants.push_back(floppy_image::SSSD); + add_variant(floppy_image::SSSD); } @@ -2876,7 +2980,7 @@ void oa_d34v_device::setup_characteristics() m_sides = 1; set_rpm(394); - m_variants.push_back(floppy_image::SSDD); + add_variant(floppy_image::SSDD); } bool oa_d34v_device::is_2m() const @@ -2902,8 +3006,8 @@ void mfd51w_device::setup_characteristics() m_sides = 2; set_rpm(394); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); } bool mfd51w_device::is_2m() const @@ -2923,9 +3027,9 @@ void mfd75w_device::setup_characteristics() m_sides = 2; set_rpm(300); - m_variants.push_back(floppy_image::SSDD); - m_variants.push_back(floppy_image::DSDD); - m_variants.push_back(floppy_image::DSHD); + add_variant(floppy_image::SSDD); + add_variant(floppy_image::DSDD); + add_variant(floppy_image::DSHD); } bool mfd75w_device::is_2m() const diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h index 7d063420e80..6d47a5846fe 100644 --- a/src/devices/imagedev/floppy.h +++ b/src/devices/imagedev/floppy.h @@ -90,6 +90,8 @@ class floppy_image_device : public device_t, const floppy_image_format_t *get_load_format() const; std::pair identify(std::string_view filename); void set_rpm(float rpm); + void set_sectoring_type(uint32_t sectoring_type); + uint32_t get_sectoring_type(); void init_fs(const fs_info *fs, const fs::meta_data &meta); @@ -194,6 +196,7 @@ class floppy_image_device : public device_t, int m_tracks; /* addressable tracks */ int m_sides; /* number of heads */ uint32_t m_form_factor; /* 3"5, 5"25, etc */ + uint32_t m_sectoring_type; /* SOFT, Hard 10/16/32 */ bool m_motor_always_on; bool m_dskchg_writable; bool m_has_trk00_sensor; @@ -255,6 +258,8 @@ class floppy_image_device : public device_t, void register_formats(); + void add_variant(uint32_t variant); + void check_led(); uint32_t find_position(attotime &base, const attotime &when); attotime position_to_time(const attotime &base, int position) const; @@ -284,6 +289,8 @@ class floppy_image_device : public device_t, }; \ DECLARE_DEVICE_TYPE(Type, Name) +DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_SSSD, floppy_3_sssd, "floppy_3") +DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_DSSD, floppy_3_dssd, "floppy_3") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_SSDD, floppy_35_ssdd, "floppy_3_5") @@ -299,7 +306,6 @@ DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSDD, floppy_525_ssdd, "floppy_5_ DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_DD, floppy_525_dd, "floppy_5_25") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSQD, floppy_525_ssqd, "floppy_5_25") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_QD, floppy_525_qd, "floppy_5_25") -DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_QD16, floppy_525_qd16, "floppy_5_25") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_HD, floppy_525_hd, "floppy_5_25") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_8_SSSD, floppy_8_sssd, "floppy_8") DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_8_DSSD, floppy_8_dssd, "floppy_8") @@ -460,6 +466,7 @@ class floppy_connector: public device_t, template void set_formats(T &&_formats) { formats = std::forward(_formats); } void enable_sound(bool doit) { m_enable_sound = doit; } + void set_sectoring_type(uint32_t sectoring_type) { m_sectoring_type = sectoring_type; } floppy_image_device *get_device(); @@ -470,6 +477,7 @@ class floppy_connector: public device_t, private: std::function formats; bool m_enable_sound; + uint32_t m_sectoring_type; }; diff --git a/src/devices/machine/ticket.cpp b/src/devices/machine/ticket.cpp index 92e5f316819..97d837eb7a7 100644 --- a/src/devices/machine/ticket.cpp +++ b/src/devices/machine/ticket.cpp @@ -11,18 +11,10 @@ #include "emu.h" #include "ticket.h" - -//************************************************************************** -// DEBUGGING -//************************************************************************** - -#define DEBUG_TICKET 0 - -#define VERBOSE (DEBUG_TICKET) +#define VERBOSE (0) #include "logmacro.h" - //************************************************************************** // GLOBAL VARIABLES //************************************************************************** @@ -43,29 +35,26 @@ DEFINE_DEVICE_TYPE(HOPPER, hopper_device, "coin_hopper", "Coin Hopper") ticket_dispenser_device::ticket_dispenser_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) - , m_motor_sense(TICKET_MOTOR_ACTIVE_LOW) - , m_status_sense(TICKET_STATUS_ACTIVE_LOW) , m_period(attotime::from_msec(100)) , m_hopper_type(false) - , m_motoron(0) - , m_ticketdispensed(0) - , m_ticketnotdispensed(0) - , m_status(0) - , m_power(0) + , m_status(false) + , m_power(false) , m_timer(nullptr) , m_output(*this, tag) // TODO: change to "tag:status" - , m_dispense_handler(*this) // TODO: can we use m_output for this? + , m_dispense_handler(*this) { } ticket_dispenser_device::ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ticket_dispenser_device(mconfig, TICKET_DISPENSER, tag, owner, clock) { + m_hopper_type = false; } hopper_device::hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : ticket_dispenser_device(mconfig, HOPPER, tag, owner, clock) { + m_hopper_type = true; } //------------------------------------------------- @@ -98,21 +87,21 @@ int ticket_dispenser_device::line_r() void ticket_dispenser_device::motor_w(int state) { // On an activate signal, start dispensing! - if (bool(state) == m_motoron) + if (state) { if (!m_power) { LOG("%s: Ticket Power On\n", machine().describe_context()); m_timer->adjust(m_period); m_power = true; - m_status = m_ticketnotdispensed; + m_status = false; } } else { if (m_power) { - if (m_hopper_type == false || m_status == m_ticketnotdispensed) + if (!m_hopper_type || !m_status) { LOG("%s: Ticket Power Off\n", machine().describe_context()); m_timer->adjust(attotime::never); @@ -134,10 +123,6 @@ void ticket_dispenser_device::motor_w(int state) void ticket_dispenser_device::device_start() { - m_motoron = (m_motor_sense == TICKET_MOTOR_ACTIVE_HIGH); - m_ticketdispensed = (m_status_sense == TICKET_STATUS_ACTIVE_HIGH); - m_ticketnotdispensed = !m_ticketdispensed; - m_timer = timer_alloc(FUNC(ticket_dispenser_device::update_output_state), this); m_output.resolve(); @@ -153,7 +138,7 @@ void ticket_dispenser_device::device_start() void ticket_dispenser_device::device_reset() { - m_status = m_ticketnotdispensed; + m_status = false; m_power = false; } @@ -180,14 +165,15 @@ TIMER_CALLBACK_MEMBER(ticket_dispenser_device::update_output_state) } // update output status - m_output = m_status == m_ticketdispensed; + m_output = m_status; if (m_hopper_type) { m_dispense_handler(m_status); } + // if we just dispensed, increment global count - if (m_status == m_ticketdispensed) + if (m_status) { machine().bookkeeping().increment_dispensed_tickets(1); LOG("Ticket Dispensed\n"); diff --git a/src/devices/machine/ticket.h b/src/devices/machine/ticket.h index 797fac5bd4e..350baf7c4be 100644 --- a/src/devices/machine/ticket.h +++ b/src/devices/machine/ticket.h @@ -17,21 +17,9 @@ // GLOBAL VARIABLES //************************************************************************** -// device type definition DECLARE_DEVICE_TYPE(TICKET_DISPENSER, ticket_dispenser_device) DECLARE_DEVICE_TYPE(HOPPER, hopper_device) -//************************************************************************** -// CONSTANTS -//************************************************************************** - -const uint8_t TICKET_MOTOR_ACTIVE_LOW = 0; /* Ticket motor is triggered by D7=0 */ -const uint8_t TICKET_MOTOR_ACTIVE_HIGH = 1; /* Ticket motor is triggered by D7=1 */ - -const uint8_t TICKET_STATUS_ACTIVE_LOW = 0; /* Ticket is done dispensing when D7=0 */ -const uint8_t TICKET_STATUS_ACTIVE_HIGH = 1; /* Ticket is done dispensing when D7=1 */ - - //************************************************************************** // TYPE DEFINITIONS @@ -43,24 +31,16 @@ class ticket_dispenser_device : public device_t { public: // construction/destruction - ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period, uint8_t motor_sense, uint8_t status_sense) + ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period) : ticket_dispenser_device(mconfig, tag, owner) { set_period(period); - set_senses(motor_sense, status_sense, false); } ticket_dispenser_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); virtual ~ticket_dispenser_device(); // inline configuration helpers void set_period(const attotime &period) { m_period = period; } - void set_senses(uint8_t motor_sense, uint8_t status_sense, bool hopper_type) - { - m_motor_sense = motor_sense; - m_status_sense = status_sense; - m_hopper_type = hopper_type; - } - auto dispense_handler() { return m_dispense_handler.bind(); } // read/write handlers @@ -77,16 +57,9 @@ class ticket_dispenser_device : public device_t TIMER_CALLBACK_MEMBER(update_output_state); // configuration state - uint8_t m_motor_sense; - uint8_t m_status_sense; attotime m_period; bool m_hopper_type; - // active state - bool m_motoron; - bool m_ticketdispensed; - bool m_ticketnotdispensed; - bool m_status; bool m_power; emu_timer *m_timer; @@ -98,16 +71,12 @@ class hopper_device : public ticket_dispenser_device { public: // construction/destruction - hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period, uint8_t motor_sense, uint8_t status_sense) + hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, const attotime &period) : hopper_device(mconfig, tag, owner) { set_period(period); - set_senses(motor_sense, status_sense, true); } hopper_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - -private: - }; #endif // MAME_MACHINE_TICKET_H diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index 88fec600f0c..f131dbc38f4 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -1317,12 +1317,11 @@ void ioport_field::expand_diplocation(const char *location, std::string &errorbu } // then verify the number of bits in the mask matches - ioport_value temp; - int bits; - for (bits = 0, temp = m_mask; temp != 0 && bits < 32; bits++) - temp &= temp - 1; - if (bits != entries) + int const bits = population_count_32(m_mask); + if (bits > entries) errorbuf.append(string_format("Switch location '%s' does not describe enough bits for mask %X\n", location, m_mask)); + else if (bits < entries) + errorbuf.append(string_format("Switch location '%s' describes too many bits for mask %X\n", location, m_mask)); } diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp index 6d09f56c84f..4435f27ef73 100644 --- a/src/emu/xtal.cpp +++ b/src/emu/xtal.cpp @@ -109,7 +109,6 @@ const double XTAL::known_xtals[] = { 3'900'000, // 3.9_MHz_XTAL Resonator - Used on some Fidelity boards 3'932'160, // 3.93216_MHz_XTAL Apple Lisa COP421 (197-0016A) 4'000'000, // 4_MHz_XTAL - - 4'028'000, // 4.028_MHz_XTAL Sony SMC-777 4'032'000, // 4.032_MHz_XTAL GRiD Compass modem board 4'096'000, // 4.096_MHz_XTAL Used to drive OKI M9810 chips 4'194'304, // 4.194304_MHz_XTAL Used to drive MC146818 / Nintendo Game Boy @@ -420,6 +419,7 @@ const double XTAL::known_xtals[] = { 32'147'000, // 32.147_MHz_XTAL Ampex 210+ 132-column display clock 32'215'900, // 32.2159_MHz_XTAL Sega System 32, Sega Game Gear (close to 9x NTSC subcarrier which is 32.215905Mhz 32'220'000, // 32.22_MHz_XTAL Typically used on 90's Data East PCBs + 32'223'800, // 32.2238_MHz_XTAL Sony SMC-777 (~2048x NTSC line rate) 32'256'000, // 32.256_MHz_XTAL Hitachi MB-6890 32'317'400, // 32.3174_MHz_XTAL DEC VT330, VT340 32'530'470, // 32.53047_MHz_XTAL Seta 2 diff --git a/src/lib/formats/d88_dsk.cpp b/src/lib/formats/d88_dsk.cpp index c127762fae6..26510dc8396 100644 --- a/src/lib/formats/d88_dsk.cpp +++ b/src/lib/formats/d88_dsk.cpp @@ -477,6 +477,16 @@ bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::ve if(!head_count) return false; + int img_tracks, img_heads; + image.get_maximal_geometry(img_tracks, img_heads); + if (track_count > img_tracks) + { + osd_printf_error("d88: Floppy disk has too many tracks for this drive (floppy tracks=%d, drive tracks=%d).\n", track_count, img_tracks); + return false; + } + if (head_count > img_heads) + osd_printf_warning("d88: Floppy disk has excess of heads for this drive that will be discarded (floppy heads=%d, drive heads=%d).\n", head_count, img_heads); + uint32_t track_pos[164]; std::tie(err, actual) = read_at(io, 32, track_pos, 164*4); // FIXME: check for errors and premature EOF @@ -535,10 +545,12 @@ bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::ve sects[i].data = nullptr; } - if(density == 0x40) - build_pc_track_fm(track, head, image, cell_count / 2, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size)); - else - build_pc_track_mfm(track, head, image, cell_count, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size)); + if(head < img_heads) { + if(density == 0x40) + build_pc_track_fm(track, head, image, cell_count / 2, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size)); + else + build_pc_track_mfm(track, head, image, cell_count, sector_count, sects, calc_default_pc_gap3_size(form_factor, sects[0].actual_size)); + } } return true; diff --git a/src/lib/formats/flopimg.cpp b/src/lib/formats/flopimg.cpp index 2139ae11be0..fa4903447fb 100644 --- a/src/lib/formats/flopimg.cpp +++ b/src/lib/formats/flopimg.cpp @@ -138,13 +138,26 @@ const char *floppy_image::get_variant_name(uint32_t form_factor, uint32_t varian { switch(variant) { case SSSD: return "Single side, single density"; + case SSSD10: return "Single side, single density, 10-sector"; + case SSSD16: return "Single side, single density, 16-sector"; + case SSSD32: return "Single side, single density, 32-sector"; case SSDD: return "Single side, double density"; + case SSDD10: return "Single side, double density, 10-sector"; case SSDD16: return "Single side, double density, 16 hard sector"; + case SSDD32: return "Single side, double density, 32-sector"; case SSQD: return "Single side, quad density"; + case SSQD10: return "Single side, quad density, 10-sector"; case SSQD16: return "Single side, quad density, 16 hard sector"; + case DSSD: return "Double side, single density"; + case DSSD10: return "Double side, single density, 10-sector"; + case DSSD16: return "Double side, single density, 16-sector"; + case DSSD32: return "Double side, single density, 32-sector"; case DSDD: return "Double side, double density"; + case DSDD10: return "Double side, double density, 10-sector"; case DSDD16: return "Double side, double density, 16 hard sector"; + case DSDD32: return "Double side, double density, 32-sector"; case DSQD: return "Double side, quad density"; + case DSQD10: return "Double side, quad density, 10-sector"; case DSQD16: return "Double side, quad density, 16 hard sector"; case DSHD: return "Double side, high density"; case DSED: return "Double side, extended density"; diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h index bd8e4e52f67..18cc17ea73b 100644 --- a/src/lib/formats/flopimg.h +++ b/src/lib/formats/flopimg.h @@ -526,14 +526,26 @@ class floppy_image //! Variants enum { SSSD = 0x44535353, //!< "SSSD", Single-sided single-density + SSSD10 = 0x30315353, //!< "SS10", Single-sided single-density 10 hard sector + SSSD16 = 0x36315353, //!< "SS16", Single-sided single-density 16 hard sector + SSSD32 = 0x32335353, //!< "SS32", Single-sided single-density 32 hard sector SSDD = 0x44445353, //!< "SSDD", Single-sided double-density + SSDD10 = 0x30314453, //!< "SD10", Single-sided double-density 10 hard sector SSDD16 = 0x36314453, //!< "SD16", Single-sided double-density 16 hard sector + SSDD32 = 0x32334453, //!< "SD32", Single-sided double-density 32 hard sector SSQD = 0x44515353, //!< "SSQD", Single-sided quad-density + SSQD10 = 0x30315153, //!< "SQ10", Single-sided quad-density 10 hard sector SSQD16 = 0x36315153, //!< "SQ16", Single-sided quad-density 16 hard sector DSSD = 0x44535344, //!< "DSSD", Double-sided single-density + DSSD10 = 0x30315344, //!< "DS10", Double-sided single-density 10 hard sector + DSSD16 = 0x36315344, //!< "DS16", Double-sided single-density 16 hard sector + DSSD32 = 0x32335344, //!< "DS32", Double-sided single-density 32 hard sector DSDD = 0x44445344, //!< "DSDD", Double-sided double-density (720K in 3.5, 360K in 5.25) + DSDD10 = 0x30314444, //!< "DD10", Double-sided double-density 10 hard sector DSDD16 = 0x36314444, //!< "DD16", Double-sided double-density 16 hard sector (360K in 5.25) + DSDD32 = 0x32334444, //!< "DD32", Double-sided double-density 32 hard sector DSQD = 0x44515344, //!< "DSQD", Double-sided quad-density (720K in 5.25, means DD+80 tracks) + DSQD10 = 0x30315144, //!< "DQ10", Double-sided quad-density 10 hard sector DSQD16 = 0x36315144, //!< "DQ16", Double-sided quad-density 16 hard sector (720K in 5.25, means DD+80 tracks) DSHD = 0x44485344, //!< "DSHD", Double-sided high-density (1440K) DSED = 0x44455344 //!< "DSED", Double-sided extra-density (2880K) @@ -546,6 +558,14 @@ class floppy_image M2FM = 0x4D32464D //!< "M2FM", modified modified frequency modulation }; + //! Sectoring + enum { + SOFT = 0x54464F53, //!< "SOFT", Soft-sectored + H10 = 0x20303148, //!< "H10 ", Hard 10-sectored + H16 = 0x20363148, //!< "H16 ", Hard 16-sectored + H32 = 0x20323348 //!< "H32 ", Hard 32-sectored (8 inch disk) + }; + // construction/destruction @@ -562,10 +582,14 @@ class floppy_image uint32_t get_form_factor() const noexcept { return form_factor; } //! @return the variant. uint32_t get_variant() const noexcept { return variant; } + //! @return the disk sectoring. + uint32_t get_sectoring() const noexcept { return sectoring; } //! @param v the variant. void set_variant(uint32_t v); //! @param v the variant. void set_form_variant(uint32_t f, uint32_t v) { if(form_factor == FF_UNKNOWN) form_factor = f; set_variant(v); } + //! @param s the sectoring. + void set_sectoring(uint32_t s) { sectoring = s; } //! Find most recent and next index hole for provided angular position. //! The most recent hole may be equal to provided position. The next @@ -623,7 +647,7 @@ class floppy_image private: int tracks, heads; - uint32_t form_factor, variant; + uint32_t form_factor, variant, sectoring; struct track_info { diff --git a/src/mame/acorn/aristmk5.cpp b/src/mame/acorn/aristmk5.cpp index 6d0fbc4f9a4..21471f13b18 100644 --- a/src/mame/acorn/aristmk5.cpp +++ b/src/mame/acorn/aristmk5.cpp @@ -1094,7 +1094,7 @@ uint8_t aristmk5_state::ldor_r() if (m_extra_ports->read() & 0x01) m_ldor_shift_reg = 0; // open the Logic door clears the shift register - return (m_ldor_shift_reg & 0x80) | 0x60 | ((m_hopper_test && m_hopper->line_r()) ? 0x10 : 0x00); + return (m_ldor_shift_reg & 0x80) | 0x60 | ((m_hopper_test && !m_hopper->line_r()) ? 0x10 : 0x00); } void aristmk5_state::ldor_clk_w(uint8_t data) @@ -1280,7 +1280,7 @@ void aristmk5_state::aristmk5_drame_map(address_map &map) int aristmk5_state::hopper_r() { - return (m_hopper_test && m_hopper->line_r()) ? 0 : 1; + return (m_hopper_test && !m_hopper->line_r()) ? 0 : 1; } CUSTOM_INPUT_MEMBER(aristmk5_state::coin_usa_r) @@ -2422,7 +2422,7 @@ void aristmk5_state::aristmk5(machine_config &config) DS1302(config, m_rtc, 32.768_kHz_XTAL); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(100)); // some games (jungjuic, penpir2) use the IOC KART interface for debug rs232_port_device &rs232(RS232_PORT(config, "kart", default_rs232_devices, nullptr)); diff --git a/src/mame/astrocorp/astrcorp.cpp b/src/mame/astrocorp/astrcorp.cpp index 690a53e931a..9098ec71780 100644 --- a/src/mame/astrocorp/astrcorp.cpp +++ b/src/mame/astrocorp/astrcorp.cpp @@ -1043,7 +1043,7 @@ static INPUT_PORTS_START( showhand ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Look / Small") // HOLD5 in full test mode PORT_SERVICE_NO_TOGGLE( 0x0020, IP_ACTIVE_LOW ) // settings PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Yes / Big") // HOLD4 in full test mode PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // HOLD1 in full test mode PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Select") // HOLD2 in full test mode @@ -1051,7 +1051,7 @@ static INPUT_PORTS_START( showhand ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // press with keyout if eeprom error (green screen) or to reset settings PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) - PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_START( "EEPROM_IN" ) PORT_BIT( 0xfff7, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -1081,7 +1081,7 @@ static INPUT_PORTS_START( showhanc ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Yes / Big") // HOLD4 in full test mode PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // press with keyout if eeprom error (green screen) or to reset settings. "DOOR OPEN" error in-game. PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // must be 0 for payout/lamps to work, might be a hopper empty sense? - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) INPUT_PORTS_END @@ -1103,9 +1103,9 @@ static INPUT_PORTS_START( skilldrp ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) INPUT_PORTS_END @@ -1169,9 +1169,9 @@ static INPUT_PORTS_START( dinodino ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Auto") PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Odds") PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") - PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", hopper_device, line_r) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_START( "CPUCODE_IN" ) @@ -1212,7 +1212,7 @@ static INPUT_PORTS_START( astoneag ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reserve Switch") // shown in test mode PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) INPUT_PORTS_END @@ -1263,8 +1263,8 @@ void astrocorp_state::showhand(machine_config &config) NVRAM(config, "nvram"); EEPROM_93C46_16BIT(config, "eeprom"); - HOPPER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); - HOPPER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); + HOPPER(config, m_ticket, attotime::from_msec(200)); + HOPPER(config, m_hopper, attotime::from_msec(200)); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -1308,8 +1308,8 @@ void astrocorp_state::skilldrp(machine_config &config) NVRAM(config, "nvram"); EEPROM_93C46_16BIT(config, "eeprom"); - HOPPER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); - HOPPER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); + HOPPER(config, m_ticket, attotime::from_msec(200)); + HOPPER(config, m_hopper, attotime::from_msec(200)); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/barcrest/mpu4.cpp b/src/mame/barcrest/mpu4.cpp index 3292ac4f685..283975abe40 100644 --- a/src/mame/barcrest/mpu4.cpp +++ b/src/mame/barcrest/mpu4.cpp @@ -2321,7 +2321,7 @@ void mpu4_state::mpu4_common(machine_config &config) BACTA_DATALOGGER(config, m_dataport, 0); m_dataport->rxd_handler().set(FUNC(mpu4_state::dataport_rxd)); - HOPPER(config, m_hopper1, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper1, attotime::from_msec(100)); SPEAKER(config, "mono").front_center(); diff --git a/src/mame/bmc/bmcpokr.cpp b/src/mame/bmc/bmcpokr.cpp index 63331cebcb5..2be8ed1aeac 100644 --- a/src/mame/bmc/bmcpokr.cpp +++ b/src/mame/bmc/bmcpokr.cpp @@ -382,7 +382,7 @@ int bmcpokr_state::hopper_r() { // motor off should clear the sense bit (I guess ticket.cpp should actually do this). // Otherwise a hopper bit stuck low will prevent several keys from being registered. - return (m_mux & 0x01) ? m_hopper->line_r() : 1; + return (m_mux & 0x01) ? (m_hopper->line_r() ^ 1) : 1; } void bmcpokr_state::irq_enable_w(offs_t offset, uint8_t data, uint8_t mem_mask) @@ -1149,7 +1149,7 @@ void bmcpokr_state::bmcpokr(machine_config &config) TIMER(config, "scantimer", 0).configure_scanline(FUNC(bmcpokr_state::interrupt), "screen", 0, 1); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh(HZ_TO_ATTOSECONDS(58.935)); // HSync - 15.440kHz, VSync - 58.935Hz + screen.set_refresh(HZ_TO_ATTOSECONDS(58.935)); // HSync - 15.440kHz, VSync - 58.935Hz screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_screen_update(FUNC(bmcpokr_state::screen_update)); screen.set_size(64*8, 32*8); @@ -1165,15 +1165,13 @@ void bmcpokr_state::bmcpokr(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, 0); - m_hopper->set_period(attotime::from_msec(10)); - m_hopper->set_senses(TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW, false); // hopper stuck low if too slow + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(10)); // hopper stuck low if too slow SPEAKER(config, "mono").front_center(); - YM2413(config, "ymsnd", XTAL(42'000'000) / 12).add_route(ALL_OUTPUTS, "mono", 1.00); // UM3567 @3.50MHz (42/12) + YM2413(config, "ymsnd", XTAL(42'000'000) / 12).add_route(ALL_OUTPUTS, "mono", 1.00); // UM3567 @3.50MHz (42/12) - OKIM6295(config, "oki", XTAL(42'000'000) / 40, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.00); // M6295 @1.05MHz (42/40) + OKIM6295(config, "oki", XTAL(42'000'000) / 40, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.00); // M6295 @1.05MHz (42/40) } void bmcpokr_state::fengyunh(machine_config &config) diff --git a/src/mame/edevices/pzletime.cpp b/src/mame/edevices/pzletime.cpp index 23ccb5a7e7e..741e580d215 100644 --- a/src/mame/edevices/pzletime.cpp +++ b/src/mame/edevices/pzletime.cpp @@ -298,7 +298,7 @@ void pzletime_state::pzletime(machine_config &config) PALETTE(config, m_palette[1], palette_device::RGB_555); EEPROM_93C46_16BIT(config, "eeprom"); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(2000)); SPEAKER(config, "mono").front_center(); OKIM6295(config, m_oki, 937500, okim6295_device::PIN7_HIGH); //freq & pin7 taken from stlforce diff --git a/src/mame/excellent/d9final.cpp b/src/mame/excellent/d9final.cpp index 3fd07894611..940710ad430 100644 --- a/src/mame/excellent/d9final.cpp +++ b/src/mame/excellent/d9final.cpp @@ -335,7 +335,7 @@ void d9final_state::d9final(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // Sharp LH5116D-10 + battery - HOPPER(config, m_hopper, attotime::from_msec(20), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + HOPPER(config, m_hopper, attotime::from_msec(20)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); diff --git a/src/mame/excellent/dblcrown.cpp b/src/mame/excellent/dblcrown.cpp index f5726f870d4..be6527fd1af 100644 --- a/src/mame/excellent/dblcrown.cpp +++ b/src/mame/excellent/dblcrown.cpp @@ -588,7 +588,7 @@ void dblcrown_state::dblcrown(machine_config &config) // 1000 ms. (minimal of MAX693A watchdog long timeout period with internal oscillator) WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(1000)); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + HOPPER(config, m_hopper, attotime::from_msec(50)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); diff --git a/src/mame/excellent/lastbank.cpp b/src/mame/excellent/lastbank.cpp index 8b10fcd75cf..0884a7c1eb0 100644 --- a/src/mame/excellent/lastbank.cpp +++ b/src/mame/excellent/lastbank.cpp @@ -15,7 +15,6 @@ Undumped games on similar hardware (ES-9402 or ES-9410): TODO: - lastbank: sprites should be clip masked during gameplay (verify); -- fever13: GFX ROM dump; - fever13: OKI sound volume overdrives a lot; - hookup hopper device; @@ -27,6 +26,7 @@ Undumped games on similar hardware (ES-9402 or ES-9410): #include "machine/gen_latch.h" #include "machine/nvram.h" #include "machine/tc009xlvc.h" +#include "machine/ticket.h" #include "machine/timer.h" #include "sound/es8712.h" #include "sound/okim6295.h" @@ -44,6 +44,7 @@ class lastbank_state : public driver_device lastbank_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") + , m_hopper(*this, "hopper") , m_oki(*this, "oki") , m_essnd(*this, "essnd") , m_key{ { *this, "P1_KEY%u", 0U }, { *this, "P2_KEY%u", 0U } } @@ -63,6 +64,7 @@ class lastbank_state : public driver_device private: required_device m_maincpu; + required_device m_hopper; required_device m_oki; required_device m_essnd; @@ -128,8 +130,12 @@ void lastbank_state::output_w(offs_t offset, uint8_t data) switch (offset) { case 0: + // lamps? + break; + case 1: - //logerror("%s: Writing %02x to A80%x\n", machine().describe_context(), data, offset); + // xxxx ---- probably individual lockouts + m_hopper->motor_w(BIT(data, 2)); break; case 2: @@ -181,7 +187,7 @@ void lastbank_state::main_map(address_map &map) map(0xa804, 0xa804).portr("SPECIAL"); map(0xa805, 0xa805).w("soundlatch1", FUNC(generic_latch_8_device::write)); map(0xa806, 0xa806).w("soundlatch2", FUNC(generic_latch_8_device::write)); - map(0xa807, 0xa807).nopw(); // hopper? + map(0xa807, 0xa807).nopw(); map(0xa808, 0xa808).r(FUNC(lastbank_state::key_matrix_r<0>)); map(0xa80c, 0xa80c).r(FUNC(lastbank_state::key_matrix_r<1>)); map(0xa81c, 0xa81c).portr("DSW1"); @@ -235,9 +241,7 @@ static INPUT_PORTS_START( lastbank ) PORT_START("SPECIAL") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) - PORT_DIPNAME( 0x04, 0x04, "Hopper Count" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_DIPNAME( 0x08, 0x08, "Hopper Empty" ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -592,6 +596,8 @@ void lastbank_state::lastbank(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + HOPPER(config, m_hopper, attotime::from_msec(50)); + z80_device &audiocpu(Z80(config, "audiocpu", MASTER_CLOCK / 4)); audiocpu.set_addrmap(AS_PROGRAM, &lastbank_state::audio_map); audiocpu.set_addrmap(AS_IO, &lastbank_state::audio_io); @@ -654,7 +660,9 @@ ROM_START( lastbank ) ROM_LOAD( "7.u60", 0x00000, 0x80000, CRC(41be7146) SHA1(00f1c0d5809efccf888e27518a2a5876c4b633d8) ) ROM_END -ROM_START( fever13 ) // ES-9410 PCB (TC0090LVC marked ES9402LA, Z80, ES8712, 14'318'181 MHz XTAL, OKI M6295 with 1000J resonator, MSM6585 with 640J resonator) + // ES-9410 PCB (TC0090LVC marked ES9402LA, Z80, ES8712, 14'318'181 MHz XTAL, + // OKI M6295 with 1000J resonator, MSM6585 with 640J resonator) +ROM_START( fever13 ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD( "9.u9", 0x00000, 0x40000, CRC(a17a6a9c) SHA1(b2bff250d1ea879bcdd9bea92537975a168babc8) ) @@ -662,7 +670,8 @@ ROM_START( fever13 ) // ES-9410 PCB (TC0090LVC marked ES9402LA, Z80, ES8712, 14' ROM_LOAD( "4.u48", 0x00000, 0x10000, CRC(33cba6b2) SHA1(cf7d1c7c6215b2f83c9266f92f46d3cfc0242afc) ) ROM_REGION( 0x120000, "maincpu:gfx", 0 ) - ROM_LOAD( "u11", 0x000000, 0x100000, BAD_DUMP CRC(2588d82d) SHA1(426f6821862d54123e53410e2776586ddf6b21e7) ) // not dumped yet, using lastbank's for now + // unlabeled mask ROM, socket marked as 23C8000 CG ROM + ROM_LOAD( "u11", 0x000000, 0x100000, CRC(da59b0d8) SHA1(86fd3cd77aae22e103d11e697b8b4f70ae8b8197) ) ROM_REGION( 0x40000, "oki", 0 ) ROM_LOAD( "es-9410.u55", 0x00000, 0x40000, CRC(09b5e4d6) SHA1(cf0235e9cf0577bf932beda7e4fb1b84410a3e0c) ) // 1xxxxxxxxxxxxxxxxx = 0xFF @@ -675,4 +684,4 @@ ROM_END GAME( 1994, lastbank, 0, lastbank, lastbank, lastbank_state, empty_init, ROT0, "Excellent System", "Last Bank (v1.16)", MACHINE_SUPPORTS_SAVE ) -GAME( 1995, fever13, 0, lastbank, fever13, fever13_state, empty_init, ROT0, "Excellent System", "Fever 13 (Japan, v1.3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // missing GFX ROM dump +GAME( 1995, fever13, 0, lastbank, fever13, fever13_state, empty_init, ROT0, "Excellent System", "Fever 13 (Japan, v1.3)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) diff --git a/src/mame/excellent/witch.cpp b/src/mame/excellent/witch.cpp index 2b530f067fe..cd2aa6cafd0 100644 --- a/src/mame/excellent/witch.cpp +++ b/src/mame/excellent/witch.cpp @@ -1080,7 +1080,7 @@ void base_state::base(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); // time between hopper pulses in milliseconds (not right for attendant pay) + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // time between hopper pulses in milliseconds (not right for attendant pay) // 82C255 (actual chip on PCB) is equivalent to two 8255s I8255(config, m_ppi[0]); diff --git a/src/mame/f32/f-32.cpp b/src/mame/f32/f-32.cpp index 52a9d3e2081..6546337b41b 100644 --- a/src/mame/f32/f-32.cpp +++ b/src/mame/f32/f-32.cpp @@ -114,8 +114,6 @@ class royalpk2_state : public fe132_state void royalpk2(machine_config &config); - int hopper_r(); - protected: virtual void machine_start() override; virtual void machine_reset() override; @@ -313,7 +311,7 @@ static INPUT_PORTS_START( royalpk2 ) PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("Medal Clear") PORT_CODE(KEYCODE_Y) PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("Operator Gift") PORT_CODE(KEYCODE_U) - PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(royalpk2_state, hopper_r) + PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("Over Flow") PORT_CODE(KEYCODE_O) PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("Medal Empty") PORT_CODE(KEYCODE_L) @@ -338,11 +336,6 @@ void royalpk2_state::royalpk2_map(address_map &map) map(0xfff00000, 0xffffffff).rom().region("user1", 0); } -int royalpk2_state::hopper_r() -{ - return m_hopper->line_r() ? 0 : 1; -} - void royalpk2_state::royalpk2_io(address_map &map) { // map(0x4000, 0x41ff).readonly().share("nvram"); // seems to expect to read NVRAM from here @@ -477,7 +470,7 @@ void royalpk2_state::royalpk2(machine_config &config) NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(100)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/fidelity/chesster.cpp b/src/mame/fidelity/chesster.cpp index bafe57d1bd3..ae6f9b6f671 100644 --- a/src/mame/fidelity/chesster.cpp +++ b/src/mame/fidelity/chesster.cpp @@ -62,7 +62,7 @@ class chesster_state : public driver_device protected: virtual void machine_start() override; - virtual void machine_reset() override; + virtual void machine_reset() override { m_dac->write(0x80); } private: // devices/pointers @@ -95,11 +95,6 @@ void chesster_state::machine_start() save_item(NAME(m_select)); } -void chesster_state::machine_reset() -{ - m_dac->write(0x80); -} - /******************************************************************************* diff --git a/src/mame/fidelity/clockdiv.cpp b/src/mame/fidelity/clockdiv.cpp index d6050baf486..c2f2e13ef40 100644 --- a/src/mame/fidelity/clockdiv.cpp +++ b/src/mame/fidelity/clockdiv.cpp @@ -1,13 +1,13 @@ // license:BSD-3-Clause // copyright-holders:hap -/******************************************************************************* +/* Fidelity Electronics 6502 dynamic CPU clock divider Offset-dependent CPU clock divider base class. Used to compensate slow memory chips in chess computer models: SC12, AS12, PC, EAS, EAG. -*******************************************************************************/ +*/ #include "emu.h" #include "clockdiv.h" diff --git a/src/mame/fidelity/eldorado.cpp b/src/mame/fidelity/eldorado.cpp index 12edf1f7b92..9588b70e023 100644 --- a/src/mame/fidelity/eldorado.cpp +++ b/src/mame/fidelity/eldorado.cpp @@ -42,7 +42,6 @@ class eldorado_state : public driver_device m_inputs(*this, "IN.0") { } - // machine configs void eldorado(machine_config &config); protected: @@ -57,15 +56,12 @@ class eldorado_state : public driver_device required_ioport m_inputs; bool m_kp_select = false; - u16 m_inp_mux = 0; - u8 m_led_select = 0; + u8 m_inp_mux = 0; // I/O handlers - void update_display(); void mux_w(u8 data); u8 mux_r(); void control_w(u8 data); - int t0_r(); u8 input_r(); }; @@ -74,7 +70,6 @@ void eldorado_state::machine_start() // register for savestates save_item(NAME(m_kp_select)); save_item(NAME(m_inp_mux)); - save_item(NAME(m_led_select)); } @@ -83,16 +78,11 @@ void eldorado_state::machine_start() I/O *******************************************************************************/ -void eldorado_state::update_display() -{ - m_display->matrix(m_led_select, m_inp_mux); -} - void eldorado_state::mux_w(u8 data) { // D0-D7: input mux, led data m_inp_mux = ~data; - update_display(); + m_display->write_mx(m_inp_mux); } u8 eldorado_state::mux_r() @@ -106,24 +96,17 @@ void eldorado_state::control_w(u8 data) m_dac->write(BIT(~data, 4)); // P25,P26: led select - m_led_select = ~data >> 5 & 3; - update_display(); + m_display->write_my(~data >> 5 & 3); - // P27: keypad select + // P27: input mux highest bit (also goes to T0) m_kp_select = !bool(data & 0x80); } -int eldorado_state::t0_r() -{ - // T0: P27 - return m_kp_select ? 0 : 1; -} - u8 eldorado_state::input_r() { + // P10-P17: multiplexed inputs u8 data = 0; - // P10-P17: multiplexed inputs // read chessboard buttons for (int i = 0; i < 8; i++) if (BIT(m_inp_mux, i)) @@ -168,7 +151,7 @@ void eldorado_state::eldorado(machine_config &config) m_maincpu->p2_out_cb().set(FUNC(eldorado_state::control_w)); m_maincpu->bus_in_cb().set(FUNC(eldorado_state::mux_r)); m_maincpu->bus_out_cb().set(FUNC(eldorado_state::mux_w)); - m_maincpu->t0_in_cb().set(FUNC(eldorado_state::t0_r)); + m_maincpu->t0_in_cb().set(m_maincpu, FUNC(mcs48_cpu_device::p2_r)).bit(7); SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS); m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); diff --git a/src/mame/fidelity/elite.cpp b/src/mame/fidelity/elite.cpp index 457e66dd89f..56d7bbd6bcd 100644 --- a/src/mame/fidelity/elite.cpp +++ b/src/mame/fidelity/elite.cpp @@ -167,6 +167,12 @@ class elite_state : public fidel_clockdiv_state void ppi_portc_w(u8 data); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void elite_state::machine_start() { fidel_clockdiv_state::machine_start(); diff --git a/src/mame/fidelity/msc.cpp b/src/mame/fidelity/msc.cpp index 25d19ad45d6..1aba1a76e75 100644 --- a/src/mame/fidelity/msc.cpp +++ b/src/mame/fidelity/msc.cpp @@ -27,12 +27,12 @@ and one for MCS48. A12 is forced high or low to select the bank. #include "emu.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "cpu/z8/z8.h" #include "machine/sensorboard.h" #include "sound/dac.h" #include "video/pwm.h" -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" #include "softlist_dev.h" #include "speaker.h" @@ -55,7 +55,6 @@ class msc_state : public driver_device m_inputs(*this, "IN.0") { } - // machine configs void msc(machine_config &config); protected: @@ -72,18 +71,13 @@ class msc_state : public driver_device u8 m_led_select = 0; u16 m_inp_mux = 0; - // address maps void main_map(address_map &map); // I/O handlers void update_display(); void mux_w(u8 data); void control_w(u8 data); - u8 rom_r(offs_t offset); - - u8 read_inputs(); - u8 input_hi_r(); - u8 input_lo_r(); + u8 input_r(); }; void msc_state::machine_start() @@ -113,18 +107,20 @@ void msc_state::mux_w(u8 data) void msc_state::control_w(u8 data) { - // P37: input mux highest bit + // P34: speaker out + m_dac->write(BIT(~data, 4)); + // P35,P36: led select - m_inp_mux = (m_inp_mux & 0xff) | (data << 1 & 0x100); m_led_select = ~data >> 5 & 3; - update_display(); - // P34: speaker out - m_dac->write(BIT(~data, 4)); + // P37: input mux highest bit, led data + m_inp_mux = (m_inp_mux & 0xff) | (data << 1 & 0x100); + update_display(); } -u8 msc_state::read_inputs() +u8 msc_state::input_r() { + // P30-P33,P04-P07: multiplexed inputs u8 data = 0; // read chessboard sensors @@ -139,18 +135,6 @@ u8 msc_state::read_inputs() return bitswap<8>(~data,0,1,2,3,4,5,6,7); } -u8 msc_state::input_hi_r() -{ - // P04-P07: multiplexed inputs high - return read_inputs() | 0x0f; -} - -u8 msc_state::input_lo_r() -{ - // P30-P33: multiplexed inputs low - return read_inputs() | 0xf0; -} - /******************************************************************************* @@ -191,9 +175,11 @@ void msc_state::msc(machine_config &config) // basic machine hardware Z8601(config, m_maincpu, 8_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &msc_state::main_map); - m_maincpu->p0_in_cb().set(FUNC(msc_state::input_hi_r)); + m_maincpu->p0_in_cb().set(FUNC(msc_state::input_r)).mask(0xf0); + m_maincpu->p0_in_cb().append_constant(0x0f).mask(0x0f); m_maincpu->p2_out_cb().set(FUNC(msc_state::mux_w)); - m_maincpu->p3_in_cb().set(FUNC(msc_state::input_lo_r)); + m_maincpu->p3_in_cb().set(FUNC(msc_state::input_r)).mask(0x0f); + m_maincpu->p3_in_cb().append_constant(0xf0).mask(0xf0); m_maincpu->p3_out_cb().set(FUNC(msc_state::control_w)); SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS); diff --git a/src/mame/fidelity/sc6.cpp b/src/mame/fidelity/sc6.cpp index 62da2b5efab..e03b74d544f 100644 --- a/src/mame/fidelity/sc6.cpp +++ b/src/mame/fidelity/sc6.cpp @@ -5,7 +5,7 @@ Fidelity Sensory Chess Challenger 6 (model SC6) Fidelity Mini Sensory Chess Challenger (model MSC, 1982 version) -Fidelity The Classic (model 6079) +Fidelity The Classic (model CC8/6079) Fidelity Gambit Voice (model 6085) The chess engine is by Ron Nelson. These are all on similar hardware. Several @@ -22,7 +22,7 @@ Known MCU ROM serials: 100-1020B01 ROM contents is confirmed to be identical to 100-1020B02. TODO: -- is The Classic model CC8 a different ROM? and what about model 6079D? +- is The Classic model 6079D a different ROM? ================================================================================ @@ -197,11 +197,12 @@ void sc6_state::mux_w(u8 data) // P24-P27: 7442 A-D (or 74145) // 7442 0-8: input mux, led data m_inp_mux = data >> 4 & 0xf; - m_display->write_mx(1 << m_inp_mux); + u16 sel = 1 << m_inp_mux; + m_display->write_mx(sel); // 7442 9: speaker out if (m_dac != nullptr) - m_dac->write(BIT(1 << m_inp_mux, 9)); + m_dac->write(BIT(sel, 9)); } void sc6_state::select_w(u8 data) @@ -414,6 +415,11 @@ ROM_START( classic ) ROM_LOAD("tmp80c50ap-6-9311_100-1020b02.ic1", 0x0000, 0x1000, CRC(ba41b5ba) SHA1(1a5c5b2e990a07b9ff51eecfa952a4b890107797) ) ROM_END +ROM_START( classica ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD("tmp80c50ap-6_9517.ic1", 0x0000, 0x1000, CRC(dfd30755) SHA1(92075c7df9205b9647801487b9bbddcf230dfc91) ) +ROM_END + ROM_START( gambitv ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD("tmp80c50ap-6-9337_100-1020c01.ic1", 0x0000, 0x1000, CRC(dafee386) SHA1(d67914fb2abd73c0068b7e61fc23d211c52d65d9) ) @@ -441,10 +447,11 @@ ROM_END Drivers *******************************************************************************/ -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -SYST( 1982, fscc6, 0, 0, sc6, sc6, sc6_state, empty_init, "Fidelity Electronics", "Sensory Chess Challenger \"6\"", MACHINE_SUPPORTS_SAVE ) -SYST( 1982, miniscc, 0, 0, msc, msc, sc6_state, empty_init, "Fidelity Electronics", "Mini Sensory Chess Challenger (MCS-48 version)", MACHINE_SUPPORTS_SAVE ) // aka "Mini Sensory II" +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +SYST( 1982, fscc6, 0, 0, sc6, sc6, sc6_state, empty_init, "Fidelity Electronics", "Sensory Chess Challenger \"6\"", MACHINE_SUPPORTS_SAVE ) +SYST( 1982, miniscc, 0, 0, msc, msc, sc6_state, empty_init, "Fidelity Electronics", "Mini Sensory Chess Challenger (MCS-48 version)", MACHINE_SUPPORTS_SAVE ) // aka "Mini Sensory II" -SYST( 1986, classic, 0, 0, classic, sc6, sc6_state, empty_init, "Fidelity International", "The Classic (model 6079)", MACHINE_SUPPORTS_SAVE ) +SYST( 1986, classic, 0, 0, classic, sc6, sc6_state, empty_init, "Fidelity International", "The Classic (model 6079)", MACHINE_SUPPORTS_SAVE ) +SYST( 1985, classica, classic, 0, classic, sc6, sc6_state, empty_init, "Fidelity International", "The Classic (model CC8)", MACHINE_SUPPORTS_SAVE ) -SYST( 1987, gambitv, 0, 0, gambitv, gambitv, sc6_state, empty_init, "Fidelity International", "Gambit Voice", MACHINE_SUPPORTS_SAVE ) +SYST( 1987, gambitv, 0, 0, gambitv, gambitv, sc6_state, empty_init, "Fidelity International", "Gambit Voice", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/fidelity/sc8.cpp b/src/mame/fidelity/sc8.cpp index 50dfdc5b64b..017da0632ba 100644 --- a/src/mame/fidelity/sc8.cpp +++ b/src/mame/fidelity/sc8.cpp @@ -94,19 +94,21 @@ void scc_state::control_w(offs_t offset, u8 data) u8 mask = 1 << (offset & 7); m_led_data = (m_led_data & ~mask) | ((data & 0x80) ? mask : 0); - // d0-d3: led select, input mux (row 9 is speaker out) + // d0-d3: 7442 to led select, input mux // d4: corner led(direct) m_inp_mux = data & 0xf; u16 sel = 1 << m_inp_mux; - m_dac->write(BIT(sel, 9)); m_display->matrix((sel & 0xff) | (data << 4 & 0x100), m_led_data); + + // 7442 9: speaker out + m_dac->write(BIT(sel, 9)); } u8 scc_state::input_r() { + // d0-d7: multiplexed inputs (active low) u8 data = 0; - // d0-d7: multiplexed inputs (active low) // read chessboard sensors if (m_inp_mux < 8) data = m_board->read_file(m_inp_mux); diff --git a/src/mame/fidelity/sc9.cpp b/src/mame/fidelity/sc9.cpp index 4542bd4ad24..f1ec5b9644e 100644 --- a/src/mame/fidelity/sc9.cpp +++ b/src/mame/fidelity/sc9.cpp @@ -102,7 +102,6 @@ class sc9_state : public driver_device void sc9d_map(address_map &map); // I/O handlers - void update_display(); void control_w(u8 data); void led_w(offs_t offset, u8 data); u8 input_r(); @@ -129,21 +128,16 @@ INPUT_CHANGED_MEMBER(sc9_state::sc9c_change_cpu_freq) I/O *******************************************************************************/ -void sc9_state::update_display() -{ - // 8*8 chessboard leds + 1 corner led - m_display->matrix(1 << m_inp_mux, m_led_data); -} - void sc9_state::control_w(u8 data) { // d0-d3: 74245 P0-P3 // 74245 Q0-Q8: input mux, led select m_inp_mux = data & 0xf; - update_display(); + u16 sel = 1 << m_inp_mux; + m_display->write_my(sel); // 74245 Q9: speaker out - m_dac->write(BIT(1 << m_inp_mux, 9)); + m_dac->write(BIT(sel, 9)); // d4,d5: ? // d6,d7: N/C @@ -153,14 +147,14 @@ void sc9_state::led_w(offs_t offset, u8 data) { // a0-a2,d0: led data via NE591N m_led_data = (m_led_data & ~(1 << offset)) | ((data & 1) << offset); - update_display(); + m_display->write_mx(m_led_data); } u8 sc9_state::input_r() { + // d0-d7: multiplexed inputs (active low) u8 data = 0; - // d0-d7: multiplexed inputs (active low) // read chessboard sensors if (m_inp_mux < 8) data = m_board->read_file(m_inp_mux); diff --git a/src/mame/funtech/supracan.cpp b/src/mame/funtech/supracan.cpp index 4a9cae39065..b72028b0561 100644 --- a/src/mame/funtech/supracan.cpp +++ b/src/mame/funtech/supracan.cpp @@ -1,6 +1,6 @@ // license: BSD-3-Clause // copyright-holders: Angelo Salese, Ryan Holtz -/*************************************************************************** +/************************************************************************************************** Super A'Can (c) 1995 Funtech @@ -10,7 +10,7 @@ Super A'Can (c) 1995 Funtech - https://github.com/angelosa/hw_docs/blob/main/funtech_superacan/pergame.md -******************************************************************************* +=================================================================================================== INFO: @@ -61,19 +61,21 @@ Super A'Can (c) 1995 Funtech - All: are ALL the layers ROZ capable?? -***************************************************************************/ +**************************************************************************************************/ #include "emu.h" -#include "cpu/m68000/m68000.h" -#include "cpu/m6502/m65c02.h" + #include "bus/generic/slot.h" #include "bus/generic/carts.h" -#include "acan.h" +#include "cpu/m68000/m68000.h" +#include "cpu/m6502/m65c02.h" + #include "emupal.h" #include "screen.h" #include "softlist_dev.h" #include "speaker.h" #include "tilemap.h" +#include "umc6619_sound.h" #include "umc6650.h" #define LOG_UNKNOWNS (1U << 1) @@ -102,6 +104,8 @@ namespace { // NOTE: same as sega/segac2.cpp XL2 static constexpr XTAL U13_CLOCK = XTAL(53'693'175); +// TODO: bump to 4 after conversion of video_r/_w to um6618_map +static constexpr int ROZ_LAYER_NUMBER = 3; #define DRAW_DEBUG_ROZ (0) @@ -183,7 +187,7 @@ class supracan_state : public driver_device required_shared_ptr m_vram; required_shared_ptr m_soundram; - required_device m_sound; + required_device m_sound; required_device m_gfxdecode; required_device m_screen; @@ -222,9 +226,11 @@ class supracan_state : public driver_device uint16_t m_video_flags = 0; uint16_t m_tilemap_flags[3]{}; uint16_t m_tilemap_mode[3]{}; + uint16_t m_tilemap_tile_mode[3]{}; uint32_t m_roz_base_addr = 0; uint16_t m_roz_mode = 0; + uint16_t m_roz_tile_mode = 0; uint32_t m_roz_scrollx = 0; uint32_t m_roz_scrolly = 0; uint16_t m_roz_tile_bank = 0; @@ -264,6 +270,7 @@ class supracan_state : public driver_device void get_tilemap_info_common(int layer, tile_data &tileinfo, int count); void get_roz_tilemap_info(int layer, tile_data &tileinfo, int count); int get_tilemap_dimensions(int &xsize, int &ysize, int layer); + void update_tilemap_flags(int layer); void draw_sprite_tile(bitmap_ind16 &dst, bitmap_ind8 &priomap, const rectangle &cliprect, gfx_element *gfx, int tile, int palette, bool xflip, bool yflip, int dstx, int dsty, int prio); void draw_sprite_tile_mask(bitmap_ind8 &dst, const rectangle &cliprect, gfx_element *gfx, int tile, bool xflip, bool yflip, int dstx, int dsty); void draw_sprite_tile_masked(bitmap_ind16 &dst, bitmap_ind8 &mask, bitmap_ind8 &priomap, const rectangle &cliprect, gfx_element *gfx, int tile, int palette, bool xflip, bool yflip, int dstx, int dsty, int prio); @@ -351,22 +358,30 @@ void supracan_state::get_tilemap_info_common(int layer, tile_data &tileinfo, int if (region == 0) tile_bank >>= 1; - // speedyd and slghtsag hints that text layer color offsets are in steps of 4 + // speedyd and slghtsag hints that text layer color offsets in steps of 4 if (region == 2) palette_shift = 2; if (layer == 2) tile_bank = (0x1000 | (tile_bank << 1)) & 0x1c00; - int tile = (vram[count] & 0x03ff) + tile_bank; - int flipxy = (vram[count] & 0x0c00) >> 10; - int palette = ((vram[count] & 0xf000) >> 12) << palette_shift; + u8 palette_base = ((vram[count] & 0xf000) >> 12); + // speedyd gameplay + if (BIT(m_tilemap_tile_mode[layer], 9)) + { + tileinfo.category = !BIT(palette_base, 3); + palette_base |= 8; + } + + u16 tile = (vram[count] & 0x03ff) + tile_bank; + u8 flipxy = (vram[count] & 0x0c00) >> 10; + u8 palette = palette_base << palette_shift; tileinfo.set(region, tile, palette, TILE_FLIPXY(flipxy)); } -// I wonder how different this really is.. my guess, not at all. +// TODO: merge with normal layers. void supracan_state::get_roz_tilemap_info(int layer, tile_data &tileinfo, int count) { uint16_t *vram = m_vram; @@ -375,7 +390,6 @@ void supracan_state::get_roz_tilemap_info(int layer, tile_data &tileinfo, int co int region = 1; uint16_t tile_bank = 0; - uint16_t palette_bank = 0; region = get_tilemap_region(layer); @@ -410,9 +424,18 @@ void supracan_state::get_roz_tilemap_info(int layer, tile_data &tileinfo, int co count += base; - int tile = (vram[count] & 0x03ff) + tile_bank; - int flipxy = (vram[count] & 0x0c00) >> 10; - int palette = ((vram[count] & 0xf000) >> 12) + palette_bank; + u8 palette_base = ((vram[count] & 0xf000) >> 12); + + // sonevil gameplay + if (BIT(m_roz_tile_mode, 9)) + { + tileinfo.category = !BIT(palette_base, 3); + palette_base |= 8; + } + + u16 tile = (vram[count] & 0x03ff) + tile_bank; + u8 flipxy = (vram[count] & 0x0c00) >> 10; + u8 palette = palette_base; tileinfo.set(region, tile, palette, TILE_FLIPXY(flipxy)); } @@ -477,7 +500,7 @@ int supracan_state::get_tilemap_dimensions(int &xsize, int &ysize, int layer) ysize = 32; int select; - if (layer == 3) + if (layer == ROZ_LAYER_NUMBER) select = m_roz_mode & 0x0f00; else select = m_tilemap_flags[layer] & 0x0f00; @@ -505,6 +528,21 @@ int supracan_state::get_tilemap_dimensions(int &xsize, int &ysize, int layer) } } +void supracan_state::update_tilemap_flags(int layer) +{ + const u32 attr = layer == ROZ_LAYER_NUMBER ? m_roz_mode : m_tilemap_flags[layer]; + const u32 flip_x = BIT(attr, 1) ? TILEMAP_FLIPX : 0; + const u32 flip_y = BIT(attr, 0) ? TILEMAP_FLIPY : 0; + + // TODO: we should really track what's the current tilemap paging and update only that + // Obviously we should also NOT mark all dirty, but just subscribe to what's the effective bank. + // is a dynamic mapper even possible with tilemap.h? + for (int i = 0; i < 4; i++) + { + m_tilemap_sizes[layer][i]->set_flip(flip_x | flip_y); + } +} + void supracan_state::draw_sprite_tile(bitmap_ind16 &dst, bitmap_ind8 &priomap, const rectangle &cliprect, gfx_element *gfx, int tile, int palette, bool xflip, bool yflip, int dstx, int dsty, int prio) { @@ -727,29 +765,28 @@ void supracan_state::draw_sprite_tile_masked(bitmap_ind16 &dst, bitmap_ind8 &mas } } +// [0] +// -e-- ---- ---- ---- sprite enable? +// ---h hhh- ---- ---- Y size (not always right) +// ---- ---y yyyy yyyy Y position +// [1] +// bbbb ---- ---- ---- Tile bank +// ---- h--- ---- ---- Horizontal flip +// ---- -v-- ---- ---- Vertical flip +// ---- --mm ---- ---- Masking mode +// ---- ---- ---- -www X size +// [2] +// zzz- ---- ---- ---- X scale +// ---- ???- ---- ---- Unknown, but often written. +// Values include 111 and 110 for the Super A'Can logo, 110 in the Sango Fighter intro, and 101/100 in the Boom Zoo intro. +// ---- ---x xxxx xxxx X position +// [3] +// d--- ---- ---- ---- Direct Sprite (use details from here, not looked up in vram) +// -ooo oooo oooo oooo Sprite address void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bitmap_ind8 &priomap, const rectangle &cliprect) { uint16_t *vram = m_vram; -// [0] -// -e-- ---- ---- ---- sprite enable? -// ---h hhh- ---- ---- Y size (not always right) -// ---- ---y yyyy yyyy Y position -// [1] -// bbbb ---- ---- ---- Tile bank -// ---- h--- ---- ---- Horizontal flip -// ---- -v-- ---- ---- Vertical flip -// ---- --mm ---- ---- Masking mode -// ---- ---- ---- -www X size -// [2] -// zzz- ---- ---- ---- X scale -// ---- ???- ---- ---- Unknown, but often written. -// Values include 111 and 110 for the Super A'Can logo, 110 in the Sango Fighter intro, and 101/100 in the Boom Zoo intro. -// ---- ---x xxxx xxxx X position -// [3] -// d--- ---- ---- ---- Direct Sprite (use details from here, not looked up in vram) -// -ooo oooo oooo oooo Sprite address - uint32_t skip_count = 0; uint32_t start_word = (m_sprite_base_addr >> 1) + skip_count * 4; uint32_t end_word = start_word + (m_sprite_count - skip_count) * 4; @@ -762,13 +799,12 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bi int x = vram[i + 2] & 0x01ff; int y = vram[i + 0] & 0x01ff; - int sprite_offset = (vram[i + 3])<< 1; - int bank = (vram[i + 1] & 0xf000) >> 12; int mask = (vram[i + 1] & 0x0300) >> 8; int sprite_xflip = (vram[i + 1] & 0x0800) >> 11; int sprite_yflip = (vram[i + 1] & 0x0400) >> 10; int prio = (vram[i + 2] >> 9) & 3; + const u16 sprite_ptr = vram[i + 3]; //int xscale = vram[i + 2] >> 13; gfx_element *gfx = m_gfxdecode->gfx(region); @@ -778,44 +814,31 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bi if ((vram[i + 0] & 0x4000)) { - #if 0 - printf("%d (unk %02x) (enable %02x) (unk Y2 %02x, %02x) (y pos %02x) (bank %01x) (flip %01x) (unknown %02x) (x size %02x) (xscale %01x) (unk %01x) (xpos %02x) (code %04x)\n", i, - (vram[i + 0] & 0x8000) >> 15, - (vram[i + 0] & 0x4000) >> 14, - (vram[i + 0] & 0x2000) >> 13, - (vram[i + 0] & 0x1e00) >> 8, - (vram[i + 0] & 0x01ff), - (vram[i + 1] & 0xf000) >> 12, - (vram[i + 1] & 0x0c00) >> 10, - (vram[i + 1] & 0x03f0) >> 4, - (vram[i + 1] & 0x000f), - (vram[i + 2] & 0xf000) >> 12, - (vram[i + 2] & 0x0e00) >> 8, - (vram[i + 2] & 0x01ff) >> 0, - (vram[i + 3] & 0xffff)); - #endif - - if (vram[i + 3] & 0x8000) + int xsize = 1 << (vram[i + 1] & 7); + int ysize = ((vram[i + 0] & 0x1e00) >> 9) + 1; + + // HACK: sonevil sets 1x1 tiles, and expecting to take this path. + // Most likely former condition is wrong, and it just "direct sprite" when latter occurs. + // magipool also wants latter, for the shot markers to work. + if (sprite_ptr & 0x8000 || (xsize == 1 && ysize == 1)) { - uint16_t data = vram[i + 3]; - int tile = (bank * 0x200) + (data & 0x03ff); + int tile = (bank * 0x200) + (sprite_ptr & 0x03ff); - int palette = (data & 0xf000) >> 12; // this might not be correct, due to the & 0x8000 condition above this would force all single tile sprites to be using palette >= 0x8 only + int palette = (sprite_ptr & 0xf000) >> 12; // this might not be correct, due to the & 0x8000 condition above this would force all single tile sprites to be using palette >= 0x8 only - // printf("sprite data %04x %04x %04x %04x\n", vram[i+0] , vram[i+1] , vram[i+2] ,vram[i+3] ); + // sonevil expect to flip X/Y thru the sprite pointer + int tile_xflip = sprite_xflip ^ ((sprite_ptr & 0x0800) >> 11); + int tile_yflip = sprite_yflip ^ ((sprite_ptr & 0x0400) >> 10); if (mask > 1) - draw_sprite_tile_mask(maskmap, cliprect, gfx, tile, sprite_xflip, sprite_yflip, x, y); + draw_sprite_tile_mask(maskmap, cliprect, gfx, tile, tile_xflip, tile_yflip, x, y); else if (mask == 1) - draw_sprite_tile_masked(bitmap, maskmap, priomap, cliprect, gfx, tile, palette, sprite_xflip, sprite_yflip, x, y, prio); + draw_sprite_tile_masked(bitmap, maskmap, priomap, cliprect, gfx, tile, palette, tile_xflip, tile_yflip, x, y, prio); else - draw_sprite_tile(bitmap, priomap, cliprect, gfx, tile, palette, sprite_xflip, sprite_yflip, x, y, prio); + draw_sprite_tile(bitmap, priomap, cliprect, gfx, tile, palette, tile_xflip, tile_yflip, x, y, prio); } else { - int xsize = 1 << (vram[i + 1] & 7); - int ysize = ((vram[i + 0] & 0x1e00) >> 9) + 1; - // I think the xsize must influence the ysize somehow, there are too many conflicting cases otherwise // there don't appear to be any special markers in the actual looked up tile data to indicate skip / end of list @@ -823,7 +846,7 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bi { for (int xtile = 0; xtile < xsize; xtile++) { - uint16_t data = vram[(sprite_offset + ytile * xsize + xtile) & VRAM_MASK]; + uint16_t data = vram[((sprite_ptr << 1) + ytile * xsize + xtile) & VRAM_MASK]; int tile = (bank * 0x200) + (data & 0x03ff); int palette = (data & 0xf000) >> 12; @@ -843,6 +866,7 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bi } } + // TODO: scaling #if 0 if (xscale == 0) continue; uint32_t delta = (1 << 17) / xscale; @@ -979,12 +1003,11 @@ uint32_t supracan_state::screen_update(screen_device &screen, bitmap_ind16 &bitm m_sprite_final_bitmap.fill(0x00, cliprect); m_sprite_mask_bitmap.fill(0x00, cliprect); m_prio_bitmap.fill(0xff, cliprect); - // TODO: pinpoint back layer color - // - A'Can logo wants 0x30 + // Back layer normally fills with 0x00 // - boomzoo (title) wants 0x00 // - sangofgt (1st fighter stage) wants 0x00 // - sonevil (intro) wants 0x00 - //bitmap.fill(0x80, cliprect); + // TODO: layer overlay happens from mixing registers (A'Can BIOS sets 0x02 there) bitmap.fill(0x00, cliprect); draw_sprites(m_sprite_final_bitmap, m_sprite_mask_bitmap, m_prio_bitmap, cliprect); @@ -997,12 +1020,12 @@ uint32_t supracan_state::screen_update(screen_device &screen, bitmap_ind16 &bitm for (int pri = 7; pri >= 0; pri--) { // Wanted like this by speedyd, formduel and magipool at very least - for (int layer = 0; layer < 4; layer ++) + for (int layer = 0; layer < ROZ_LAYER_NUMBER + 1; layer ++) { int enabled = 0; // ROZ - if (layer == 3) + if (layer == ROZ_LAYER_NUMBER) { enabled = BIT(m_video_flags, 2); if (!enabled) @@ -1033,7 +1056,7 @@ uint32_t supracan_state::screen_update(screen_device &screen, bitmap_ind16 &bitm case 4: transmask = 0x01; break; } - if (layer != 3) // standard layers, NOT roz + if (layer != ROZ_LAYER_NUMBER) { int wrap = (m_tilemap_flags[layer] & 0x20); @@ -1044,6 +1067,14 @@ uint32_t supracan_state::screen_update(screen_device &screen, bitmap_ind16 &bitm if (scrollx & 0x800) scrollx -= 0x1000; if (scrolly & 0x800) scrolly -= 0x1000; + // global flips also inverts scroll meanings + // cfr. formduel left character and sangofgt 2nd fighter stage. + if (BIT(m_tilemap_flags[layer], 1)) + scrollx ^= ((xsize * 8) - 1); + + if (BIT(m_tilemap_flags[layer], 0)) + scrolly ^= ((ysize * 8) - 1); + int mosaic_count = (m_tilemap_flags[layer] & 0x001c) >> 2; int mosaic_mask = 0xffffffff << mosaic_count; @@ -1221,13 +1252,38 @@ template void supracan_state::dma_w(offs_t offset, uint16_t data, { LOGMASKED(LOG_DMA, "dma_w: Kicking off a DMA from %08x to %08x, %d bytes (%04x)\n", m_dma_regs.source[ch], m_dma_regs.dest[ch], m_dma_regs.count[ch] + 1, data); + // formduel sets both for gameplay to work + // TODO: verify which one is source and which destination + const bool dest_dec = BIT(data, 10); + const bool src_dec = BIT(data, 9); + + if (dest_dec ^ src_dec) + popmessage("DMA trigger %04x with one increment bit set %04x", data, data & 0x0600); + for (int i = 0; i <= m_dma_regs.count[ch]; i++) { - if (data & 0x1000) + // staiwbbl wants to fill both VRAM and work RAM at startup, + // and expects to transfer word for VRAM, byte for work RAM. + // Not providing this will cause all kinds of video and logic glitches. + // TODO: pinpoint DMA modes here (at least upper bits 14-13 should do) + if (data == 0xa800) + { + if ((m_dma_regs.dest[ch] & 0xfe0000) == 0xf40000) + { + mem.write_word(m_dma_regs.dest[ch], 0); + m_dma_regs.dest[ch] += dest_dec ? -2 : 2; + } + else + { + mem.write_byte(m_dma_regs.dest[ch], mem.read_byte(m_dma_regs.source[ch])); + m_dma_regs.dest[ch] += dest_dec ? -1 : 1; + } + } + else if (data & 0x1000) { mem.write_word(m_dma_regs.dest[ch], mem.read_word(m_dma_regs.source[ch])); - m_dma_regs.dest[ch] += 2; - m_dma_regs.source[ch] += 2; + m_dma_regs.dest[ch] += dest_dec ? -2 : 2; + m_dma_regs.source[ch] += src_dec ? -2 : 2; if (data & 0x0100) { // staiwbbl, indirect transfers towards port $f00010-$1f @@ -1238,10 +1294,13 @@ template void supracan_state::dma_w(offs_t offset, uint16_t data, else { mem.write_byte(m_dma_regs.dest[ch], mem.read_byte(m_dma_regs.source[ch])); - m_dma_regs.dest[ch]++; - m_dma_regs.source[ch]++; + m_dma_regs.dest[ch] += dest_dec ? -1 : 1; + m_dma_regs.source[ch] += src_dec ? -1 : 1; } } + // TODO: are these DMA cycle steal? + // There's no indication of a DMA status read so far that would indicate burst. + //m_maincpu->spin_until_time(m_maincpu->cycles_to_attotime(m_dma_regs.count[ch] * 2)); } else if (data != 0x0000) // fake DMA, used by C.U.G. { @@ -1302,6 +1361,8 @@ void supracan_state::main_map(address_map &map) map(0xeb0d00, 0xeb0d03).rw(m_lockout, FUNC(umc6650_device::read), FUNC(umc6650_device::write)).umask16(0x00ff); +// map(0xec0000, 0xec*fff) Cart NVRAM, 8-bit interface + map(0xf00000, 0xf001ff).rw(FUNC(supracan_state::video_r), FUNC(supracan_state::video_w)); map(0xf00200, 0xf003ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0xf40000, 0xf5ffff).ram().w(FUNC(supracan_state::vram_w)).share("vram"); @@ -1433,6 +1494,14 @@ void supracan_state::_6502_soundmem_w(offs_t offset, uint8_t data) } break; } + case 0x40a: + // speedyd/magipool uses this to request main to kickoff a sound DMA. + // gamblord/formduel just sets this just to poll a sound command + // all sets up 0x40c/0x40d as a buffer, and 0x40a to check if the irq is valid + // (does reading from 68k side acknowledges?) + m_maincpu->set_input_line(6, HOLD_LINE); + m_soundram[0x40a] = data; + break; case 0x410: m_soundcpu_irq_enable = data; // gamblord (at least) checks for pending irqs @@ -1525,6 +1594,8 @@ void supracan_state::update_frc_state() { if ((m_frc_control & 0xff00) == 0xa200) { + const u32 period = ((m_frc_control & 0xff << 16) | (m_frc_frequency)); + // HACK: handle case by case until we resolve the equation // (particularly with variable frequencies) switch(m_frc_control & 0xf) @@ -1538,9 +1609,9 @@ void supracan_state::update_frc_state() // magipool: sets 0xa201 / 0x0104 at startup, sometimes flips frequency to 0x0046 // - causes a crash at boot if too fast; - // - takes roughly 6 seconds for a title screen kanji to move right-to-left; + // - takes roughly 6 seconds for a title screen individual kanji to move right-to-left; case 1: - m_frc_timer->adjust(attotime::from_hz(30)); + m_frc_timer->adjust(m_maincpu->cycles_to_attotime(1024 * period), 0); break; // gamblord: sets 0xa20f normally, plays with frequency register a lot. @@ -1548,8 +1619,9 @@ void supracan_state::update_frc_state() // - takes ~1 second for character screen to switch; // - during gameplay sometimes switches to 0xa200 / 0xffff; case 0xf: - m_frc_timer->adjust(attotime::from_hz(120)); + m_frc_timer->adjust(m_maincpu->cycles_to_attotime(8192 * period), 0); break; + default: popmessage("Attempt to fire up FRC with %04x %04x", m_frc_control, m_frc_frequency); break; @@ -1909,28 +1981,52 @@ void supracan_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) case 0x26/2: m_sprite_flags = data; LOGMASKED(LOG_SPRITES, "sprite_flags = %04x\n", data); break; /* Tilemap 0 */ - case 0x100/2: m_tilemap_flags[0] = data; LOGMASKED(LOG_TILEMAP0, "tilemap_flags[0] = %04x\n", data); break; + case 0x100/2: { + m_tilemap_flags[0] = data; + LOGMASKED(LOG_TILEMAP0, "tilemap_flags[0] = %04x\n", data); + update_tilemap_flags(0); + break; + } + case 0x102/2: m_tilemap_tile_mode[0] = data; break; case 0x104/2: m_tilemap_scrollx[0] = data; LOGMASKED(LOG_TILEMAP0, "tilemap_scrollx[0] = %04x\n", data); break; case 0x106/2: m_tilemap_scrolly[0] = data; LOGMASKED(LOG_TILEMAP0, "tilemap_scrolly[0] = %04x\n", data); break; case 0x108/2: m_tilemap_base_addr[0] = data << 1; LOGMASKED(LOG_TILEMAP0, "tilemap_base_addr[0] = %05x\n", data << 2); break; case 0x10a/2: m_tilemap_mode[0] = data; LOGMASKED(LOG_TILEMAP0, "tilemap_mode[0] = %04x\n", data); break; /* Tilemap 1 */ - case 0x120/2: m_tilemap_flags[1] = data; LOGMASKED(LOG_TILEMAP1, "tilemap_flags[1] = %04x\n", data); break; + case 0x120/2: { + m_tilemap_flags[1] = data; + LOGMASKED(LOG_TILEMAP1, "tilemap_flags[1] = %04x\n", data); + update_tilemap_flags(1); + break; + } + case 0x122/2: m_tilemap_tile_mode[1] = data; break; case 0x124/2: m_tilemap_scrollx[1] = data; LOGMASKED(LOG_TILEMAP1, "tilemap_scrollx[1] = %04x\n", data); break; case 0x126/2: m_tilemap_scrolly[1] = data; LOGMASKED(LOG_TILEMAP1, "tilemap_scrolly[1] = %04x\n", data); break; case 0x128/2: m_tilemap_base_addr[1] = data << 1; LOGMASKED(LOG_TILEMAP1, "tilemap_base_addr[1] = %05x\n", data << 2); break; case 0x12a/2: m_tilemap_mode[1] = data; LOGMASKED(LOG_TILEMAP1, "tilemap_mode[1] = %04x\n", data); break; - /* Tilemap 2? */ - case 0x140/2: m_tilemap_flags[2] = data; LOGMASKED(LOG_TILEMAP2, "tilemap_flags[2] = %04x\n", data); break; + /* Tilemap 2 */ + case 0x140/2: { + m_tilemap_flags[2] = data; + LOGMASKED(LOG_TILEMAP2, "tilemap_flags[2] = %04x\n", data); + update_tilemap_flags(2); + break; + } + case 0x142/2: m_tilemap_tile_mode[2] = data; break; case 0x144/2: m_tilemap_scrollx[2] = data; LOGMASKED(LOG_TILEMAP2, "tilemap_scrollx[2] = %04x\n", data); break; case 0x146/2: m_tilemap_scrolly[2] = data; LOGMASKED(LOG_TILEMAP2, "tilemap_scrolly[2] = %04x\n", data); break; case 0x148/2: m_tilemap_base_addr[2] = data << 1; LOGMASKED(LOG_TILEMAP2, "tilemap_base_addr[2] = %05x\n", data << 2); break; case 0x14a/2: m_tilemap_mode[2] = data; LOGMASKED(LOG_TILEMAP2, "tilemap_mode[2] = %04x\n", data); break; /* ROZ */ - case 0x180/2: m_roz_mode = data; LOGMASKED(LOG_ROZ, "roz_mode = %04x\n", data); break; + case 0x180/2: { + m_roz_mode = data; + LOGMASKED(LOG_ROZ, "roz_mode = %04x\n", data); + //update_tilemap_flags(ROZ_LAYER_NUMBER); + break; + } + case 0x182/2: m_roz_tile_mode = data; break; case 0x184/2: m_roz_scrollx = (data << 16) | (m_roz_scrollx & 0xffff); m_roz_changed |= 1; LOGMASKED(LOG_ROZ, "roz_scrollx = %08x\n", m_roz_scrollx); break; case 0x186/2: m_roz_scrollx = (data) | (m_roz_scrollx & 0xffff0000); m_roz_changed |= 1; LOGMASKED(LOG_ROZ, "roz_scrollx = %08x\n", m_roz_scrollx); break; case 0x188/2: m_roz_scrolly = (data << 16) | (m_roz_scrolly & 0xffff); m_roz_changed |= 2; LOGMASKED(LOG_ROZ, "roz_scrolly = %08x\n", m_roz_scrolly); break; @@ -2208,7 +2304,7 @@ void supracan_state::supracan(machine_config &config) SPEAKER(config, "rspeaker").front_right(); // TODO: derive and verify from U13_CLOCK - ACANSND(config, m_sound, XTAL(3'579'545)); + UMC6619_SOUND(config, m_sound, XTAL(3'579'545)); m_sound->ram_read().set(FUNC(supracan_state::sound_ram_read)); m_sound->timer_irq_handler().set(FUNC(supracan_state::sound_timer_irq)); m_sound->dma_irq_handler().set(FUNC(supracan_state::sound_dma_irq)); diff --git a/src/mame/funtech/acan.cpp b/src/mame/funtech/umc6619_sound.cpp similarity index 86% rename from src/mame/funtech/acan.cpp rename to src/mame/funtech/umc6619_sound.cpp index e92928695bc..bf847eb12c7 100644 --- a/src/mame/funtech/acan.cpp +++ b/src/mame/funtech/umc6619_sound.cpp @@ -2,23 +2,23 @@ // copyright-holders:Ryan Holtz, superctr /*************************************************************************** - Super A'Can sound driver + Super A'Can UMC 6619 sound driver Currently has a number of unknown registers and functionality. ****************************************************************************/ #include "emu.h" -#include "acan.h" +#include "umc6619_sound.h" #define VERBOSE (0) #include "logmacro.h" // device type definition -DEFINE_DEVICE_TYPE(ACANSND, acan_sound_device, "acansound", "Super A'Can Audio") +DEFINE_DEVICE_TYPE(UMC6619_SOUND, umc6619_sound_device, "umc6619_sound", "UMC UM6619 Sound Engine") -acan_sound_device::acan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, ACANSND, tag, owner, clock) +umc6619_sound_device::umc6619_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, UMC6619_SOUND, tag, owner, clock) , device_sound_interface(mconfig, *this) , m_stream(nullptr) , m_timer(nullptr) @@ -31,11 +31,11 @@ acan_sound_device::acan_sound_device(const machine_config &mconfig, const char * } -void acan_sound_device::device_start() +void umc6619_sound_device::device_start() { m_stream = stream_alloc(0, 2, clock() / 16 / 5); m_mix = std::make_unique((clock() / 16 / 5) * 2); - m_timer = timer_alloc(FUNC(acan_sound_device::channel_irq), this); + m_timer = timer_alloc(FUNC(umc6619_sound_device::channel_irq), this); // register for savestates save_item(NAME(m_active_channels)); @@ -56,18 +56,23 @@ void acan_sound_device::device_start() save_item(NAME(m_regs)); } -void acan_sound_device::device_reset() +void umc6619_sound_device::device_reset() { m_active_channels = 0; m_dma_channels = 0; std::fill(std::begin(m_regs), std::end(m_regs), 0); + for (auto &channel : m_channels) + { + channel.register9 = 0; + } + m_timer->reset(); m_timer_irq_handler(0); m_dma_irq_handler(0); } -TIMER_CALLBACK_MEMBER(acan_sound_device::channel_irq) +TIMER_CALLBACK_MEMBER(umc6619_sound_device::channel_irq) { if (m_regs[0x14] & 0x40) { @@ -79,7 +84,7 @@ TIMER_CALLBACK_MEMBER(acan_sound_device::channel_irq) } } -void acan_sound_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) +void umc6619_sound_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) { std::fill_n(&m_mix[0], outputs[0].samples() * 2, 0); @@ -130,7 +135,7 @@ void acan_sound_device::sound_stream_update(sound_stream &stream, std::vector> 4) & 0x0f; const uint8_t lower = offset & 0x0f; + m_stream->update(); m_regs[offset] = data; switch (upper) @@ -285,6 +292,10 @@ void acan_sound_device::write(offs_t offset, uint8_t data) break; } + // case 4: + // Normally 0x03 for keyon channels, 0x01 for streaming DMAs + // (staiwbbl, formduel, sangofgt) + default: LOG("Unknown sound register: %02x = %02x\n", offset, data); break; diff --git a/src/mame/funtech/acan.h b/src/mame/funtech/umc6619_sound.h similarity index 81% rename from src/mame/funtech/acan.h rename to src/mame/funtech/umc6619_sound.h index 8828768219e..d607735c7c9 100644 --- a/src/mame/funtech/acan.h +++ b/src/mame/funtech/umc6619_sound.h @@ -6,15 +6,15 @@ **********************************************************************/ -#ifndef MAME_FUNTECH_ACAN_H -#define MAME_FUNTECH_ACAN_H +#ifndef MAME_FUNTECH_UM6619_SOUND_H +#define MAME_FUNTECH_UM6619_SOUND_H #pragma once -class acan_sound_device : public device_t, public device_sound_interface +class umc6619_sound_device : public device_t, public device_sound_interface { public: - acan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + umc6619_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); auto ram_read() { return m_ram_read.bind(); } auto timer_irq_handler() { return m_timer_irq_handler.bind(); } @@ -65,6 +65,6 @@ class acan_sound_device : public device_t, public device_sound_interface std::unique_ptr m_mix; }; -DECLARE_DEVICE_TYPE(ACANSND, acan_sound_device) +DECLARE_DEVICE_TYPE(UMC6619_SOUND, umc6619_sound_device) -#endif // MAME_FUNTECH_ACAN_H +#endif // MAME_FUNTECH_UM6619_SOUND_H diff --git a/src/mame/handheld/hh_hmcs40.cpp b/src/mame/handheld/hh_hmcs40.cpp index c660da7d4eb..6aa1d9a1cb5 100644 --- a/src/mame/handheld/hh_hmcs40.cpp +++ b/src/mame/handheld/hh_hmcs40.cpp @@ -82,7 +82,7 @@ known chips: C89 HD44801 1985, CXG Portachess (1985 version) -> cxg/computachess.cpp *A86 HD44820 1983, Chess King Pocket Micro / Mighty Midget - *B46 HD44820 1984, Chess King Pocket Micro Deluxe + *B46 HD44820 1984, Chess King Pocket Micro / Mighty Midget *B63 HD44820 1985, CXG Pocket Chess (12 buttons) *A13 HD44840 1982, CXG Computachess II @@ -91,7 +91,7 @@ known chips: *B55 HD44860 1987, Saitek Pro Bridge 100 *A04 HD44868 1984, SciSys Rapier - *A07 HD44868 1984, Chess King Pocket Micro Deluxe + *A07 HD44868 1984, Chess King Pocket Micro Deluxe / Mephisto Teufelchen *A12 HD44868 1985, SciSys MK 10 / Pocket Chess / Electronic Trio *A14 HD44868 1985, SciSys Kasparov Plus *A16 HD44868 1988, Saitek Pocket Checkers diff --git a/src/mame/handheld/hh_sm510.cpp b/src/mame/handheld/hh_sm510.cpp index 62ce0ed8936..58276765dd9 100644 --- a/src/mame/handheld/hh_sm510.cpp +++ b/src/mame/handheld/hh_sm510.cpp @@ -36,7 +36,7 @@ ROM source notes when dumped from another title, but confident it's the same: gnw_mariocmt, gnw_mariocmta, gnw_mariotj, gnw_mbaway, gnw_mmousep, gnw_pinball, gnw_popeyep, gnw_sbuster, gnw_snoopyp, gnw_zelda -******************************************************************************** +================================================================================ Misc Nintendo Game & Watch notes: @@ -121,7 +121,7 @@ The "Game Watch" wristwatches are by Nelsonic, not Nintendo. Bassmate Computer (BM-501) is on identical hardware as G&W Multi Screen, but it's not part of the game series. -******************************************************************************** +================================================================================ Regarding Электроника (Elektronika, translated: Electronics): It is not actually a company. It was a USSR brand name for consumer electronics, diff --git a/src/mame/ice/lethalj.cpp b/src/mame/ice/lethalj.cpp index eb57c49fc95..92edfd4c0f9 100644 --- a/src/mame/ice/lethalj.cpp +++ b/src/mame/ice/lethalj.cpp @@ -755,7 +755,7 @@ void lethalj_state::gameroom(machine_config &config) m_maincpu->set_pixels_per_clock(1); m_maincpu->set_scanline_ind16_callback(FUNC(lethalj_state::scanline_update)); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/igs/funtech.cpp b/src/mame/igs/funtech.cpp index 52f7b709bfc..704dc57de4a 100644 --- a/src/mame/igs/funtech.cpp +++ b/src/mame/igs/funtech.cpp @@ -670,7 +670,7 @@ void fun_tech_corp_state::base(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/igs/goldstar.cpp b/src/mame/igs/goldstar.cpp index cfaa22ba198..496e346815e 100644 --- a/src/mame/igs/goldstar.cpp +++ b/src/mame/igs/goldstar.cpp @@ -7543,7 +7543,7 @@ static INPUT_PORTS_START( unkch_controls ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) /* Trips "call attendant" state if activated while credited - something to do with hopper out? */ PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("tickets", ticket_dispenser_device, line_r) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("tickets", ticket_dispenser_device, line_r) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) @@ -11225,7 +11225,7 @@ void unkch_state::unkch(machine_config &config) aysnd.add_route(ALL_OUTPUTS, "mono", 0.50); /* payout hardware */ - TICKET_DISPENSER(config, m_ticket_dispenser, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_ticket_dispenser, attotime::from_msec(200)); } void unkch_state::rolling(machine_config &config) diff --git a/src/mame/igs/igs017.cpp b/src/mame/igs/igs017.cpp index e0c4c899e78..b84ee29890f 100644 --- a/src/mame/igs/igs017.cpp +++ b/src/mame/igs/igs017.cpp @@ -3118,7 +3118,7 @@ static INPUT_PORTS_START( lhzb2 ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise @@ -3133,7 +3133,7 @@ static INPUT_PORTS_START( lhzb2a ) PORT_MODIFY("COINS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) @@ -3192,7 +3192,7 @@ static INPUT_PORTS_START( mgcs ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" ) - // Joystick mode: the top 2 bits of COINS (i8255 port A) and JOY (i8255 port B) are read and combined with the bottom 4 bits read from port C (see code at $1c83a) + // Joystick mode: the top 2 bits of COINS (port A) and JOY (port B) are read and combined with the bottom 4 bits read from port C (see code at $1c83a) PORT_START("JOY") // Joystick mode: @@ -3200,12 +3200,12 @@ static INPUT_PORTS_START( mgcs ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // take tile or throw (as N in mahjong keyboard) - // i8255 port C input is 4 bits + // Port C input is 4 bits PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) @@ -3319,7 +3319,7 @@ static INPUT_PORTS_START( sdmg2 ) PORT_DIPSETTING( 0x00, "Tile" ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除), does not work in game? PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) @@ -3536,7 +3536,7 @@ static INPUT_PORTS_START( sdmg2p ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch, TODO: verify + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch, TODO: verify INPUT_PORTS_END static INPUT_PORTS_START( mgdh ) @@ -3590,7 +3590,7 @@ static INPUT_PORTS_START( mgdh ) PORT_DIPSETTING( 0x00, "10" ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise @@ -3720,7 +3720,7 @@ static INPUT_PORTS_START( slqz2 ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise @@ -3840,7 +3840,7 @@ static INPUT_PORTS_START( tjsb ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -3934,7 +3934,7 @@ static INPUT_PORTS_START( spkrform ) PORT_START("BUTTONS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin 1 (impulse prevents coin error in gambling mode) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // coin 2 "" - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // payout PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Return To Gambling (From Formosa). Then Bet, Hold 1..5") // To switch back to poker from Formosa, start the sequence pressing this key (memory $f4a3 holds the sequence number) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // book @@ -4014,7 +4014,7 @@ static INPUT_PORTS_START( tarzan ) PORT_DIPUNUSED_DIPLOC(0x80, 0x80, "SW3:8") PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // Service PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Book PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // Coin/Key in (coin error in coin mode) @@ -4139,7 +4139,7 @@ static INPUT_PORTS_START( starzan ) PORT_DIPUNUSED_DIPLOC(0x80, 0x80, "SW3:8") PORT_START("PLAYER1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test @@ -4237,7 +4237,7 @@ static INPUT_PORTS_START( happyskl ) PORT_DIPUNUSED_DIPLOC(0x80, 0x80, "SW3:8") PORT_START("PLAYER1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effects in key test @@ -4344,7 +4344,6 @@ void igs017_state::base_machine_oki(machine_config &config, const XTAL &xtal_oki m_screen->set_palette("igs017_igs031:palette"); IGS017_IGS031(config, m_igs017_igs031, 0); - m_igs017_igs031->set_i8255_tag("ppi8255"); // sound SPEAKER(config, "mono").front_center(); @@ -4377,9 +4376,9 @@ void igs017_state::iqblocka(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::iqblocka_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("DSW3"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW3"); // protection IGS_BITSWAP(config, m_igs_bitswap, 0); @@ -4434,10 +4433,10 @@ void igs017_state::tarzan(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::tarzan_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set(FUNC(igs017_state::tarzan_keys_joy_r)); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set(FUNC(igs017_state::tarzan_keys_joy_r)); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4467,11 +4466,11 @@ void igs017_state::starzan(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::starzan_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("PLAYER1"); - m_ppi->in_pc_callback().set(FUNC(igs017_state::dsw_r)); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("PLAYER1"); + m_igs017_igs031->in_pc_callback().set(FUNC(igs017_state::dsw_r)); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4501,11 +4500,11 @@ void igs017_state::happyskl(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::happyskl_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("PLAYER1"); - m_ppi->in_pc_callback().set(FUNC(igs017_state::dsw_r)); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("PLAYER1"); + m_igs017_igs031->in_pc_callback().set(FUNC(igs017_state::dsw_r)); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // video m_igs017_igs031->set_palette_scramble_cb(FUNC(igs017_state::tarzan_palette_bitswap)); @@ -4526,11 +4525,11 @@ void igs017_state::cpoker2(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::cpoker2_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("PLAYER1"); - m_ppi->in_pc_callback().set(FUNC(igs017_state::dsw_r)); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("PLAYER1"); + m_igs017_igs031->in_pc_callback().set(FUNC(igs017_state::dsw_r)); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_INCDEC(config, m_igs_incdec, 0); @@ -4556,11 +4555,11 @@ void igs017_state::tjsb(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::tjsb_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("DSW3"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW3"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4587,11 +4586,11 @@ void igs017_state::spkrform(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::spkrform_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("DSW3"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW3"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4627,11 +4626,11 @@ void igs017_state::mgcs(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::mgcs_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set(FUNC(igs017_state::mgcs_keys_joy_r)); - m_ppi->in_pc_callback().set_ioport("JOY"); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set(FUNC(igs017_state::mgcs_keys_joy_r)); + m_igs017_igs031->in_pc_callback().set_ioport("JOY"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4661,11 +4660,11 @@ void igs017_state::lhzb2(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::lhzb2_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("DSW1"); - m_ppi->in_pc_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW2"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4700,7 +4699,7 @@ void igs017_state::lhzb2a(machine_config &config) // ppi8255 not used for i/o (just video enable)? - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4733,11 +4732,11 @@ void igs017_state::slqz2(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::slqz2_mux_map); - m_ppi->in_pa_callback().set_ioport("COINS"); - m_ppi->in_pb_callback().set_ioport("DSW1"); - m_ppi->in_pc_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pa_callback().set_ioport("COINS"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW2"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_STRING(config, m_igs_string, 0); @@ -4762,11 +4761,11 @@ void igs017_state::sdmg2(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::sdmg2_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); // DSW3 is read but unused (it's not populated on the PCB) - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); // protection IGS_INCDEC(config, m_igs_incdec, 0); @@ -4797,9 +4796,9 @@ void igs017_state::mgdha(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::mgdha_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); } void igs017_state::mgdh(machine_config &config) @@ -4823,11 +4822,11 @@ void igs017_state::sdmg2p(machine_config &config) // i/o m_igs_mux->set_addrmap(0, &igs017_state::sdmg2p_mux_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("DSW3"); // there are 3 DIP banks on PCB but only two are shown in test mode + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("DSW3"); // there are 3 DIP banks on PCB but only two are shown in test mode - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(50)); IGS_STRING(config, m_igs_string, 0); } diff --git a/src/mame/igs/igs017_igs031.cpp b/src/mame/igs/igs017_igs031.cpp index f87555753d9..a64308a6161 100644 --- a/src/mame/igs/igs017_igs031.cpp +++ b/src/mame/igs/igs017_igs031.cpp @@ -22,7 +22,7 @@ void igs017_igs031_device::map(address_map &map) map(0x1800, 0x1bff).ram().w(FUNC(igs017_igs031_device::palram_w)).share("palram"); map(0x1c00, 0x1fff).ram(); - map(0x2010, 0x2013).r(FUNC(igs017_igs031_device::i8255_r)); + map(0x2010, 0x2012).r(FUNC(igs017_igs031_device::input_port_r)); map(0x2012, 0x2012).w(FUNC(igs017_igs031_device::video_disable_w)); map(0x2014, 0x2014).w(FUNC(igs017_igs031_device::nmi_enable_w)); @@ -32,13 +32,9 @@ void igs017_igs031_device::map(address_map &map) map(0x6000, 0x7fff).ram().w(FUNC(igs017_igs031_device::bg_w)).share("bg_videoram"); } -u8 igs017_igs031_device::i8255_r(offs_t offset) +u8 igs017_igs031_device::input_port_r(offs_t offset) { - if (m_i8255) - return m_i8255->read(offset); - - logerror("igs017_igs031_device::i8255_r(%02x) with no 8255 device\n", offset); - return 0; + return m_input_port_cb[offset](); } @@ -68,11 +64,11 @@ igs017_igs031_device::igs017_igs031_device(const machine_config &mconfig, const , device_memory_interface(mconfig, *this) , m_palette_scramble_cb(*this, FUNC(igs017_igs031_device::palette_callback_straight)) , m_space_config("igs017_igs031", ENDIANNESS_BIG, 8,15, 0, address_map_constructor(FUNC(igs017_igs031_device::map), this)) + , m_input_port_cb(*this, 0xff) , m_spriteram(*this, "spriteram") , m_fg_videoram(*this, "fg_videoram") , m_bg_videoram(*this, "bg_videoram") , m_palram(*this, "palram") - , m_i8255(*this, finder_base::DUMMY_TAG) , m_palette(*this, "palette") , m_revbits(false) { diff --git a/src/mame/igs/igs017_igs031.h b/src/mame/igs/igs017_igs031.h index 037456870f3..2083e1829a7 100644 --- a/src/mame/igs/igs017_igs031.h +++ b/src/mame/igs/igs017_igs031.h @@ -5,7 +5,6 @@ #pragma once -#include "machine/i8255.h" #include "emupal.h" #include "tilemap.h" @@ -20,7 +19,9 @@ class igs017_igs031_device : igs017_igs031_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - template void set_i8255_tag(T &&tag) { m_i8255.set_tag(std::forward(tag)); } + auto in_pa_callback() { return m_input_port_cb[0].bind(); } + auto in_pb_callback() { return m_input_port_cb[1].bind(); } + auto in_pc_callback() { return m_input_port_cb[2].bind(); } template void set_palette_scramble_cb(T &&... args) { m_palette_scramble_cb.set(std::forward(args)...); } void set_text_reverse_bits(bool revbits) @@ -28,20 +29,23 @@ class igs017_igs031_device : m_revbits = revbits; } - u16 palette_callback_straight(u16 bgr) const; - - void map(address_map &map); - u8 read(offs_t offset); void write(offs_t offset, u8 data); bool get_nmi_enable() { return m_nmi_enable; } bool get_irq_enable() { return m_irq_enable; } +private: + u16 palette_callback_straight(u16 bgr) const; + + void map(address_map &map); + void palram_w(offs_t offset, u8 data); - u8 i8255_r(offs_t offset); + u8 input_port_r(offs_t offset); void video_disable_w(u8 data); + void nmi_enable_w(u8 data); + void irq_enable_w(u8 data); TILE_GET_INFO_MEMBER(get_fg_tile_info); TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -53,9 +57,9 @@ class igs017_igs031_device : void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, int offsx, int offsy, int dimx, int dimy, int flipx, int flipy, u32 color, u32 addr); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); int debug_viewer(bitmap_ind16 &bitmap, const rectangle &cliprect); + +public: u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void nmi_enable_w(u8 data); - void irq_enable_w(u8 data); virtual void video_start(); void lhzb2_decrypt_tiles(); @@ -71,7 +75,6 @@ class igs017_igs031_device : void starzan_decrypt_sprites(size_t max_size, size_t flip_size); void tjsb_decrypt_sprites(); - protected: virtual void device_add_mconfig(machine_config &config) override; virtual void device_start() override; @@ -86,11 +89,12 @@ class igs017_igs031_device : address_space_config m_space_config; + devcb_read8::array<3> m_input_port_cb; + required_shared_ptr m_spriteram; required_shared_ptr m_fg_videoram; required_shared_ptr m_bg_videoram; required_shared_ptr m_palram; - optional_device m_i8255; required_device m_palette; // the gfx roms were often hooked up with the bits backwards, allow us to handle it here to save doing it in every driver. diff --git a/src/mame/igs/igs_fear.cpp b/src/mame/igs/igs_fear.cpp index 774db87e6c6..00b81b770ad 100644 --- a/src/mame/igs/igs_fear.cpp +++ b/src/mame/igs/igs_fear.cpp @@ -783,7 +783,7 @@ void igs_fear_state::igs_fear(machine_config &config) V3021(config, "rtc"); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index d879675c011..def2669e40f 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -1,8 +1,8 @@ // license:BSD-3-Clause -// copyright-holders: Xing Xing, David Haywood +// copyright-holders: XingXing, David Haywood /* IGS ARM7 (IGS027A) based Mahjong / Gambling platform(s) - Driver by Xing Xing + Driver by XingXing These games use the IGS027A processor. @@ -19,8 +19,7 @@ TODO: * NVRAM - * Inputs and DIP switches for most games - * Hopper for payout + * Inputs, DIP switches, coin counters and payout systems for most games * Coin lockout (zhongguo displays a coin error on unexpected coins) */ @@ -35,6 +34,7 @@ #include "machine/i8255.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "machine/timer.h" #include "sound/okim6295.h" @@ -46,6 +46,9 @@ #include +#include "jking02.lh" +#include "oceanpar.lh" + namespace { @@ -61,18 +64,23 @@ class igs_m027_state : public driver_device m_igs017_igs031(*this, "igs017_igs031"), m_screen(*this, "screen"), m_oki(*this, "oki"), + m_hopper(*this, "hopper"), + m_ticket(*this, "ticket"), m_io_kbd(*this, "KEY%u", 0U), m_io_dsw(*this, "DSW%u", 1U), - m_io_test(*this, "TEST") + m_out_lamps(*this, "lamp%u", 1U) { } void m027(machine_config &config) ATTR_COLD; void m027_xor(machine_config &config) ATTR_COLD; + void slqz3_xor(machine_config &config) ATTR_COLD; + void jking02_xor(machine_config &config) ATTR_COLD; void lhdmg_xor(machine_config &config) ATTR_COLD; void lhzb4_xor(machine_config &config) ATTR_COLD; void lthy_xor(machine_config &config) ATTR_COLD; void zhongguo_xor(machine_config &config) ATTR_COLD; void mgzz_xor(machine_config &config) ATTR_COLD; + void oceanpar_xor(machine_config &config) ATTR_COLD; void extradraw(machine_config &config) ATTR_COLD; void init_sdwx() ATTR_COLD; @@ -104,14 +112,19 @@ class igs_m027_state : public driver_device private: required_region_ptr m_external_rom; optional_shared_ptr m_igs_mainram; + required_device m_maincpu; required_device m_ppi; required_device m_igs017_igs031; required_device m_screen; required_device m_oki; + optional_device m_hopper; + optional_device m_ticket; + optional_ioport_array<5> m_io_kbd; optional_ioport_array<3> m_io_dsw; - optional_ioport m_io_test; + + output_finder<16> m_out_lamps; u32 m_xor_table[0x100]; u8 m_io_select[2]; @@ -126,7 +139,11 @@ class igs_m027_state : public driver_device void xor_table_w(offs_t offset, u8 data); - u8 test_r(); + template void lamps_w(u8 data); + void mahjong_output_w(u8 data); + void jking02_output_w(u8 data); + void oceanpar_output_w(u8 data); + u32 unk2_r(); u32 lhdmg_unk2_r(); void unk2_w(u32 data); @@ -137,16 +154,15 @@ class igs_m027_state : public driver_device void igs_mahjong_map(address_map &map) ATTR_COLD; void igs_mahjong_xor_map(address_map &map) ATTR_COLD; + void jking02_xor_map(address_map &map) ATTR_COLD; void lhdmg_xor_map(address_map &map) ATTR_COLD; - void lhzb4_xor_map(address_map &map) ATTR_COLD; - void lthy_xor_map(address_map &map) ATTR_COLD; - void zhongguo_xor_map(address_map &map) ATTR_COLD; - void mgzz_xor_map(address_map &map) ATTR_COLD; void extradraw_map(address_map &map) ATTR_COLD; }; void igs_m027_state::machine_start() { + m_out_lamps.resolve(); + std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0); std::fill(std::begin(m_io_select), std::end(m_io_select), 0xff); m_unk2_write_count = 0; @@ -178,9 +194,9 @@ void igs_m027_state::igs_mahjong_map(address_map &map) map(0x38000000, 0x38007fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); map(0x38008000, 0x38008003).umask32(0x000000ff).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x38009000, 0x38009003).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x40000008, 0x4000000b).w(FUNC(igs_m027_state::unk2_w)); - map(0x4000000c, 0x4000000f).r(FUNC(igs_m027_state::unk2_r)); map(0x40000018, 0x4000001b).umask32(0x000000ff).w(FUNC(igs_m027_state::io_select_w<1>)); map(0x50000000, 0x500003ff).umask32(0x000000ff).w(FUNC(igs_m027_state::xor_table_w)); // uploads XOR table to external ROM here @@ -195,43 +211,18 @@ void igs_m027_state::igs_mahjong_xor_map(address_map &map) map(0x08000000, 0x0807ffff).r(FUNC(igs_m027_state::external_rom_r)); // Game ROM } -void igs_m027_state::lhdmg_xor_map(address_map &map) -{ - igs_mahjong_xor_map(map); - - map(0x38009000, 0x38009003).umask32(0x000000ff).r(FUNC(igs_m027_state::test_r)); - map(0x38009000, 0x38009003).umask32(0x0000ff00).w(FUNC(igs_m027_state::io_select_w<0>)); -} - -void igs_m027_state::lhzb4_xor_map(address_map &map) -{ - igs_mahjong_xor_map(map); - - map(0x38009000, 0x38009003).umask32(0x000000ff).r(FUNC(igs_m027_state::test_r)); - map(0x38009000, 0x38009003).umask32(0x00ff0000).w(FUNC(igs_m027_state::io_select_w<0>)); -} - -void igs_m027_state::lthy_xor_map(address_map &map) -{ - igs_mahjong_xor_map(map); - - map(0x38009000, 0x38009003).umask32(0x000000ff).r(FUNC(igs_m027_state::test_r)); - map(0x38009000, 0x38009003).umask32(0x0000ff00).r(NAME((&igs_m027_state::kbd_r<1, 0, 2>))); -} - -void igs_m027_state::zhongguo_xor_map(address_map &map) +void igs_m027_state::jking02_xor_map(address_map &map) { igs_mahjong_xor_map(map); - map(0x38009000, 0x38009003).umask32(0x0000ff00).r(NAME((&igs_m027_state::kbd_r<1, 0, 2>))); + map(0x4000000c, 0x4000000f).portr("PLAYER"); } -void igs_m027_state::mgzz_xor_map(address_map &map) +void igs_m027_state::lhdmg_xor_map(address_map &map) { igs_mahjong_xor_map(map); - map(0x38009000, 0x38009003).umask32(0x0000ff00).r(FUNC(igs_m027_state::test_r)); - map(0x38009000, 0x38009003).umask32(0x00ff0000).r(NAME((&igs_m027_state::kbd_r<1, 0, 2>))); + map(0x4000000c, 0x4000000f).r(FUNC(igs_m027_state::lhdmg_unk2_r)); } void igs_m027_state::extradraw_map(address_map &map) @@ -340,7 +331,7 @@ INPUT_PORTS_START( mahjong ) PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 查帐 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // TODO: default assignment clashes with mahjong I, using it hangs waiting for hopper to respond + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // TODO: default assignment clashes with mahjong I PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END @@ -363,10 +354,42 @@ INPUT_PORTS_START( mahjong_joy ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END -INPUT_PORTS_START( jking02 ) - PORT_INCLUDE(base) +INPUT_PORTS_START( three_reel ) + PORT_START("PORTB") + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Call Attendant") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_MODIFY("DSW1") + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + PORT_BIT( 0x1e, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HPSW + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PLAYER") + PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_COIN1 ) // COINA + PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Stop All Reels / Big") + PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Double Up") + PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Small") + PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Take Score") + PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") + PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Ticket") // TICKET + PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) // TKSW + PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN2 ) // COINC + PORT_BIT( 0xfffe0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + +INPUT_PORTS_START( jking02 ) + PORT_START("DSW1") PORT_DIPNAME( 0x1f, 0x1f, "ID Number") PORT_DIPLOCATION("SW1:1,2,3,4,5") PORT_DIPSETTING( 0x1f, "1" ) PORT_DIPSETTING( 0x1e, "2" ) @@ -400,15 +423,17 @@ INPUT_PORTS_START( jking02 ) PORT_DIPSETTING( 0x02, "20" ) PORT_DIPSETTING( 0x01, "20" ) PORT_DIPSETTING( 0x00, "20" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) PORT_DIPNAME( 0x80, 0x80, "PC Board Mode" ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x80, "Single" ) PORT_DIPSETTING( 0x00, "Linking" ) - PORT_MODIFY("DSW2") - PORT_DIPNAME( 0x01, 0x00, "Wiring Diagram" ) PORT_DIPLOCATION("SW2:1") // only 28-pin is supported for now + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Wiring Diagram" ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, "36+10" ) PORT_DIPSETTING( 0x00, "28-pin" ) - PORT_DIPNAME( 0x02, 0x02, "Odds Table" ) PORT_DIPLOCATION("SW2:2") + PORT_DIPNAME( 0x02, 0x00, "Odds Table" ) PORT_DIPLOCATION("SW2:2") PORT_DIPSETTING( 0x02, DEF_STR(No) ) PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:3") @@ -430,7 +455,7 @@ INPUT_PORTS_START( jking02 ) PORT_DIPSETTING( 0x80, DEF_STR(Normal) ) PORT_DIPSETTING( 0x00, "Auto" ) - PORT_MODIFY("DSW3") + PORT_START("DSW3") PORT_DIPNAME( 0x03, 0x03, "Score Box" ) PORT_DIPLOCATION("SW3:1,2") PORT_DIPSETTING( 0x03, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) @@ -447,19 +472,49 @@ INPUT_PORTS_START( jking02 ) PORT_DIPSETTING( 0x20, "Legend" ) // characters from Journey to the West PORT_DIPSETTING( 0x10, "Both" ) // seems to do the same thing as "Fruit" PORT_DIPSETTING( 0x00, "Both" ) // seems to do the same thing as "Fruit" + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) - PORT_MODIFY("PORTB") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_NAME("Stop Reel 4 / Double Up") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // also provides access to game setup (coinage, etc.) - PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) // shows DIP switch settings - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Small") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Big") - - PORT_MODIFY("PORTC") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Take Score") + PORT_START("PORTB") + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) // shows DIP switch settings + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) // also provides access to game setup (coinage, etc.) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Stop Reel 4 / Double Up") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) // also provides access to game setup (coinage, etc.) + PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) // shows DIP switch settings + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Stop Reel 3 / Small") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Stop Reel 2 / Big") + + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Play") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x78, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Stop Reel 1 / Take Score") + + PORT_START("PLAYER") + PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 4 / Start") + PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop All Reels / Big") + PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 2 / Double Up") + PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 3 / Small") + PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 1 / Take Score") + PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Play") + PORT_BIT( 0x000007f8, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x0007f800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0xfff00000, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END INPUT_PORTS_START( qlgs ) @@ -474,6 +529,9 @@ INPUT_PORTS_END INPUT_PORTS_START( lhdmg ) PORT_INCLUDE(mahjong) + PORT_MODIFY("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 + PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW1:1,2") // 投币比率 PORT_DIPSETTING( 0x03, DEF_STR(1C_1C) ) @@ -589,6 +647,9 @@ INPUT_PORTS_END INPUT_PORTS_START( lthy ) PORT_INCLUDE(mahjong_joy) + PORT_MODIFY("TEST") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_START("DSW1") PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No." ) PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副机编号 PORT_DIPSETTING( 0x1f, "1" ) @@ -649,6 +710,9 @@ INPUT_PORTS_END INPUT_PORTS_START( zhongguo ) PORT_INCLUDE(mahjong_joy) + PORT_MODIFY("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 + PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW1:1,2") // 投币比率 PORT_DIPSETTING( 0x03, DEF_STR(1C_1C) ) @@ -709,6 +773,7 @@ INPUT_PORTS_START( mgzz ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // TODO: default assignment clashes with mahjong I, using it hangs waiting for hopper to respond PORT_MODIFY("TEST") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_START("DSW1") @@ -758,6 +823,83 @@ INPUT_PORTS_START( mgzza ) PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) // not shown in test mode INPUT_PORTS_END +INPUT_PORTS_START( oceanpara ) + PORT_INCLUDE( three_reel ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x01, DEF_STR(On) ) + PORT_DIPNAME( 0x02, 0x02, "Non-Stop" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x02, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x04, 0x04, "Record Password" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x04, DEF_STR(Yes) ) + PORT_DIPNAME( 0x08, 0x08, "Odds Table" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, DEF_STR(No) ) + PORT_DIPSETTING( 0x08, DEF_STR(Yes) ) + PORT_DIPNAME( 0x10, 0x10, "Auto Take" ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x10, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x20, 0x20, "Double-Up Game" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x20, DEF_STR(On) ) + PORT_DIPNAME( 0xc0, 0xc0, "Double-Up Game Type" ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0xc0, "Poker 1" ) + PORT_DIPSETTING( 0x80, "Poker 2" ) + PORT_DIPSETTING( 0x40, "Symbol" ) + PORT_DIPSETTING( 0x00, "Symbol" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "Chance Level" ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x01, DEF_STR(Low) ) + PORT_DIPSETTING( 0x00, DEF_STR(High) ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + +INPUT_PORTS_START( oceanpar ) + PORT_INCLUDE( oceanpara ) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x06, 0x06, "Score Box" ) PORT_DIPLOCATION("SW2:2,3") + PORT_DIPSETTING( 0x06, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPSETTING( 0x02, "10 Times" ) + PORT_DIPSETTING( 0x00, "10 Times" ) + PORT_DIPNAME( 0x08, 0x08, "Play Score" ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) +INPUT_PORTS_END + +INPUT_PORTS_START( fruitpara ) + PORT_INCLUDE( oceanpara ) + + PORT_MODIFY("DSW2") + PORT_DIPNAME( 0x02, 0x02, "Score Box" ) PORT_DIPLOCATION("SW2:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x04, "Play Score" ) PORT_DIPLOCATION("SW2:3") + PORT_DIPSETTING( 0x04, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) +INPUT_PORTS_END + INPUT_PORTS_START( amazonia ) PORT_INCLUDE(base) @@ -888,9 +1030,62 @@ void igs_m027_state::xor_table_w(offs_t offset, u8 data) // I/O? maybe serial? -u8 igs_m027_state::test_r() +template +void igs_m027_state::lamps_w(u8 data) +{ + // active high outputs + // +------+-------------------------------+---------------+ + // | lamp | jking02 | oceanpar | + // | +---------------+---------------+ | + // | | 36+10 | 28-Pin | | + // +------+---------------+---------------+---------------+ + // | 1 | stop 4/start | | start | + // | 2 | stop 3/small | | stop 2/small | + // | 3 | bet | | bet | + // | 4 | stop 1/take | | stop 3/take | + // | 5 | stop 2/double | | stop 1/double | + // | 6 | stop all/big | | stop all/big | + // | 7 | | | | + // | 8 | | | | + // | 9 | | bet | | + // | 10 | | start | | + // | 11 | | | | + // | 12 | | stop 1/take | | + // | 13 | | stop 2/big | | + // | 14 | | stop 4/double | | + // | 15 | | stop 3/small | | + // | 16 | | | | + // +------+---------------+---------------+---------------+ + for (unsigned i = 0; 8 > i; ++i) + m_out_lamps[Start + i] = BIT(data, i); +} + +void igs_m027_state::mahjong_output_w(u8 data) +{ + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // one pulse per coin accepted or key-in + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); // one pulse per coin paid out by key-out + if (m_hopper) + m_hopper->motor_w(BIT(data, 2)); +} + +void igs_m027_state::jking02_output_w(u8 data) +{ + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // one pulse per coin 1 accepted (36+10) + machine().bookkeeping().coin_counter_w(2, BIT(data, 1)); // one pulse per key-in accepted (36+10 + machine().bookkeeping().coin_counter_w(1, BIT(data, 3)); // one pulse per key-in accepted (36+10) + machine().bookkeeping().coin_counter_w(3, BIT(data, 4)); // one pulse per key-out (36+10) + machine().bookkeeping().coin_counter_w(4, BIT(data, 5)); // one pulse per coin accepted (28-pin) + machine().bookkeeping().coin_counter_w(5, BIT(data, 6)); // one pulse per key-out (28-pin) + // no key-in counter for 28-pin wiring diagram? +} + +void igs_m027_state::oceanpar_output_w(u8 data) { - return m_io_test->read(); + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // one pulse per COINA accepted + machine().bookkeeping().coin_counter_w(2, BIT(data, 1)); // one pulse per KEYIN accepted + machine().bookkeeping().coin_counter_w(1, BIT(data, 2)); // one pulse per COINC accepted + machine().bookkeeping().coin_counter_w(3, BIT(data, 6)); // one pulse per KEYOUT + m_hopper->motor_w(BIT(data, 7)); } u32 igs_m027_state::unk2_r() @@ -939,13 +1134,15 @@ void igs_m027_state::m027(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(igs_m027_state::interrupt), "screen", 0, 1); I8255A(config, m_ppi); - m_ppi->in_pa_callback().set(NAME((&igs_m027_state::dsw_r<1, 0>))); - m_ppi->in_pb_callback().set_ioport("PORTB"); - m_ppi->in_pc_callback().set_ioport("PORTC"); + m_ppi->tri_pa_callback().set_constant(0x00); + m_ppi->tri_pb_callback().set_constant(0x00); + m_ppi->tri_pc_callback().set_constant(0x00); IGS017_IGS031(config, m_igs017_igs031, 0); m_igs017_igs031->set_text_reverse_bits(true); - m_igs017_igs031->set_i8255_tag("ppi8255"); + m_igs017_igs031->in_pa_callback().set(NAME((&igs_m027_state::dsw_r<1, 0>))); + m_igs017_igs031->in_pb_callback().set_ioport("PORTB"); + m_igs017_igs031->in_pc_callback().set_ioport("PORTC"); // sound hardware SPEAKER(config, "mono").front_center(); @@ -959,59 +1156,101 @@ void igs_m027_state::m027_xor(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::igs_mahjong_xor_map); } +void igs_m027_state::slqz3_xor(machine_config &config) +{ + m027_xor(config); + + // TODO: PPI port A = input, port B = input, port C = output +} + +void igs_m027_state::jking02_xor(machine_config &config) +{ + m027_xor(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::jking02_xor_map); + + m_ppi->out_pa_callback().set(FUNC(igs_m027_state::lamps_w<8>)); + m_ppi->out_pb_callback().set(FUNC(igs_m027_state::jking02_output_w)); + m_ppi->out_pc_callback().set(FUNC(igs_m027_state::lamps_w<0>)); +} + void igs_m027_state::lhdmg_xor(machine_config &config) { m027_xor(config); m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::lhdmg_xor_map); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set(NAME((&igs_m027_state::kbd_r<0, 3, 0>))); + m_ppi->in_pa_callback().set_ioport("TEST"); + m_ppi->out_pb_callback().set(FUNC(igs_m027_state::io_select_w<0>)); + m_ppi->out_pc_callback().set(FUNC(igs_m027_state::mahjong_output_w)); + + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set(NAME((&igs_m027_state::kbd_r<0, 3, 0>))); + + HOPPER(config, m_hopper, attotime::from_msec(50)); } void igs_m027_state::lhzb4_xor(machine_config &config) { m027_xor(config); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::lhzb4_xor_map); + //m_ppi->out_pa_callback().set(...); + //m_ppi->out_pb_callback().set(...); + m_ppi->out_pc_callback().set(FUNC(igs_m027_state::io_select_w<0>)); - m_ppi->in_pa_callback().set(NAME((&igs_m027_state::dsw_r<1, 0>))); - m_ppi->in_pb_callback().set_ioport("TEST"); - m_ppi->in_pc_callback().set_ioport("JOY"); + m_igs017_igs031->in_pa_callback().set(NAME((&igs_m027_state::dsw_r<1, 0>))); + m_igs017_igs031->in_pb_callback().set_ioport("TEST"); + m_igs017_igs031->in_pc_callback().set_ioport("JOY"); } void igs_m027_state::lthy_xor(machine_config &config) { m027_xor(config); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::lthy_xor_map); + m_ppi->in_pa_callback().set_ioport("TEST"); + m_ppi->in_pb_callback().set(NAME((&igs_m027_state::kbd_r<1, 0, 2>))); + m_ppi->out_pc_callback().set(FUNC(igs_m027_state::mahjong_output_w)); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("JOY"); + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("JOY"); } void igs_m027_state::zhongguo_xor(machine_config &config) +{ + lthy_xor(config); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + +void igs_m027_state::mgzz_xor(machine_config &config) { m027_xor(config); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::zhongguo_xor_map); + m_ppi->out_pa_callback().set(FUNC(igs_m027_state::mahjong_output_w)); + m_ppi->in_pb_callback().set_ioport("TEST"); + m_ppi->in_pc_callback().set(NAME((&igs_m027_state::kbd_r<1, 0, 2>))); + + m_igs017_igs031->in_pa_callback().set_ioport("DSW1"); + m_igs017_igs031->in_pb_callback().set_ioport("DSW2"); + m_igs017_igs031->in_pc_callback().set_ioport("JOY"); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("JOY"); + HOPPER(config, m_hopper, attotime::from_msec(50)); } -void igs_m027_state::mgzz_xor(machine_config &config) +void igs_m027_state::oceanpar_xor(machine_config &config) { m027_xor(config); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::mgzz_xor_map); + m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::jking02_xor_map); + + m_ppi->out_pa_callback().set(m_ticket, FUNC(ticket_dispenser_device::motor_w)).bit(7); + m_ppi->out_pb_callback().set(FUNC(igs_m027_state::oceanpar_output_w)); + m_ppi->out_pc_callback().set(FUNC(igs_m027_state::lamps_w<0>)); - m_ppi->in_pa_callback().set_ioport("DSW1"); - m_ppi->in_pb_callback().set_ioport("DSW2"); - m_ppi->in_pc_callback().set_ioport("JOY"); + HOPPER(config, m_hopper, attotime::from_msec(50)); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); } void igs_m027_state::extradraw(machine_config &config) @@ -1110,76 +1349,76 @@ IGS PCB-0331-02-FG ***************************************************************************/ -ROM_START( fruitpar ) +ROM_START( oceanpar ) // IGS PCB-0331-02-FG ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "q5_027a.bin", 0x00000, 0x4000, CRC(df756ac3) SHA1(5b5d2a7f6363260166e3411d1571056cc30a5e56) ) + ROM_LOAD( "b1_027a.bin", 0x00000, 0x4000, CRC(e64a01a0) SHA1(22f2afbe1fc66c3c9e6d5d87c98b0974615b8a20) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg - ROM_LOAD( "fruit_paradise_v214.u23", 0x00000, 0x80000, CRC(e37bc4e0) SHA1(f5580e6007dc60f32efd3b3e7e64c5ee446ede8a) ) + ROM_LOAD( "ocean_paradise_v105us.u23", 0x00000, 0x80000, CRC(e6eb66c3) SHA1(f6c1e31ccddc8ebb8218f52b5c0d97f0797b2e84) ) ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) + ROM_LOAD16_WORD_SWAP( "ocean_paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx), same as fruitpar ROM_REGION( 0x80000, "oki", 0 ) - ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) + ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) // same as fruitpar ROM_END -ROM_START( fruitpara ) +ROM_START( oceanpara ) // IGS PCB-0331-01-FG ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "q5_027a.bin", 0x00000, 0x4000, CRC(df756ac3) SHA1(5b5d2a7f6363260166e3411d1571056cc30a5e56) ) + ROM_LOAD( "b1_027a.bin", 0x00000, 0x4000, CRC(e64a01a0) SHA1(22f2afbe1fc66c3c9e6d5d87c98b0974615b8a20) ) - ROM_REGION32_LE( 0x80000, "user1", ROMREGION_ERASEFF ) - ROM_LOAD( "f paradise v-206us.u23", 0x00000, 0x80000, CRC(ee2fa627) SHA1(6e964213e17d7db021ec63c7a1af08f863483369) ) + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "ocean_paradise_v101us.u23", 0x00000, 0x80000, CRC(4f2bf87a) SHA1(559c8728632336ba84f455ac22b6e514967c644b) ) ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) + ROM_LOAD16_WORD_SWAP( "ocean_paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx), same as fruitpar ROM_REGION( 0x80000, "oki", 0 ) - ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) + ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) // same as fruitpar ROM_END -ROM_START( oceanpar ) // IGS PCB-0331-02-FG +ROM_START( fruitpar ) // IGS PCB-0331-02-FG ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "b1_027a.bin", 0x00000, 0x4000, CRC(e64a01a0) SHA1(22f2afbe1fc66c3c9e6d5d87c98b0974615b8a20) ) + ROM_LOAD( "q5_027a.bin", 0x00000, 0x4000, CRC(df756ac3) SHA1(5b5d2a7f6363260166e3411d1571056cc30a5e56) ) ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg - ROM_LOAD( "ocean_paradise_v105us.u23", 0x00000, 0x80000, CRC(e6eb66c3) SHA1(f6c1e31ccddc8ebb8218f52b5c0d97f0797b2e84) ) + ROM_LOAD( "fruit_paradise_v214.u23", 0x00000, 0x80000, CRC(e37bc4e0) SHA1(f5580e6007dc60f32efd3b3e7e64c5ee446ede8a) ) ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "ocean_paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) + ROM_LOAD16_WORD_SWAP( "paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx), same as fruitpar + ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_REGION( 0x80000, "oki", 0 ) - ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) // same as fruitpar + ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) ROM_END -ROM_START( oceanpara ) // IGS PCB-0331-01-FG +ROM_START( fruitpara ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU - ROM_LOAD( "b1_027a.bin", 0x00000, 0x4000, CRC(e64a01a0) SHA1(22f2afbe1fc66c3c9e6d5d87c98b0974615b8a20) ) + ROM_LOAD( "q5_027a.bin", 0x00000, 0x4000, CRC(df756ac3) SHA1(5b5d2a7f6363260166e3411d1571056cc30a5e56) ) - ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg - ROM_LOAD( "ocean_paradise_v101us.u23", 0x00000, 0x80000, CRC(4f2bf87a) SHA1(559c8728632336ba84f455ac22b6e514967c644b) ) + ROM_REGION32_LE( 0x80000, "user1", ROMREGION_ERASEFF ) + ROM_LOAD( "f paradise v-206us.u23", 0x00000, 0x80000, CRC(ee2fa627) SHA1(6e964213e17d7db021ec63c7a1af08f863483369) ) ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) - ROM_LOAD16_WORD_SWAP( "ocean_paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) + ROM_LOAD16_WORD_SWAP( "paradise_text.u12", 0x000000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx), same as fruitpar + ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx) ROM_REGION( 0x80000, "oki", 0 ) - ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) // same as fruitpar + ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) ) ROM_END // supposedly a reskin of fruitpar / oceanpar, runs on a slightly different PCB (type not readable, seems same as amazonkp) @@ -1999,6 +2238,9 @@ void igs_m027_state::init_slqz3() { slqz3_decrypt(machine()); m_igs017_igs031->set_text_reverse_bits(false); + + // what lives here? + m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000000c, 0x4000000f, read32smo_delegate(*this, FUNC(igs_m027_state::unk2_r))); } void igs_m027_state::init_fruitpar() @@ -2089,7 +2331,6 @@ void igs_m027_state::init_lhdmg() { lhdmg_decrypt(machine()); m_igs017_igs031->set_text_reverse_bits(false); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000000c, 0x4000000f, read32smo_delegate(*this, FUNC(igs_m027_state::lhdmg_unk2_r))); } } // anonymous namespace @@ -2102,35 +2343,35 @@ void igs_m027_state::init_lhdmg() ***************************************************************************/ // Complete dumps -GAME( 1999, slqz3, 0, m027_xor, base, igs_m027_state, init_slqz3, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 3 (China, VS107C)", MACHINE_NOT_WORKING ) -GAME( 1999, qlgs, 0, m027_xor, qlgs, igs_m027_state, init_qlgs, ROT0, "IGS", "Que Long Gao Shou", MACHINE_NOT_WORKING ) -GAME( 1999, fruitpar, 0, m027_xor, base, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V214)", MACHINE_NOT_WORKING ) -GAME( 1999, fruitpara, fruitpar, m027_xor, base, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V206US)", MACHINE_NOT_WORKING ) -GAME( 1999, lhdmg, 0, lhdmg_xor, lhdmg, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Manguan", MACHINE_NOT_WORKING ) // 龙虎大满贯 -GAME( 1999, lhdmgp, lhdmg, lhdmg_xor, lhdmg, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Manguan Plus", MACHINE_NOT_WORKING ) // 龙虎大满贯 -GAME( 1999, lhzb3, 0, lhdmg_xor, lhzb3, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Zhengba III", MACHINE_NOT_WORKING ) // 龙虎争霸Ⅲ -GAME( 2004, lhzb4, 0, lhzb4_xor, lhzb4, igs_m027_state, init_lhzb4, ROT0, "IGS", "Long Hu Zhengba 4", MACHINE_NOT_WORKING ) // 龙虎争霸4 -GAME( 1999, lthy, 0, lthy_xor, lthy, igs_m027_state, init_lthy, ROT0, "IGS", "Long Teng Hu Yue", MACHINE_NOT_WORKING ) // 龙腾虎跃 -GAME( 2000, zhongguo, 0, zhongguo_xor, zhongguo, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D", MACHINE_NOT_WORKING ) // 中国锄大D -GAME( 200?, jking02, 0, m027_xor, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NOT_WORKING ) -GAME( 2003, mgzz, 0, mgzz_xor, mgzz, igs_m027_state, init_mgzz, ROT0, "IGS", "Man Guan Zhi Zun (V101CN)", MACHINE_NOT_WORKING ) -GAME( 2000, mgzza, mgzz, mgzz_xor, mgzza, igs_m027_state, init_mgzz, ROT0, "IGS", "Man Guan Zhi Zun (V100CN)", MACHINE_NOT_WORKING ) -GAME( 2007, mgcs3, 0, m027_xor, base, igs_m027_state, init_mgcs3, ROT0, "IGS", "Man Guan Caishen 3 (V101CN)", MACHINE_NOT_WORKING ) -GAME( 1999, oceanpar, 0, m027_xor, base, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V105US)", MACHINE_NOT_WORKING ) // 1999 copyright in ROM -GAME( 1999, oceanpara, oceanpar, m027_xor, base, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V101US)", MACHINE_NOT_WORKING ) // 1999 copyright in ROM -GAME( 200?, cjddz, 0, m027_xor, base, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu", MACHINE_NOT_WORKING ) // 超级斗地主 -GAME( 200?, extradrw, 0, extradraw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw", MACHINE_NOT_WORKING ) +GAME( 1999, slqz3, 0, slqz3_xor, base, igs_m027_state, init_slqz3, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 3 (China, VS107C)", MACHINE_NOT_WORKING ) +GAME( 1999, qlgs, 0, m027_xor, qlgs, igs_m027_state, init_qlgs, ROT0, "IGS", "Que Long Gao Shou", MACHINE_NOT_WORKING ) +GAME( 1999, lhdmg, 0, lhdmg_xor, lhdmg, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Manguan", MACHINE_NOT_WORKING ) // 龙虎大满贯 +GAME( 1999, lhdmgp, lhdmg, lhdmg_xor, lhdmg, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Da Manguan Plus", MACHINE_NOT_WORKING ) // 龙虎大满贯 +GAME( 1999, lhzb3, 0, lhdmg_xor, lhzb3, igs_m027_state, init_lhdmg, ROT0, "IGS", "Long Hu Zhengba III", MACHINE_NOT_WORKING ) // 龙虎争霸Ⅲ +GAME( 2004, lhzb4, 0, lhzb4_xor, lhzb4, igs_m027_state, init_lhzb4, ROT0, "IGS", "Long Hu Zhengba 4", MACHINE_NOT_WORKING ) // 龙虎争霸4 +GAME( 1999, lthy, 0, lthy_xor, lthy, igs_m027_state, init_lthy, ROT0, "IGS", "Long Teng Hu Yue", MACHINE_NOT_WORKING ) // 龙腾虎跃 +GAME( 2000, zhongguo, 0, zhongguo_xor, zhongguo, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D", MACHINE_NOT_WORKING ) // 中国锄大D +GAMEL( 200?, jking02, 0, jking02_xor, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NOT_WORKING, layout_jking02 ) +GAME( 2003, mgzz, 0, mgzz_xor, mgzz, igs_m027_state, init_mgzz, ROT0, "IGS", "Man Guan Zhi Zun (V101CN)", MACHINE_NOT_WORKING ) +GAME( 2000, mgzza, mgzz, mgzz_xor, mgzza, igs_m027_state, init_mgzz, ROT0, "IGS", "Man Guan Zhi Zun (V100CN)", MACHINE_NOT_WORKING ) +GAME( 2007, mgcs3, 0, m027_xor, base, igs_m027_state, init_mgcs3, ROT0, "IGS", "Man Guan Caishen 3 (V101CN)", MACHINE_NOT_WORKING ) +GAMEL( 1999, oceanpar, 0, oceanpar_xor, oceanpar, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V105US)", MACHINE_NOT_WORKING, layout_oceanpar ) // 1999 copyright in ROM +GAMEL( 1999, oceanpara, oceanpar, oceanpar_xor, oceanpara,igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V101US)", MACHINE_NOT_WORKING, layout_oceanpar ) // 1999 copyright in ROM +GAMEL( 1999, fruitpar, 0, oceanpar_xor, oceanpar, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V214)", MACHINE_NOT_WORKING, layout_oceanpar ) +GAMEL( 1999, fruitpara, fruitpar, oceanpar_xor, fruitpara,igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V206US)", MACHINE_NOT_WORKING, layout_oceanpar ) +GAME( 200?, cjddz, 0, m027_xor, base, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu", MACHINE_NOT_WORKING ) // 超级斗地主 +GAME( 200?, extradrw, 0, extradraw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw", MACHINE_NOT_WORKING ) // these have an IGS025 protection device instead of the 8255 -GAME( 2002, chessc2, 0, m027_xor, base, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II", MACHINE_NOT_WORKING ) +GAME( 2002, chessc2, 0, m027_xor, base, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II", MACHINE_NOT_WORKING ) // Incomplete dumps -GAME( 1999, amazonia, 0, m027, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_NOT_WORKING ) -GAME( 1999, amazonkp, amazonia, m027, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King Plus (V204BR)", MACHINE_NOT_WORKING ) -GAME( 2005, olympic5, 0, m027, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V112US)", MACHINE_NOT_WORKING ) // IGS FOR V112US 2005 02 14 -GAME( 2003, olympic5a, olympic5, m027, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V107US)", MACHINE_NOT_WORKING ) // IGS FOR V107US 2003 10 2 -GAME( 200?, luckycrs, 0, m027, base, igs_m027_state, init_luckycrs, ROT0, "IGS", "Lucky Cross (V106SA)", MACHINE_NOT_WORKING ) -GAME( 2003, amazoni2, 0, m027, base, igs_m027_state, init_amazoni2, ROT0, "IGS", "Amazonia King II (V202BR)", MACHINE_NOT_WORKING ) -GAME( 2002, sdwx, 0, m027, base, igs_m027_state, init_sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", MACHINE_NOT_WORKING ) // aka Christmas 5 Line? (or Amazonia King II, shares roms at least?) -GAME( 200?, klxyj, 0, m027, base, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuai Le Xi You Ji", MACHINE_NOT_WORKING ) +GAME( 1999, amazonia, 0, m027, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_NOT_WORKING ) +GAME( 1999, amazonkp, amazonia, m027, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King Plus (V204BR)", MACHINE_NOT_WORKING ) +GAME( 2005, olympic5, 0, m027, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V112US)", MACHINE_NOT_WORKING ) // IGS FOR V112US 2005 02 14 +GAME( 2003, olympic5a, olympic5, m027, base, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V107US)", MACHINE_NOT_WORKING ) // IGS FOR V107US 2003 10 2 +GAME( 200?, luckycrs, 0, m027, base, igs_m027_state, init_luckycrs, ROT0, "IGS", "Lucky Cross (V106SA)", MACHINE_NOT_WORKING ) +GAME( 2003, amazoni2, 0, m027, base, igs_m027_state, init_amazoni2, ROT0, "IGS", "Amazonia King II (V202BR)", MACHINE_NOT_WORKING ) +GAME( 2002, sdwx, 0, m027, base, igs_m027_state, init_sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", MACHINE_NOT_WORKING ) // aka Christmas 5 Line? (or Amazonia King II, shares roms at least?) +GAME( 200?, klxyj, 0, m027, base, igs_m027_state, init_klxyj, ROT0, "IGS", "Kuai Le Xi You Ji", MACHINE_NOT_WORKING ) // these have an IGS025 protection device instead of the 8255 -GAME( 200?, gonefsh2, 0, m027, base, igs_m027_state, init_gonefsh2, ROT0, "IGS", "Gone Fishing 2", MACHINE_NOT_WORKING ) +GAME( 200?, gonefsh2, 0, m027, base, igs_m027_state, init_gonefsh2, ROT0, "IGS", "Gone Fishing 2", MACHINE_NOT_WORKING ) diff --git a/src/mame/igs/igs_m027_link.cpp b/src/mame/igs/igs_m027_link.cpp index 943637a5399..17cfa3fe7c2 100644 --- a/src/mame/igs/igs_m027_link.cpp +++ b/src/mame/igs/igs_m027_link.cpp @@ -127,7 +127,6 @@ IGS PCB 0199-03 (both games same PCB#) #include "cpu/arm7/arm7.h" #include "cpu/arm7/arm7core.h" #include "cpu/m68000/m68000.h" -#include "machine/i8255.h" #include "machine/nvram.h" #include "machine/timer.h" #include "sound/okim6295.h" @@ -197,6 +196,10 @@ void host_state::host_map(address_map &map) { map(0x00000000, 0x00003fff).rom(); // Internal ROM map(0x08000000, 0x0800ffff).rom().region("user1", 0); // Game ROM (does it really map here? it appears to be connected indirectly via the 025) + + // TODO: IGS025? + //map(0x28007000, 0x28007000).w(m_igs_mux, FUNC(igs_mux_device::address_w)); + //map(0x28007001, 0x28007001).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)); } void extension_state::cjsll_map(address_map &map) @@ -344,11 +347,8 @@ void extension_state::cjsll(machine_config &config) IGS025(config, "igs025", 0); - I8255A(config, "ppi"); - IGS017_IGS031(config, m_igs017_igs031, 0); m_igs017_igs031->set_text_reverse_bits(true); - m_igs017_igs031->set_i8255_tag("ppi"); SPEAKER(config, "mono").front_center(); diff --git a/src/mame/igs/igs_m027xa.cpp b/src/mame/igs/igs_m027xa.cpp index 327f3999eb6..48502ab3134 100644 --- a/src/mame/igs/igs_m027xa.cpp +++ b/src/mame/igs/igs_m027xa.cpp @@ -104,6 +104,7 @@ void igs_m027xa_state::igs_mahjong_map(address_map &map) map(0x18000000, 0x18007fff).ram(); map(0x38000000, 0x38007fff).rw(m_igs017_igs031, FUNC(igs017_igs031_device::read), FUNC(igs017_igs031_device::write)); + map(0x38009000, 0x38009003).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x4000000c, 0x4000000f).r(FUNC(igs_m027xa_state::rnd_r)); map(0x58000000, 0x580000ff).ram(); // XA? @@ -158,13 +159,13 @@ void igs_m027xa_state::igs_mahjong_xa(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(igs_m027xa_state::interrupt), "screen", 0, 1); I8255A(config, m_ppi); - m_ppi->in_pa_callback().set_ioport("TEST0"); - m_ppi->in_pb_callback().set_ioport("TEST1"); - m_ppi->in_pc_callback().set_ioport("TEST2"); + // crzybugs: PPI port A = input, port B = output, port C = output IGS017_IGS031(config, m_igs017_igs031, 0); m_igs017_igs031->set_text_reverse_bits(true); - m_igs017_igs031->set_i8255_tag("ppi8255"); + m_igs017_igs031->in_pa_callback().set_ioport("TEST0"); + m_igs017_igs031->in_pb_callback().set_ioport("TEST1"); + m_igs017_igs031->in_pc_callback().set_ioport("TEST2"); // sound hardware // OK6295 diff --git a/src/mame/itech/capbowl.cpp b/src/mame/itech/capbowl.cpp index b666e1cfbd1..31b2718ab23 100644 --- a/src/mame/itech/capbowl.cpp +++ b/src/mame/itech/capbowl.cpp @@ -584,7 +584,7 @@ void capbowl_base_state::base(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_RANDOM); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(100)); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -604,7 +604,7 @@ void capbowl_base_state::base(machine_config &config) ym2203_device &ymsnd(YM2203(config, "ymsnd", XTAL(8'000'000) / 2)); ymsnd.irq_handler().set_inputline(m_audiocpu, M6809_FIRQ_LINE); - ymsnd.port_a_read_callback().set("ticket", FUNC(ticket_dispenser_device::line_r)).lshift(7); + ymsnd.port_a_read_callback().set("ticket", FUNC(ticket_dispenser_device::line_r)).invert().lshift(7); ymsnd.port_b_write_callback().set("ticket", FUNC(ticket_dispenser_device::motor_w)).bit(7); // Also a status LED. See memory map above ymsnd.add_route(0, "speaker", 0.07); ymsnd.add_route(1, "speaker", 0.07); diff --git a/src/mame/itech/itech32.cpp b/src/mame/itech/itech32.cpp index 24ea102e505..7e9f78e0d55 100644 --- a/src/mame/itech/itech32.cpp +++ b/src/mame/itech/itech32.cpp @@ -1775,7 +1775,7 @@ void itech32_state::base_devices(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set_inputline(m_soundcpu, INPUT_LINE_IRQ0); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); WATCHDOG_TIMER(config, "watchdog"); diff --git a/src/mame/itech/itech8.cpp b/src/mame/itech/itech8.cpp index a520136364c..9522701bdaa 100644 --- a/src/mame/itech/itech8.cpp +++ b/src/mame/itech/itech8.cpp @@ -1721,7 +1721,7 @@ void itech8_state::itech8_core_devices(machine_config &config) { NVRAM(config, m_nvram, nvram_device::DEFAULT_RANDOM); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); TLC34076(config, m_tlc34076, tlc34076_device::TLC34076_6_BIT); @@ -1795,7 +1795,7 @@ void itech8_state::itech8_sound_ym3812(machine_config &config) m_soundcpu->set_addrmap(AS_PROGRAM, &itech8_state::sound3812_map); pia6821_device &pia(PIA6821(config, "pia")); - pia.readpb_handler().set("ticket", FUNC(ticket_dispenser_device::line_r)); + pia.readpb_handler().set("ticket", FUNC(ticket_dispenser_device::line_r)).invert(); pia.writepa_handler().set(FUNC(itech8_state::pia_porta_out)); pia.writepb_handler().set(FUNC(itech8_state::pia_portb_out)); diff --git a/src/mame/jaleco/cischeat.cpp b/src/mame/jaleco/cischeat.cpp index 6ab604cd0f9..49801edfd7b 100644 --- a/src/mame/jaleco/cischeat.cpp +++ b/src/mame/jaleco/cischeat.cpp @@ -2369,7 +2369,7 @@ void captflag_state::captflag(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &captflag_state::captflag_map); TIMER(config, "scantimer").configure_scanline(FUNC(captflag_state::captflag_scanline), "screen", 0, 1); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000)); WATCHDOG_TIMER(config, m_watchdog); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); diff --git a/src/mame/konami/konamigs.cpp b/src/mame/konami/konamigs.cpp index 49ce4bafb0f..acc77078d70 100644 --- a/src/mame/konami/konamigs.cpp +++ b/src/mame/konami/konamigs.cpp @@ -129,21 +129,21 @@ class gsan_state : public driver_device void fill_quad(u16 cmd, u16 *data); void draw_line(u16 cmd, u16 *data); - int m_dbmode; - bool m_fg16bit; - bool m_bg16bit; - bool m_rend16bit; - bool m_width1024; - bool m_rsae; - bool m_vbkem; - s16 m_xo; - s16 m_yo; - s16 m_uxmin; - s16 m_uxmax; - s16 m_uymin; - s16 m_uymax; - s16 m_sxmax; - s16 m_symax; + int m_dbmode = 0; + bool m_fg16bit = false; + bool m_bg16bit = false; + bool m_rend16bit = false; + bool m_width1024 = false; + bool m_rsae = false; + bool m_vbkem = false; + s16 m_xo = 0; + s16 m_yo = 0; + s16 m_uxmin = 0; + s16 m_uxmax = 0; + s16 m_uymin = 0; + s16 m_uymax = 0; + s16 m_sxmax = 0; + s16 m_symax = 0; u32 get_rend_offset() { @@ -272,7 +272,7 @@ void gsan_state::portc_w(u64 data) */ m_portc_data = data; - machine().bookkeeping().coin_counter_w(0, ~data & 8); + machine().bookkeeping().coin_counter_w(0, BIT(~data, 3)); } void gsan_state::portc_medal_w(u64 data) { @@ -284,10 +284,10 @@ void gsan_state::portc_medal_w(u64 data) */ m_portc_data = data; - m_hopper->motor_w(data & 0x80); - machine().bookkeeping().coin_counter_w(0, data & 4); - machine().bookkeeping().coin_counter_w(1, data & 2); - machine().bookkeeping().coin_counter_w(2, data & 1); + m_hopper->motor_w(BIT(~data, 7)); + machine().bookkeeping().coin_counter_w(0, BIT(data, 2)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); + machine().bookkeeping().coin_counter_w(2, BIT(data, 0)); } u64 gsan_state::porte_r() { @@ -315,9 +315,9 @@ void gsan_state::porte_medal_w(u64 data) */ m_porte_data = data; - machine().bookkeeping().coin_lockout_w(0, data & 4); - machine().bookkeeping().coin_lockout_w(1, data & 2); - machine().bookkeeping().coin_lockout_w(2, data & 1); + machine().bookkeeping().coin_lockout_w(0, BIT(data, 2)); + machine().bookkeeping().coin_lockout_w(1, BIT(data, 1)); + machine().bookkeeping().coin_lockout_w(2, BIT(data, 0)); } @@ -1081,7 +1081,7 @@ void gsan_state::gs_medal(machine_config &config) m_screen->set_raw(XTAL(36'000'000) / 5, 457, 0, 320, 262, 0, 240); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); } void gsan_state::init_gsan() diff --git a/src/mame/konami/konmedal.cpp b/src/mame/konami/konmedal.cpp index df505156dfc..1f2b2a84d11 100644 --- a/src/mame/konami/konmedal.cpp +++ b/src/mame/konami/konmedal.cpp @@ -832,7 +832,7 @@ void konmedal_state::tsukande(machine_config &config) NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); m_nvram->set_custom_handler(FUNC(konmedal_state::medal_nvram_init)); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); K053252(config, m_k053252, XTAL(14'318'181) / 2); // not verified m_k053252->int1_ack().set(FUNC(konmedal_state::vbl_ack_w)); @@ -875,7 +875,7 @@ void konmedal_state::ddboy(machine_config &config) NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); m_nvram->set_custom_handler(FUNC(konmedal_state::medal_nvram_init)); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); K053252(config, m_k053252, XTAL(14'318'181) / 2); // not verified m_k053252->int1_ack().set(FUNC(konmedal_state::vbl_ack_w)); @@ -1019,7 +1019,7 @@ void konmedal_state::shuriboy(machine_config &config) NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); m_nvram->set_custom_handler(FUNC(konmedal_state::shuriboy_nvram_init)); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // everything not verified, just a placeholder diff --git a/src/mame/konami/konmedal68k.cpp b/src/mame/konami/konmedal68k.cpp index 217fe15ba5d..86a307a6d2a 100644 --- a/src/mame/konami/konmedal68k.cpp +++ b/src/mame/konami/konmedal68k.cpp @@ -21,16 +21,18 @@ ***************************************************************************/ #include "emu.h" +#include "k054156_k054157_k056832.h" +#include "k055555.h" +#include "konami_helper.h" + #include "cpu/m68000/m68000.h" #include "machine/eepromser.h" #include "machine/gen_latch.h" #include "machine/nvram.h" -#include "machine/timer.h" #include "machine/ticket.h" +#include "machine/timer.h" #include "sound/ymz280b.h" -#include "k054156_k054157_k056832.h" -#include "k055555.h" -#include "konami_helper.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -640,7 +642,7 @@ void konmedal68k_state::kzaurus(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &konmedal68k_state::kzaurus_main); TIMER(config, "scantimer").configure_scanline(FUNC(konmedal68k_state::scanline), "screen", 0, 1); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, "hopper", attotime::from_msec(100)); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/konami/piratesh.cpp b/src/mame/konami/piratesh.cpp index 8eb9c253f25..34c88249028 100644 --- a/src/mame/konami/piratesh.cpp +++ b/src/mame/konami/piratesh.cpp @@ -610,8 +610,8 @@ void piratesh_state::piratesh(machine_config &config) K053252(config, m_k053252, XTAL(32'000'000)/4); m_k053252->set_offsets(40, 16); // TODO - TICKET_DISPENSER(config, "ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, "hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(200)); + HOPPER(config, "hopper", attotime::from_msec(200)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/konami/quickpick5.cpp b/src/mame/konami/quickpick5.cpp index 502c7548a04..fa2f174723b 100644 --- a/src/mame/konami/quickpick5.cpp +++ b/src/mame/konami/quickpick5.cpp @@ -22,16 +22,18 @@ ***************************************************************************/ #include "emu.h" -#include "cpu/z80/z80.h" -#include "machine/eepromser.h" -#include "sound/k051649.h" -#include "sound/okim6295.h" #include "k053244_k053245.h" #include "konami_helper.h" + +#include "cpu/z80/z80.h" +#include "machine/eepromser.h" #include "machine/k053252.h" #include "machine/nvram.h" #include "machine/ticket.h" #include "machine/timer.h" +#include "sound/k051649.h" +#include "sound/okim6295.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -384,7 +386,7 @@ static INPUT_PORTS_START( quickpick5 ) PORT_START("IN1") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_SERVICE1) - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_SERVICE_NO_TOGGLE(0x08, IP_ACTIVE_LOW) PORT_BIT(0xd0, IP_ACTIVE_LOW, IPT_UNUSED) @@ -495,7 +497,7 @@ INPUT_PORTS_END // 3 4 2-3 2-4 3-4 Start static INPUT_PORTS_START( waijockey ) PORT_START("IN1") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_SERVICE_NO_TOGGLE(0x02, IP_ACTIVE_LOW) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) // * B16 PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN1) PORT_NAME("Medal") @@ -587,7 +589,7 @@ void quickpick5_state::quickpick5(machine_config &config) Z80(config, m_maincpu, XTAL(32'000'000)/4); // z84c0008pec 8mhz part, 32Mhz xtal verified on PCB, divisor unknown m_maincpu->set_addrmap(AS_PROGRAM, &quickpick5_state::quickpick5_main); TIMER(config, "scantimer").configure_scanline(FUNC(quickpick5_state::scanline), "screen", 0, 1); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, "hopper", attotime::from_msec(100)); K053252(config, m_k053252, XTAL(32'000'000)/4); /* K053252, xtal verified, divider not verified */ m_k053252->int1_ack().set(FUNC(quickpick5_state::vbl_ack_w)); diff --git a/src/mame/layout/jking02.lay b/src/mame/layout/jking02.lay new file mode 100644 index 00000000000..3190c7b762a --- /dev/null +++ b/src/mame/layout/jking02.lay @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/oceanpar.lay b/src/mame/layout/oceanpar.lay new file mode 100644 index 00000000000..d6b302518b8 --- /dev/null +++ b/src/mame/layout/oceanpar.lay @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index ca355381e66..f715fbebb03 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -18168,6 +18168,7 @@ fscc12a // @source:fidelity/sc6.cpp classic +classica fscc6 gambitv miniscc diff --git a/src/mame/midway/williams.cpp b/src/mame/midway/williams.cpp index 2b9a1754e85..4af46e955db 100644 --- a/src/mame/midway/williams.cpp +++ b/src/mame/midway/williams.cpp @@ -1777,10 +1777,10 @@ void williams_state::lottofun(machine_config &config) williams_b1(config); // pia - m_pia[0]->writepb_handler().set("ticket", FUNC(ticket_dispenser_device::motor_w)).bit(7); + m_pia[0]->writepb_handler().set("ticket", FUNC(ticket_dispenser_device::motor_w)).bit(7).invert(); m_pia[0]->ca2_handler().set([this](int state) { machine().bookkeeping().coin_lockout_global_w(state); }); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(70), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(70)); } diff --git a/src/mame/misc/amusco.cpp b/src/mame/misc/amusco.cpp index 3b29e01c5fc..e63b7af6beb 100644 --- a/src/mame/misc/amusco.cpp +++ b/src/mame/misc/amusco.cpp @@ -280,7 +280,7 @@ void amusco_state::output_b_w(uint8_t data) m_lamps[6] = BIT(data, 2); // Lamp 6 (Start/Draw) m_lamps[7] = BIT(data, 1); // Lamp 7 (Unknown) - m_pit->write_gate0(!BIT(data, 4)); + m_pit->write_gate0(BIT(~data, 4)); // logerror("Writing %02Xh to PPI output B\n", data); } @@ -300,8 +300,8 @@ void amusco_state::output_c_w(uint8_t data) if (!data) return; - machine().bookkeeping().coin_counter_w(0, !BIT(data, 1)); - m_hopper->motor_w(BIT(data, 4)); + machine().bookkeeping().coin_counter_w(0, BIT(~data, 1)); + m_hopper->motor_w(BIT(~data, 4)); // logerror("Writing %02Xh to PPI output C\n", data); } @@ -574,7 +574,7 @@ void amusco_state::amusco(machine_config &config) i8155b.in_pc_callback().set(m_rtc, FUNC(msm5832_device::data_r)); i8155b.out_pc_callback().set(m_rtc, FUNC(msm5832_device::data_w)); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(30), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(30)); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/misc/babysuprem.cpp b/src/mame/misc/babysuprem.cpp index e81e92f8c58..04924ffaa51 100644 --- a/src/mame/misc/babysuprem.cpp +++ b/src/mame/misc/babysuprem.cpp @@ -183,9 +183,9 @@ void bsuprem_state::bsuprem(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper_5, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, m_hopper_25, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, m_hopper_100, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper_5, attotime::from_msec(50)); + HOPPER(config, m_hopper_25, attotime::from_msec(50)); + HOPPER(config, m_hopper_100, attotime::from_msec(50)); // Sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/misc/calomega.cpp b/src/mame/misc/calomega.cpp index 265bf736932..77c99dcf019 100644 --- a/src/mame/misc/calomega.cpp +++ b/src/mame/misc/calomega.cpp @@ -4648,7 +4648,7 @@ void calomega_state::sys903(machine_config &config) TIMER(config, "timer_0").configure_periodic(FUNC(calomega_state::timer_0), attotime::from_hz(550*2)); // (time*2) - Each timer pulse -> half period - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + HOPPER(config, m_hopper, attotime::from_msec(50)); } @@ -4726,7 +4726,7 @@ void calomega_state::sys903kb(machine_config &config) TIMER(config, "timer_0").configure_periodic(FUNC(calomega_state::timer_0), attotime::from_hz(550*2)); // (time*2) - Each timer pulse -> half period - HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + HOPPER(config, m_hopper, attotime::from_msec(50)); } diff --git a/src/mame/misc/clpoker.cpp b/src/mame/misc/clpoker.cpp index cc23208fe26..3ed3421ad95 100644 --- a/src/mame/misc/clpoker.cpp +++ b/src/mame/misc/clpoker.cpp @@ -138,7 +138,7 @@ static INPUT_PORTS_START( clpoker ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -268,7 +268,7 @@ void clpoker_state::clpoker(machine_config &config) ppi_inputs.in_pb_callback().set_ioport("INB"); ppi_inputs.in_pc_callback().set_ioport("INC"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(60), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(60)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); // wrong diff --git a/src/mame/misc/dcheese.cpp b/src/mame/misc/dcheese.cpp index b6855b1367e..8981ac991ec 100644 --- a/src/mame/misc/dcheese.cpp +++ b/src/mame/misc/dcheese.cpp @@ -237,7 +237,7 @@ static INPUT_PORTS_START( dcheese ) PORT_START("240000") PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */ - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* sound->main buffer status (0=empty) */ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -287,7 +287,7 @@ static INPUT_PORTS_START( lottof2 ) PORT_START("240000") PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */ - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* sound->main buffer status (0=empty) */ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -335,7 +335,7 @@ static INPUT_PORTS_START( fredmem ) PORT_START("240000") PORT_BIT( 0x001f, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* low 5 bits read as a unit */ - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* sound->main buffer status (0=empty) */ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -388,7 +388,7 @@ void dcheese_state::dcheese(machine_config &config) EEPROM_93C46_16BIT(config, "eeprom"); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(200)); WATCHDOG_TIMER(config, "watchdog"); diff --git a/src/mame/misc/gei.cpp b/src/mame/misc/gei.cpp index a06d3112eed..964851f5b5f 100644 --- a/src/mame/misc/gei.cpp +++ b/src/mame/misc/gei.cpp @@ -1059,7 +1059,7 @@ void gei_state::getrivia(machine_config &config) m_ppi[1]->out_pb_callback().set(FUNC(gei_state::lamps_w)); m_ppi[1]->out_pc_callback().set(FUNC(gei_state::lamps2_w)); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100)); // sound hardware SPEAKER(config, "speaker").front_center(); diff --git a/src/mame/misc/gi6809.cpp b/src/mame/misc/gi6809.cpp index 3d3ed95d32b..7fab0573163 100644 --- a/src/mame/misc/gi6809.cpp +++ b/src/mame/misc/gi6809.cpp @@ -635,7 +635,7 @@ void gi6809_state::gi6809_base(machine_config &config) NETLIST_LOGIC_INPUT(config, "sound_nl:bit3", "PA3.IN", 0); NETLIST_STREAM_OUTPUT(config, "sound_nl:cout0", 0, "OUTPUT").set_mult_offset(1.0, 0.0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); } diff --git a/src/mame/misc/interflip8035.cpp b/src/mame/misc/interflip8035.cpp index eb309639040..fb38dbf4ea1 100644 --- a/src/mame/misc/interflip8035.cpp +++ b/src/mame/misc/interflip8035.cpp @@ -1237,7 +1237,7 @@ void interflip8035_state::interflip(machine_config &config) add_em_reels(config, 20, attotime::from_double(2)); // hopper device - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); // sound stuff SPEAKER(config, "mono").front_center(); diff --git a/src/mame/misc/jackhouse.cpp b/src/mame/misc/jackhouse.cpp index 1f04ebded66..7a93eb6b913 100644 --- a/src/mame/misc/jackhouse.cpp +++ b/src/mame/misc/jackhouse.cpp @@ -707,7 +707,7 @@ void jackhouse_state::jackhouse(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_jackhouse); config.set_default_layout(layout_jackhouse); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); SPEAKER(config, "speaker").front_center(); diff --git a/src/mame/misc/kingpin.cpp b/src/mame/misc/kingpin.cpp index f3a72a58b26..21760e2de58 100644 --- a/src/mame/misc/kingpin.cpp +++ b/src/mame/misc/kingpin.cpp @@ -176,7 +176,7 @@ static INPUT_PORTS_START( kingpin ) PORT_START("IN1") PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Quit") PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Odd") - PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) @@ -240,7 +240,7 @@ void kingpin_state::kingpin(machine_config &config) AY8912(config, "aysnd", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.50); - HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, "hopper", attotime::from_msec(100)); config.set_default_layout(layout_kingpin); } diff --git a/src/mame/misc/kurukuru.cpp b/src/mame/misc/kurukuru.cpp index 33c92289a28..809506d5f19 100644 --- a/src/mame/misc/kurukuru.cpp +++ b/src/mame/misc/kurukuru.cpp @@ -450,9 +450,6 @@ class kurukuru_state : public driver_device #define YM2149_CLOCK MAIN_CLOCK/6/2 // '/SEL' pin tied to GND, so internal divisor x2 is active #define M5205_CLOCK XTAL(384'000) -#define HOPPER_PULSE 50 // time between hopper pulses in milliseconds -#define VDP_MEM 0x30000 - /************************************************* * Interrupts * @@ -861,11 +858,11 @@ void kurukuru_state::kurukuru(machine_config &config) // video hardware v9938_device &v9938(V9938(config, "v9938", MAIN_CLOCK)); v9938.set_screen_ntsc("screen"); - v9938.set_vram_size(VDP_MEM); + v9938.set_vram_size(0x30000); v9938.int_cb().set_inputline("maincpu", 0); SCREEN(config, "screen", SCREEN_TYPE_RASTER); - TICKET_DISPENSER(config, "hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "hopper", attotime::from_msec(50)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/misc/magic10.cpp b/src/mame/misc/magic10.cpp index 54934856a26..7d6959c3951 100644 --- a/src/mame/misc/magic10.cpp +++ b/src/mame/misc/magic10.cpp @@ -984,8 +984,8 @@ void magic10_state::magic10(machine_config &config) // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &magic10_state::magic10_map); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(6), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); - HOPPER(config, m_hopper, attotime::from_msec(20), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(6)); + HOPPER(config, m_hopper, attotime::from_msec(20)); } @@ -1044,7 +1044,7 @@ void spetrix_state::spetrix(machine_config &config) { base(config); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(6), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(6)); m_maincpu->set_addrmap(AS_PROGRAM, &spetrix_state::spetrix_map); m_maincpu->set_vblank_int("screen", FUNC(spetrix_state::irq2_line_hold)); // L1 interrupts diff --git a/src/mame/misc/mgavegas.cpp b/src/mame/misc/mgavegas.cpp index 1bf8796d99f..90b5e3e00e1 100644 --- a/src/mame/misc/mgavegas.cpp +++ b/src/mame/misc/mgavegas.cpp @@ -459,7 +459,7 @@ static INPUT_PORTS_START( mgavegas ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) // 25 ptas in to play PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) // 100ptas in for change with 4 25 ptas coins PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) - PORT_BIT( 0x10, IP_ACTIVE_LOW,IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Y) PORT_NAME("25 ptas level") //"hack" hopper always full PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_U) PORT_NAME("Door") PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I) PORT_NAME("Channel") @@ -510,7 +510,7 @@ void mgavegas_state::mgavegas(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - TICKET_DISPENSER(config, "hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "hopper", attotime::from_msec(200)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/misc/mjsenpu.cpp b/src/mame/misc/mjsenpu.cpp index 7493f7dff58..14714516cc9 100644 --- a/src/mame/misc/mjsenpu.cpp +++ b/src/mame/misc/mjsenpu.cpp @@ -43,10 +43,12 @@ *********************************************************************/ #include "emu.h" + #include "cpu/e132xs/e132xs.h" #include "machine/nvram.h" #include "machine/ticket.h" #include "sound/okim6295.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -72,6 +74,11 @@ class mjsenpu_state : public driver_device void init_mjsenpu(); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + private: /* devices */ required_device m_maincpu; @@ -80,9 +87,9 @@ class mjsenpu_state : public driver_device required_shared_ptr m_mainram; // required_shared_ptr m_vram; - uint8_t m_pal[0x200]; - uint32_t m_vram0[0x20000 / 4]; - uint32_t m_vram1[0x20000 / 4]; + uint8_t m_pal[0x200] = { }; + uint32_t m_vram0[0x20000 / 4] = { }; + uint32_t m_vram1[0x20000 / 4] = { }; uint8_t m_control = 0; uint8_t m_mux = 0; @@ -102,9 +109,6 @@ class mjsenpu_state : public driver_device uint32_t vram_r(offs_t offset); void vram_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; uint32_t screen_update_mjsenpu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_palette; @@ -163,15 +167,15 @@ void mjsenpu_state::control_w(uint8_t data) // bit 0x20 not used? // bit 0x10 is the M6295 bank, samples <26 are the same in both banks and so bank switch isn't written for them, not even in sound test. - m_oki->set_rom_bank((data&0x10)>>4); + m_oki->set_rom_bank(BIT(data, 4)); // bits 0x08 is used in the alt payout / hopper mode (see dipswitches) // 0x04 seem to be hopper/ticket related? different ones get used depending on the dips - m_hopper->motor_w(data & 0x04); + m_hopper->motor_w(BIT(~data, 2)); // bit 0x02 could be coin counter? - machine().bookkeeping().coin_counter_w(0, data & 0x02 ); + machine().bookkeeping().coin_counter_w(0, BIT(data, 1)); // bit 0x01 alternates frequently, using as video buffer, but that's a complete guess m_control = data; @@ -471,7 +475,7 @@ void mjsenpu_state::mjsenpu(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); // more likely coins out? - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/misc/mpu12wbk.cpp b/src/mame/misc/mpu12wbk.cpp index 56940b7621f..1c9875b17a2 100644 --- a/src/mame/misc/mpu12wbk.cpp +++ b/src/mame/misc/mpu12wbk.cpp @@ -962,7 +962,7 @@ void mpu12wbk_state::mpu12wbk(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); NVRAM(config, "nvram2", nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + HOPPER(config, m_hopper, attotime::from_msec(100)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/misc/multfish.cpp b/src/mame/misc/multfish.cpp index 11a39c5f46b..1e1b9a9ab8d 100644 --- a/src/mame/misc/multfish.cpp +++ b/src/mame/misc/multfish.cpp @@ -1080,7 +1080,7 @@ void igrosoft_gamble_state::igrosoft_gamble(machine_config &config) AY8910(config, "aysnd", 6000000/4).add_route(ALL_OUTPUTS, "mono", 0.30); M48T35(config, m_m48t35, 0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); } void igrosoft_gamble_state::rollfr(machine_config &config) diff --git a/src/mame/misc/piggypas.cpp b/src/mame/misc/piggypas.cpp index 9f18a22de7f..8e420e7861c 100644 --- a/src/mame/misc/piggypas.cpp +++ b/src/mame/misc/piggypas.cpp @@ -235,7 +235,7 @@ void piggypas_state::piggypas(machine_config &config) ppi.out_pb_callback().set(FUNC(piggypas_state::ctrl_w)); ppi.in_pc_callback().set_ioport("IN0"); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(100)); } void piggypas_state::fidlstix(machine_config &config) diff --git a/src/mame/misc/skylncr.cpp b/src/mame/misc/skylncr.cpp index 19e24ccf161..adb00ceb027 100644 --- a/src/mame/misc/skylncr.cpp +++ b/src/mame/misc/skylncr.cpp @@ -134,9 +134,6 @@ namespace { -#define HOPPER_PULSE 50 // guessed - - class skylncr_state : public driver_device { public: @@ -1689,7 +1686,7 @@ void skylncr_state::skylncr(machine_config &config) ppi1.in_pb_callback().set_ioport("IN3"); ppi1.in_pc_callback().set_ioport("IN4"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // duration guessed // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/misc/tapatune.cpp b/src/mame/misc/tapatune.cpp index 1e89dc53368..113879c45af 100644 --- a/src/mame/misc/tapatune.cpp +++ b/src/mame/misc/tapatune.cpp @@ -37,12 +37,14 @@ ****************************************************************************/ #include "emu.h" + #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/nvram.h" #include "machine/ticket.h" #include "sound/bsmt2000.h" #include "video/mc6845.h" + #include "screen.h" #include "speaker.h" @@ -70,6 +72,10 @@ class tapatune_state : public driver_device void tapatune(machine_config &config); void tapatune_base(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: required_device m_maincpu; optional_device m_videocpu; @@ -77,22 +83,19 @@ class tapatune_state : public driver_device optional_shared_ptr m_videoram; - uint8_t m_paletteram[0x300]{}; - uint16_t m_palette_write_addr = 0; - rgb_t m_pens[0x100]; - uint8_t m_controls_mux = 0; - uint8_t m_z80_to_68k_index = 0; - uint8_t m_z80_to_68k_data = 0; - uint8_t m_68k_to_z80_index = 0; - uint8_t m_68k_to_z80_data = 0; - uint8_t m_z80_data_available = 0; - uint8_t m_68k_data_available = 0; - uint8_t m_bsmt_data_l = 0; - uint8_t m_bsmt_data_h = 0; - bool m_bsmt_reset = false; - - virtual void machine_start() override; - virtual void machine_reset() override; + uint8_t m_paletteram[0x300]{}; + uint16_t m_palette_write_addr = 0; + rgb_t m_pens[0x100]; + uint8_t m_controls_mux = 0; + uint8_t m_z80_to_68k_index = 0; + uint8_t m_z80_to_68k_data = 0; + uint8_t m_68k_to_z80_index = 0; + uint8_t m_68k_to_z80_data = 0; + uint8_t m_z80_data_available = 0; + uint8_t m_68k_data_available = 0; + uint8_t m_bsmt_data_l = 0; + uint8_t m_bsmt_data_h = 0; + bool m_bsmt_reset = false; void crtc_vsync(int state); @@ -505,7 +508,7 @@ static INPUT_PORTS_START( tapatune ) PORT_START("COINS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("BUTTONS") @@ -536,7 +539,7 @@ void tapatune_state::tapatune_base(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(100)); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); diff --git a/src/mame/misc/tickee.cpp b/src/mame/misc/tickee.cpp index d3fe9044392..7320d2481b2 100644 --- a/src/mame/misc/tickee.cpp +++ b/src/mame/misc/tickee.cpp @@ -344,8 +344,8 @@ void tickee_state::tickee_control_w(offs_t offset, uint8_t data) break; case 3: - m_ticket[0]->motor_w(BIT(data, 3)); - m_ticket[1]->motor_w(BIT(data, 2)); + m_ticket[0]->motor_w(BIT(~data, 3)); + m_ticket[1]->motor_w(BIT(~data, 2)); break; default: @@ -806,8 +806,8 @@ void tickee_gun_state::tickee(machine_config &config) set_beamadd(50, 0); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_ticket[1], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100)); + TICKET_DISPENSER(config, m_ticket[1], attotime::from_msec(100)); // video hardware TLC34076(config, m_tlc34076, tlc34076_device::TLC34076_6_BIT); @@ -850,8 +850,8 @@ void tickee_state::mouseatk(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_ticket[1], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100)); + TICKET_DISPENSER(config, m_ticket[1], attotime::from_msec(100)); // video hardware TLC34076(config, m_tlc34076, tlc34076_device::TLC34076_6_BIT); @@ -908,7 +908,7 @@ void tickee_gun_state::maletmad(machine_config &config) { rapidfir(config); - TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket[0], attotime::from_msec(100)); } diff --git a/src/mame/misc/tvg01.cpp b/src/mame/misc/tvg01.cpp index 2f30155df83..06509067896 100644 --- a/src/mame/misc/tvg01.cpp +++ b/src/mame/misc/tvg01.cpp @@ -103,9 +103,6 @@ class tvg01_state : public driver_device #define CPU_CLOCK MAIN_CLOCK / 6 #define PSG_CLOCK MAIN_CLOCK / 12 -#define VDP_MEM 0x20000 // 4x MB81464-15 -#define HOPPER_PULSE 50 // time between hopper pulses in milliseconds - void tvg01_state::machine_start() { @@ -305,10 +302,10 @@ void tvg01_state::theboat(machine_config &config) v9938_device &vdp(V9938(config, "vdp", VDP_CLOCK)); // unknown type (surface-scratched 64-pin SDIP) vdp.set_screen_ntsc("screen"); - vdp.set_vram_size(VDP_MEM); // 4x MB81464-15 + vdp.set_vram_size(0x20000); // 4x MB81464-15 vdp.int_cb().set_inputline("maincpu", INPUT_LINE_IRQ0); - TICKET_DISPENSER(config, "hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "hopper", attotime::from_msec(50)); SPEAKER(config, "mono").front_center(); diff --git a/src/mame/msx/big10.cpp b/src/mame/msx/big10.cpp index afedf20b555..1cad47601fc 100644 --- a/src/mame/msx/big10.cpp +++ b/src/mame/msx/big10.cpp @@ -50,16 +50,14 @@ ***************************************************************************/ - -#define MASTER_CLOCK XTAL(21'477'272) // Dumper notes poorly refers to a 21.?727 Xtal. - - #include "emu.h" + #include "cpu/z80/z80.h" #include "sound/ay8910.h" #include "video/v9938.h" #include "machine/nvram.h" #include "machine/ticket.h" + #include "screen.h" #include "speaker.h" @@ -97,10 +95,6 @@ class big10_state : public driver_device }; -#define HOPPER_PULSE 40 // time between hopper pulses in milliseconds -#define VDP_MEM 0x40000 - - /**************************************** * Input Ports Demux & Common Routines * ****************************************/ @@ -108,7 +102,7 @@ class big10_state : public driver_device void big10_state::mux_w(uint8_t data) { m_mux_data = ~data; - m_hopper->motor_w(BIT(data, 6)); + m_hopper->motor_w(BIT(~data, 6)); m_lamp = BIT(~data, 7); // maybe a coin counter? } @@ -232,6 +226,8 @@ INPUT_PORTS_END void big10_state::big10(machine_config &config) { + constexpr XTAL MASTER_CLOCK = 21.477272_MHz_XTAL; // Dumper notes poorly refers to a 21.?727 Xtal. + // basic machine hardware Z80(config, m_maincpu, MASTER_CLOCK/6); // guess m_maincpu->set_addrmap(AS_PROGRAM, &big10_state::main_map); @@ -239,12 +235,12 @@ void big10_state::big10(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(40)); // video hardware v9938_device &v9938(V9938(config, "v9938", MASTER_CLOCK)); v9938.set_screen_ntsc("screen"); - v9938.set_vram_size(VDP_MEM); + v9938.set_vram_size(0x40000); v9938.int_cb().set_inputline("maincpu", 0); SCREEN(config, "screen", SCREEN_TYPE_RASTER); diff --git a/src/mame/namco/cgang.cpp b/src/mame/namco/cgang.cpp index b5f4f070913..fc73e87c59e 100644 --- a/src/mame/namco/cgang.cpp +++ b/src/mame/namco/cgang.cpp @@ -809,7 +809,7 @@ void cgang_state::cgang(machine_config &config) WATCHDOG_TIMER(config, m_watchdog); // HA1835P m_watchdog->set_time(attotime::from_msec(100)); // approximation - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(3000), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(3000)); // video hardware PWM_DISPLAY(config, m_digits).set_size(10, 7); diff --git a/src/mame/namco/namcos10.cpp b/src/mame/namco/namcos10.cpp index abe9e7e4303..ac934de1cf5 100644 --- a/src/mame/namco/namcos10.cpp +++ b/src/mame/namco/namcos10.cpp @@ -1383,9 +1383,9 @@ void namcos10_state::namcos10_mgexio(machine_config &config) namcos10_mgexio_device &mgexio(NAMCOS10_MGEXIO(config, m_exio, 0)); - HOPPER(config, m_mgexio_hopper[0], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, m_mgexio_hopper[1], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - HOPPER(config, m_mgexio_hopper[2], attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_mgexio_hopper[0], attotime::from_msec(100)); + HOPPER(config, m_mgexio_hopper[1], attotime::from_msec(100)); + HOPPER(config, m_mgexio_hopper[2], attotime::from_msec(100)); mgexio.port4_read_callback().set([this] (offs_t offset) { uint8_t r = 0; diff --git a/src/mame/namco/wacky_gator.cpp b/src/mame/namco/wacky_gator.cpp index 8f3ba4d7d1f..a7b5a7d8f37 100644 --- a/src/mame/namco/wacky_gator.cpp +++ b/src/mame/namco/wacky_gator.cpp @@ -337,7 +337,7 @@ void wackygtr_state::wackygtr(machine_config &config) m_pit8253[1]->set_clk<2>(XTAL(3'579'545)/16); // this is a guess m_pit8253[1]->out_handler<2>().set(FUNC(wackygtr_state::alligator_ck<4>)); - TICKET_DISPENSER(config, "ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, "ticket", attotime::from_msec(200)); } diff --git a/src/mame/neogeo/midas.cpp b/src/mame/neogeo/midas.cpp index ac6dd4f966c..c68983ed45b 100644 --- a/src/mame/neogeo/midas.cpp +++ b/src/mame/neogeo/midas.cpp @@ -579,14 +579,14 @@ static INPUT_PORTS_START( hammer ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("HAMMER") // bc0000 - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("prize1", ticket_dispenser_device, line_r) // prize 1 sensor ("tejisw 1") - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("prize2", ticket_dispenser_device, line_r) // prize 2 sensor ("tejisw 2") - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_IMPULSE(5) PORT_NAME( "Hammer" ) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("prize1", ticket_dispenser_device, line_r) // prize 1 sensor ("tejisw 1") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("prize2", ticket_dispenser_device, line_r) // prize 2 sensor ("tejisw 2") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_IMPULSE(5) PORT_NAME( "Hammer" ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -671,17 +671,9 @@ void midas_state::hammer(machine_config &config) EEPROM_93C46_16BIT(config, m_eeprom); - TICKET_DISPENSER(config, m_prize[0], 0); - m_prize[0]->set_period(attotime::from_msec(1000*5)); - m_prize[0]->set_senses(TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW, false); - - TICKET_DISPENSER(config, m_prize[1], 0); - m_prize[1]->set_period(attotime::from_msec(1000*5)); - m_prize[1]->set_senses(TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW, false); - - TICKET_DISPENSER(config, m_ticket, 0); - m_ticket->set_period(attotime::from_msec(200)); - m_ticket->set_senses(TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW, false); + TICKET_DISPENSER(config, m_prize[0], attotime::from_msec(1000*5)); + TICKET_DISPENSER(config, m_prize[1], attotime::from_msec(1000*5)); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/novag/const.cpp b/src/mame/novag/const.cpp index 04c89420f69..ab1cd9f9ec2 100644 --- a/src/mame/novag/const.cpp +++ b/src/mame/novag/const.cpp @@ -142,6 +142,12 @@ class const_state : public driver_device u8 input2_r(); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void const_state::machine_start() { // register for savestates diff --git a/src/mame/novag/micro.cpp b/src/mame/novag/micro.cpp index f3ecd10342a..d6acc4dbb1c 100644 --- a/src/mame/novag/micro.cpp +++ b/src/mame/novag/micro.cpp @@ -105,9 +105,9 @@ void micro_state::input_w(u8 data) u8 micro_state::input_r() { + // P10-P17: multiplexed inputs u8 data = 0; - // P10-P17: multiplexed inputs // read chessboard u8 cb_mux = (m_inp_mux << 2) | (m_control >> 5 & 3); cb_mux = bitswap<8>(cb_mux,4,5,6,7,1,0,3,2); diff --git a/src/mame/novag/micro2.cpp b/src/mame/novag/micro2.cpp index c7ceca736e0..e41ac1c33c3 100644 --- a/src/mame/novag/micro2.cpp +++ b/src/mame/novag/micro2.cpp @@ -90,10 +90,8 @@ class micro2_state : public driver_device bool m_kp_select = false; u8 m_inp_mux = 0; - u8 m_led_select = 0; // I/O handlers - void update_display(); void mux_w(u8 data); void control_w(u8 data); u8 input_r(); @@ -101,12 +99,17 @@ class micro2_state : public driver_device void set_cpu_freq(); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void micro2_state::machine_start() { // register for savestates save_item(NAME(m_kp_select)); save_item(NAME(m_inp_mux)); - save_item(NAME(m_led_select)); } void micro2_state::set_cpu_freq() @@ -124,18 +127,11 @@ void micro2_state::set_cpu_freq() I/O *******************************************************************************/ -// MCU ports/generic - -void micro2_state::update_display() -{ - m_display->matrix(m_led_select, m_inp_mux); -} - void micro2_state::mux_w(u8 data) { // D0-D7: input mux, led data m_inp_mux = ~data; - update_display(); + m_display->write_mx(m_inp_mux); } void micro2_state::control_w(u8 data) @@ -147,15 +143,14 @@ void micro2_state::control_w(u8 data) m_dac->write(BIT(data, 2) & BIT(~data, 3)); // P24-P26: led select - m_led_select = ~data >> 4 & 7; - update_display(); + m_display->write_my(~data >> 4 & 7); } u8 micro2_state::input_r() { + // P10-P17: multiplexed inputs u8 data = 0; - // P10-P17: multiplexed inputs // read chessboard buttons for (int i = 0; i < 8; i++) if (BIT(m_inp_mux, i)) diff --git a/src/mame/playmark/playmark.cpp b/src/mame/playmark/playmark.cpp index 7452cadcbc6..53c5cb49c64 100644 --- a/src/mame/playmark/playmark.cpp +++ b/src/mame/playmark/playmark.cpp @@ -1315,8 +1315,8 @@ void playmark_state::hotmind(machine_config &config) MCFG_VIDEO_START_OVERRIDE(playmark_state,hotmind) - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_token, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350)); + TICKET_DISPENSER(config, m_token, attotime::from_msec(350)); // sound hardware SPEAKER(config, "mono").front_center(); @@ -1356,8 +1356,8 @@ void playmark_state::luckboomh(machine_config &config) MCFG_VIDEO_START_OVERRIDE(playmark_state,luckboomh) - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_token, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350)); + TICKET_DISPENSER(config, m_token, attotime::from_msec(350)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/playmark/powerbal.cpp b/src/mame/playmark/powerbal.cpp index 490a4511dd4..51caf7d412a 100644 --- a/src/mame/playmark/powerbal.cpp +++ b/src/mame/playmark/powerbal.cpp @@ -699,8 +699,8 @@ void magicstk_state::magicstk(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_powerbal); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 512); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_token, attotime::from_msec(350), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(350)); + TICKET_DISPENSER(config, m_token, attotime::from_msec(350)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/rare/xtheball.cpp b/src/mame/rare/xtheball.cpp index 27036f93f89..8c1312e3ed0 100644 --- a/src/mame/rare/xtheball.cpp +++ b/src/mame/rare/xtheball.cpp @@ -25,16 +25,17 @@ namespace { class xtheball_state : public driver_device { public: - xtheball_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_watchdog(*this, "watchdog"), - m_tlc34076(*this, "tlc34076"), - m_ticket(*this, "ticket"), - m_vram_bg(*this, "vrabg"), - m_vram_fg(*this, "vrafg"), - m_analog_x(*this, "ANALOGX"), - m_analog_y(*this, "ANALOGY") { } + xtheball_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_watchdog(*this, "watchdog"), + m_tlc34076(*this, "tlc34076"), + m_ticket(*this, "ticket"), + m_vram_bg(*this, "vrabg"), + m_vram_fg(*this, "vrafg"), + m_analog_x(*this, "ANALOGX"), + m_analog_y(*this, "ANALOGY") + { } void xtheball(machine_config &config); @@ -319,7 +320,7 @@ void xtheball_state::xtheball(machine_config &config) latch3.q_out_cb<3>().set(FUNC(xtheball_state::foreground_mode_w)); // Q3 = video foreground control? - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100)); WATCHDOG_TIMER(config, m_watchdog); diff --git a/src/mame/recfranco/rfslots8085.cpp b/src/mame/recfranco/rfslots8085.cpp index 217d41c9ea6..25729c8fa5e 100644 --- a/src/mame/recfranco/rfslots8085.cpp +++ b/src/mame/recfranco/rfslots8085.cpp @@ -845,8 +845,8 @@ void rfslots8085_state::rf53_3297(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper[0], attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); // hopper motor 25 Pts. - HOPPER(config, m_hopper[1], attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); // hopper motor 100 Pts. + HOPPER(config, m_hopper[0], attotime::from_msec(150)); // hopper motor 25 Pts. + HOPPER(config, m_hopper[1], attotime::from_msec(150)); // hopper motor 100 Pts. add_em_reels(config, 100, attotime::from_double(2)); diff --git a/src/mame/recfranco/rfslotsmcs48.cpp b/src/mame/recfranco/rfslotsmcs48.cpp index 2795c757745..40dcd01aa67 100644 --- a/src/mame/recfranco/rfslotsmcs48.cpp +++ b/src/mame/recfranco/rfslotsmcs48.cpp @@ -728,7 +728,7 @@ void rfslotsmcs48_state::rf_3115_base(machine_config &config) NVRAM(config, "data_ram", nvram_device::DEFAULT_ALL_0); // Hopper device - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); SPEAKER(config, "mono").front_center(); } diff --git a/src/mame/saitek/blitz.cpp b/src/mame/saitek/blitz.cpp index 50364cd199f..26a6136e0b9 100644 --- a/src/mame/saitek/blitz.cpp +++ b/src/mame/saitek/blitz.cpp @@ -116,6 +116,12 @@ class blitz_state : public driver_device void p6_w(u8 data); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void blitz_state::machine_start() { m_out_lcd.resolve(); diff --git a/src/mame/saitek/corona.cpp b/src/mame/saitek/corona.cpp index 3ddb1d33fd9..bc170d0607e 100644 --- a/src/mame/saitek/corona.cpp +++ b/src/mame/saitek/corona.cpp @@ -29,13 +29,13 @@ different compared to Stratos/Turbo King. namespace { -// note: sub-class of saitek_stratos_state (see stratos.h, stratos.cpp) +// note: sub-class of stratos_base_state (see stratos.h, stratos.cpp) -class corona_state : public saitek_stratos_state +class corona_state : public stratos_base_state { public: corona_state(const machine_config &mconfig, device_type type, const char *tag) : - saitek_stratos_state(mconfig, type, tag), + stratos_base_state(mconfig, type, tag), m_rombank(*this, "rombank"), m_board(*this, "board"), m_dac(*this, "dac"), @@ -81,7 +81,7 @@ class corona_state : public saitek_stratos_state void corona_state::machine_start() { - saitek_stratos_state::machine_start(); + stratos_base_state::machine_start(); // register for savestates save_item(NAME(m_control1)); @@ -94,7 +94,7 @@ void corona_state::machine_start() void corona_state::machine_reset() { - saitek_stratos_state::machine_reset(); + stratos_base_state::machine_reset(); m_control2 = 0; m_rombank.select(0); diff --git a/src/mame/saitek/gk2000.cpp b/src/mame/saitek/gk2000.cpp index 1de39e86d12..e707b6bce4a 100644 --- a/src/mame/saitek/gk2000.cpp +++ b/src/mame/saitek/gk2000.cpp @@ -166,6 +166,12 @@ class gk2000_state : public driver_device void p5_w(u8 data); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void gk2000_state::machine_start() { m_out_lcd.resolve(); diff --git a/src/mame/saitek/mark5.cpp b/src/mame/saitek/mark5.cpp index be57b41150a..41bd6ea8e33 100644 --- a/src/mame/saitek/mark5.cpp +++ b/src/mame/saitek/mark5.cpp @@ -133,6 +133,12 @@ class mark5_state : public driver_device void write_lcd(int state); }; + + +/******************************************************************************* + Initialization +*******************************************************************************/ + void mark5_state::machine_start() { m_out_x.resolve(); diff --git a/src/mame/saitek/minichess.cpp b/src/mame/saitek/minichess.cpp index 0ae7a133109..261d34eb780 100644 --- a/src/mame/saitek/minichess.cpp +++ b/src/mame/saitek/minichess.cpp @@ -210,7 +210,7 @@ void mini_state::smchess(machine_config &config) ROM_START( smchess ) ROM_REGION( 0x2000, "maincpu", 0 ) - ROM_LOAD("44801a34_proj_t", 0x0000, 0x2000, CRC(be71f1c0) SHA1(6b4d5c8f8491c82bdec1938bd83c14e826ff3e30) ) + ROM_LOAD("44801a34_scisys-w_ltd_proj_t", 0x0000, 0x2000, CRC(be71f1c0) SHA1(6b4d5c8f8491c82bdec1938bd83c14e826ff3e30) ) ROM_REGION( 48645, "screen", 0 ) ROM_LOAD("smchess.svg", 0, 48645, CRC(19beaa99) SHA1(2d738bd6953dfd7a2c8c37814badd0aac2960c8c) ) diff --git a/src/mame/saitek/stratos.cpp b/src/mame/saitek/stratos.cpp index 6dd97d210fb..fad1c3800de 100644 --- a/src/mame/saitek/stratos.cpp +++ b/src/mame/saitek/stratos.cpp @@ -69,11 +69,11 @@ is engine version C. #include "saitek_tking.lh" -class stratos_state : public saitek_stratos_state +class stratos_state : public stratos_base_state { public: stratos_state(const machine_config &mconfig, device_type type, const char *tag) : - saitek_stratos_state(mconfig, type, tag), + stratos_base_state(mconfig, type, tag), m_banked_nvram(*this, "nvram.u7", 0x2000, ENDIANNESS_LITTLE), m_nvrambank(*this, "nvrambank"), m_rombank(*this, "rombank"), @@ -123,9 +123,9 @@ class stratos_state : public saitek_stratos_state }; -// saitek_stratos_state +// stratos_base_state -void saitek_stratos_state::machine_start() +void stratos_base_state::machine_start() { // resolve handlers m_out_digit.resolve(); @@ -139,7 +139,7 @@ void saitek_stratos_state::machine_start() save_item(NAME(m_lcd_data)); } -void saitek_stratos_state::machine_reset() +void stratos_base_state::machine_reset() { m_power = true; m_lcd_ready = false; @@ -147,7 +147,7 @@ void saitek_stratos_state::machine_reset() clear_lcd(); } -INPUT_CHANGED_MEMBER(saitek_stratos_state::change_cpu_freq) +INPUT_CHANGED_MEMBER(stratos_base_state::change_cpu_freq) { // known officially* released CPU speeds: 5MHz, 5.626MHz, 5.67MHz // *not including reseller overclocks, user mods, or the "Turbo Kit" @@ -160,7 +160,7 @@ INPUT_CHANGED_MEMBER(saitek_stratos_state::change_cpu_freq) void stratos_state::machine_start() { - saitek_stratos_state::machine_start(); + stratos_base_state::machine_start(); // init banks m_rombank->configure_entries(0, 2, memregion("maincpu")->base(), 0x8000); @@ -174,7 +174,7 @@ void stratos_state::machine_start() void stratos_state::machine_reset() { - saitek_stratos_state::machine_reset(); + stratos_base_state::machine_reset(); m_control = 0; m_rombank->set_entry(0); @@ -189,7 +189,7 @@ void stratos_state::machine_reset() // soft power on/off -INPUT_CHANGED_MEMBER(saitek_stratos_state::go_button) +INPUT_CHANGED_MEMBER(stratos_base_state::go_button) { if (newval && !m_power) { @@ -198,7 +198,7 @@ INPUT_CHANGED_MEMBER(saitek_stratos_state::go_button) } } -void saitek_stratos_state::power_off() +void stratos_base_state::power_off() { m_power = false; m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); @@ -212,7 +212,7 @@ void saitek_stratos_state::power_off() // LCD HLE -void saitek_stratos_state::update_lcd() +void stratos_base_state::update_lcd() { // output individual segments for (int i = 0; i < 0x40; i++) @@ -230,7 +230,7 @@ void saitek_stratos_state::update_lcd() m_out_digit[i + 5] = (m_lcd_data[0x11 + i * 2] << 4 | m_lcd_data[0x11 + i * 2 + 1]) & 0x7f; } -void saitek_stratos_state::lcd_data_w(u8 data) +void stratos_base_state::lcd_data_w(u8 data) { // d0-d3: lcd data // d4-d7: unused? @@ -418,10 +418,10 @@ INPUT_PORTS_START( saitek_stratos ) PORT_CONFSETTING( 0x01, DEF_STR( Normal ) ) PORT_START("RESET") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, saitek_stratos_state, go_button, 0) PORT_NAME("Go") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_base_state, go_button, 0) PORT_NAME("Go") PORT_START("CPU") - PORT_CONFNAME( 0x03, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, saitek_stratos_state, change_cpu_freq, 0) // factory set + PORT_CONFNAME( 0x03, 0x00, "CPU Frequency" ) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_base_state, change_cpu_freq, 0) // factory set PORT_CONFSETTING( 0x00, "5MHz" ) PORT_CONFSETTING( 0x01, "5.626MHz" ) PORT_CONFSETTING( 0x02, "5.67MHz" ) @@ -468,7 +468,7 @@ static INPUT_PORTS_START( tking ) // same buttons, but different locations PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Normal") PORT_MODIFY("RESET") - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_CHANGED_MEMBER(DEVICE_SELF, saitek_stratos_state, go_button, 0) PORT_NAME("Go") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) PORT_CHANGED_MEMBER(DEVICE_SELF, stratos_base_state, go_button, 0) PORT_NAME("Go") INPUT_PORTS_END static INPUT_PORTS_START( tking2 ) diff --git a/src/mame/saitek/stratos.h b/src/mame/saitek/stratos.h index 25ab5c7732d..ac760875cce 100644 --- a/src/mame/saitek/stratos.h +++ b/src/mame/saitek/stratos.h @@ -17,10 +17,10 @@ #include -class saitek_stratos_state : public driver_device +class stratos_base_state : public driver_device { public: - saitek_stratos_state(const machine_config &mconfig, device_type type, const char *tag) : + stratos_base_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_display(*this, "display"), diff --git a/src/mame/sega/segas32.cpp b/src/mame/sega/segas32.cpp index 356e53d40ec..ece2dbd14bd 100644 --- a/src/mame/sega/segas32.cpp +++ b/src/mame/sega/segas32.cpp @@ -9,10 +9,9 @@ Still to do: * fix protection * fix jpark correctly - * priorities in multi32 appear wrong - stadium cross map screen - and title fight ingame backgrounds * should f1lap be set up as a twin cabinet / direct link or can it be operated as a single screen, unlike f1en/air rescue + * also see segas32_v.cpp for gfx issues **************************************************************************** diff --git a/src/mame/sega/stv.cpp b/src/mame/sega/stv.cpp index 969b95d4c58..1cd47ce126a 100644 --- a/src/mame/sega/stv.cpp +++ b/src/mame/sega/stv.cpp @@ -1284,7 +1284,7 @@ void stv_state::stv_slot(machine_config &config) void stv_state::hopper(machine_config &config) { stv(config); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); m_maincpu->set_addrmap(AS_PROGRAM, &stv_state::hopper_mem); m_slave->set_addrmap(AS_PROGRAM, &stv_state::hopper_mem); diff --git a/src/mame/seibu/banprestoms.cpp b/src/mame/seibu/banprestoms.cpp index 26fcc264d10..f32d5eff5b4 100644 --- a/src/mame/seibu/banprestoms.cpp +++ b/src/mame/seibu/banprestoms.cpp @@ -413,7 +413,7 @@ void banprestoms_state::banprestoms(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); // TODO: period is guessed + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(100)); // TODO: period is guessed // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: copied from other drivers using the same CRTC diff --git a/src/mame/seibu/feversoc.cpp b/src/mame/seibu/feversoc.cpp index 433b186d097..0355b31e4d4 100644 --- a/src/mame/seibu/feversoc.cpp +++ b/src/mame/seibu/feversoc.cpp @@ -323,7 +323,7 @@ void feversoc_state::feversoc(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(60), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(60)); } /*************************************************************************** diff --git a/src/mame/seta/albazc.cpp b/src/mame/seta/albazc.cpp index b1dcbfbd903..254b48002c0 100644 --- a/src/mame/seta/albazc.cpp +++ b/src/mame/seta/albazc.cpp @@ -227,7 +227,7 @@ void albazc_state::hanaroku(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/seta/champbwl.cpp b/src/mame/seta/champbwl.cpp index a0954ac559e..36193f67410 100644 --- a/src/mame/seta/champbwl.cpp +++ b/src/mame/seta/champbwl.cpp @@ -323,7 +323,7 @@ void doraemon_state::outputs_w(uint8_t data) machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); // gift out counter machine().bookkeeping().coin_lockout_w(0, BIT(~data, 3)); // coin lockout - m_hopper->motor_w(BIT(~data, 2)); // gift out motor + m_hopper->motor_w(BIT(data, 2)); // gift out motor m_mainbank->set_entry((data & 0x30) >> 4); @@ -481,7 +481,7 @@ static INPUT_PORTS_START( doraemon ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // sensor + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // sensor PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW ) INPUT_PORTS_END @@ -601,7 +601,7 @@ void doraemon_state::doraemon(machine_config &config) m_spritegen->set_bg_yoffsets(0x00, 0x01); m_spritegen->set_fg_yoffsets(0x00, 0x10); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(2000)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/seta/jclub2.cpp b/src/mame/seta/jclub2.cpp index 47e086d407a..4d1f7dca0af 100644 --- a/src/mame/seta/jclub2.cpp +++ b/src/mame/seta/jclub2.cpp @@ -1168,8 +1168,8 @@ void jclub2o_state::jclub2o(machine_config &config) EEPROM_S29290_16BIT(config, "eeprom"); WATCHDOG_TIMER(config, "watchdog"); - TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200)); + TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -1209,8 +1209,8 @@ void jclub2_state::jclub2(machine_config &config) EEPROM_93C46_8BIT(config, "eeprom"); WATCHDOG_TIMER(config, "watchdog"); - TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200)); + TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -1253,8 +1253,8 @@ void darkhors_state::darkhors(machine_config &config) EEPROM_93C46_8BIT(config, "eeprom"); WATCHDOG_TIMER(config, "watchdog"); - TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); - TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper1, attotime::from_msec(200)); + TICKET_DISPENSER(config, m_hopper2, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/seta/seta.cpp b/src/mame/seta/seta.cpp index c3b5eab4973..2f721c52294 100644 --- a/src/mame/seta/seta.cpp +++ b/src/mame/seta/seta.cpp @@ -4577,7 +4577,7 @@ static INPUT_PORTS_START( setaroul ) PORT_SERVICE( 0x08, 0x08 ) PORT_DIPLOCATION("SW2:1") // service mode PORT_START("COIN") // d40009.b - PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // medal (causes hopper over run / empty if the dsw is on) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // medal (causes hopper over run / empty if the dsw is on) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset") // rst (button SW5? Press twice quickly to enter the keyboard test) PORT_DIPNAME( 0x04, 0x04, "Credit Meter" ) PORT_DIPLOCATION("SW6:1") // crt.mtr (switch SW6? Shows stats screen. With added menus, if their dsw is on) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) @@ -6888,7 +6888,7 @@ static INPUT_PORTS_START( jockeyc ) PORT_START("COIN") // 200002.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) // Coin Drop - 1P PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_CUSTOM ) // Hopper Overflow - 1P - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper1", ticket_dispenser_device, line_r) // Hopper Coin Out - 1P + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper1", ticket_dispenser_device, line_r) // Hopper Coin Out - 1P PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_OTHER ) // Attendant Pay - 1P PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Coin B - 1P") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin A - 1P") @@ -6896,7 +6896,7 @@ static INPUT_PORTS_START( jockeyc ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) // Coin Sense 1 - 1P PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_CUSTOM ) // Coin Drop - 2P PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_CUSTOM ) // Sel Sense (single hopper mode) / Hopper Overflow - 2P (double hopper mode) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper2", ticket_dispenser_device, line_r) // Hopper Coin Out - 2P (double hopper mode) + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper2", ticket_dispenser_device, line_r) // Hopper Coin Out - 2P (double hopper mode) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) // Attendant Pay - 2P PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Coin B - 2P") PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Coin A - 2P") @@ -7799,7 +7799,7 @@ void setaroul_state::setaroul(machine_config &config) // devices UPD4992(config, m_rtc, 32'768); // ! Actually D4911C ! ACIA6850(config, "acia0", 0); - TICKET_DISPENSER(config, "hopper", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "hopper", attotime::from_msec(150)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -9091,8 +9091,8 @@ void jockeyc_state::jockeyc(machine_config &config) // devices UPD4992(config, m_rtc, 32'768); // ! Actually D4911C ! ACIA6850(config, "acia0", 0); - TICKET_DISPENSER(config, "hopper1", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); - TICKET_DISPENSER(config, "hopper2", attotime::from_msec(150), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, "hopper1", attotime::from_msec(150)); + TICKET_DISPENSER(config, "hopper2", attotime::from_msec(150)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/seta/seta2.cpp b/src/mame/seta/seta2.cpp index 8e69b482d91..d720e290a9a 100644 --- a/src/mame/seta/seta2.cpp +++ b/src/mame/seta/seta2.cpp @@ -1723,7 +1723,7 @@ static INPUT_PORTS_START( reelquak ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("TICKET") // $400003.b - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dispenser", ticket_dispenser_device, line_r) // ticket sensor + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dispenser", ticket_dispenser_device, line_r) // ticket sensor PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Knock Down") // knock down @@ -2111,7 +2111,7 @@ static INPUT_PORTS_START( telpacfl ) PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet") // bet switch (converts credits into balls) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_GAMBLE_DOOR ) // door switch - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dispenser", ticket_dispenser_device, line_r) // coin out switch (medals jam error when stuck i.e. メダルづまり) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("dispenser", ticket_dispenser_device, line_r) // coin out switch (medals jam error when stuck i.e. メダルづまり) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) // - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) // - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) // - @@ -2371,7 +2371,7 @@ void seta2_state::reelquak(machine_config &config) downcast(*m_maincpu).parallel_w_cb().set(FUNC(seta2_state::reelquak_leds_w)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_dispenser, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_dispenser, attotime::from_msec(200)); m_screen->set_visarea(0x00, 0x140-1, 0x000, 0x0f0-1); } @@ -2417,7 +2417,7 @@ void seta2_state::telpacfl(machine_config &config) EEPROM_93C46_16BIT(config, "eeprom"); // not hooked up, seems unused NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_dispenser, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_dispenser, attotime::from_msec(200)); // video hardware m_screen->set_visarea(0x0, 0x180-1, 0x00, 0xf0-1); // still off by 1 because of different CRTC regs? diff --git a/src/mame/sigma/sigmab98.cpp b/src/mame/sigma/sigmab98.cpp index 7834f6c605f..c81ef9c5d78 100644 --- a/src/mame/sigma/sigmab98.cpp +++ b/src/mame/sigma/sigmab98.cpp @@ -114,6 +114,7 @@ To Do: *************************************************************************************************************/ #include "emu.h" + #include "cpu/z80/kl5c80a12.h" #include "cpu/z80/ky80.h" #include "machine/74165.h" @@ -126,6 +127,7 @@ To Do: #include "sound/okim9810.h" #include "sound/ymz280b.h" #include "video/bufsprite.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -734,7 +736,7 @@ void sigmab98_state::show_outputs() void sigmab98_state::eeprom_w(uint8_t data) { // latch the bit - m_eeprom->di_write((data & 0x40) >> 6); + m_eeprom->di_write(BIT(data, 6)); // reset line asserted: reset. // if ((m_c0 ^ data) & 0x20) @@ -765,9 +767,9 @@ void sigmab98_state::c4_w(uint8_t data) // 20 led? (starts blinking after coin in) void sigmab98_state::c6_w(uint8_t data) { - machine().bookkeeping().coin_lockout_w(0, (~data) & 0x02); + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 1)); - machine().bookkeeping().coin_counter_w(0, data & 0x04); + machine().bookkeeping().coin_counter_w(0, BIT(data, 2)); if ((data & 0x08) && !(m_c6 & 0x08)) m_buffered_spriteram->copy(); @@ -784,7 +786,7 @@ void sigmab98_state::c6_w(uint8_t data) // 02 hopper motor on (active low)? void sigmab98_state::c8_w(uint8_t data) { - m_hopper->motor_w((!(data & 0x02) && (data & 0x01)) ? 0 : 1); + m_hopper->motor_w(~data >> 1 & data & 1); m_c8 = data; show_outputs(); @@ -819,7 +821,7 @@ void sigmab98_state::gegege_io_map(address_map &map) map(0xc6, 0xc6).w(FUNC(sigmab98_state::c6_w)); map(0xc8, 0xc8).w(FUNC(sigmab98_state::c8_w)); - map(0xe5, 0xe5).nopr(); // during irq + map(0xe5, 0xe5).nopr(); // during irq } @@ -1201,19 +1203,19 @@ GFXDECODE_END // 1 button (plus bet and payout) static INPUT_PORTS_START( sigma_1b ) PORT_START("EEPROM") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) // Related to d013. Must be 0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) // Related to d013. Must be 0 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // Related to d013. Must be 0 PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) PORT_START("BUTTON") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // ? (coin error, pulses mask 4 of port c6) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) PORT_NAME("Medal") // coin/medal in (coin error) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CODE(KEYCODE_1) // bet / select in test menu PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) @@ -1289,7 +1291,7 @@ static INPUT_PORTS_START( lufykzku ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_START("PAYOUT") @@ -1365,14 +1367,14 @@ static INPUT_PORTS_START( sammymdl ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("COIN") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin1 in - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // coin2 in - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(5) PORT_NAME("Medal") // medal in - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) // test sw - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin1 in + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // coin2 in + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(5) PORT_NAME("Medal") // medal in + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) // test sw + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( haekaka ) @@ -1387,22 +1389,22 @@ static INPUT_PORTS_START( haekaka ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("COIN") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) // test sw - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) // button - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin / set in test mode - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) // test sw + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) // button + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin / set in test mode + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( gocowboy ) PORT_START("BUTTON") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // shoot PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(20) // coin - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper_small", ticket_dispenser_device, line_r) // 1/2' pay sensor (small) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper_large", ticket_dispenser_device, line_r) // 3/4' pay sensor (large) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper_small", ticket_dispenser_device, line_r) // 1/2' pay sensor (small) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper_large", ticket_dispenser_device, line_r) // 3/4' pay sensor (large) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Meter Switch") // capsule test (pressed while booting) / next in test mode PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Reset Switch") // reset backup ram (pressed while booting) / previous in test mode PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) // test mode (keep pressed in game) / select in test mode / service coin @@ -1444,7 +1446,7 @@ void sigmab98_state::sigmab98(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); EEPROM_93C46_16BIT(config, "eeprom"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); @@ -1516,7 +1518,7 @@ void lufykzku_state::lufykzku(machine_config &config) // No EEPROM MB3773(config, m_watchdog, 0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // 2 x 8-bit parallel/serial converters TTL165(config, m_dsw_shifter[0]); @@ -1593,7 +1595,7 @@ void sammymdl_state::sammymdl(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // battery backed RAM EEPROM_93C46_8BIT(config, "eeprom"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); WATCHDOG_TIMER(config, "watchdog"); @@ -1640,8 +1642,8 @@ void sammymdl_state::gocowboy(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(sammymdl_state::gocowboy_int), "screen", 0, 1); config.device_remove("hopper"); - TICKET_DISPENSER(config, m_hopper_small, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); - TICKET_DISPENSER(config, m_hopper_large, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper_small, attotime::from_msec(200)); + TICKET_DISPENSER(config, m_hopper_large, attotime::from_msec(200)); m_screen->screen_vblank().set_nop(); } diff --git a/src/mame/skeleton/attache.cpp b/src/mame/skeleton/attache.cpp index 2ddcfeb7e92..8834691e4c3 100644 --- a/src/mame/skeleton/attache.cpp +++ b/src/mame/skeleton/attache.cpp @@ -139,9 +139,6 @@ class attache_state : public driver_device uint8_t dma_mem_r(offs_t offset); void dma_mem_w(offs_t offset, uint8_t data); - uint8_t fdc_dma_r(); - void fdc_dma_w(uint8_t data); - void hreq_w(int state); void eop_w(int state); [[maybe_unused]] void fdc_dack_w(int state); @@ -190,6 +187,7 @@ class attache_state : public driver_device uint8_t memmap_r(); void memmap_w(uint8_t data); + void set_latch(uint8_t data); void operation_strobe(uint8_t data); void keyboard_clock_w(bool state); uint8_t keyboard_data_r(); @@ -554,6 +552,16 @@ uint8_t attache_state::pio_portB_r() return ret; } +void attache_state::set_latch(uint8_t data) +{ + m_pio_latch = data; + m_rom_active = ~data & 0x04; + m_floppy0->mon_w((data & 0x01) ? 0 : 1); + m_floppy1->mon_w((data & 0x01) ? 0 : 1); + m_gfx_enabled = data & 0x02; + // TODO: display brightness +} + void attache_state::operation_strobe(uint8_t data) { //logerror("PIO: Port A write operation %i, data %02x\n",m_pio_select,data); @@ -590,12 +598,7 @@ void attache_state::operation_strobe(uint8_t data) logerror("CMOS: write %01x to byte %02x (read)\n",data & 0x0f, m_cmos_select); break; case PIO_SEL_LATCH: - m_pio_latch = data; - m_rom_active = ~data & 0x04; - m_floppy0->mon_w((data & 0x01) ? 0 : 1); - m_floppy1->mon_w((data & 0x01) ? 0 : 1); - m_gfx_enabled = data & 0x02; - // TODO: display brightness + set_latch(data); break; case PIO_SEL_NOP: logerror("PIO: NOP write\n"); @@ -779,17 +782,6 @@ void attache_state::dma_mask_w(uint8_t data) m_dma->write(0x0f,data); } -uint8_t attache_state::fdc_dma_r() -{ - uint8_t ret = m_fdc->dma_r(); - return ret; -} - -void attache_state::fdc_dma_w(uint8_t data) -{ - m_fdc->dma_w(data); -} - uint8_t attache_state::dma_mem_r(offs_t offset) { return m_maincpu->space(AS_PROGRAM).read_byte(offset); @@ -1113,6 +1105,7 @@ void attache_state::machine_start() void attache_state::machine_reset() { m_kb_bitpos = 0; + set_latch(0); } void attache816_state::machine_reset() @@ -1175,8 +1168,8 @@ void attache_state::attache(machine_config &config) m_dma->out_eop_callback().set(FUNC(attache_state::eop_w)); m_dma->in_memr_callback().set(FUNC(attache_state::dma_mem_r)); m_dma->out_memw_callback().set(FUNC(attache_state::dma_mem_w)); - m_dma->in_ior_callback<0>().set(FUNC(attache_state::fdc_dma_r)); - m_dma->out_iow_callback<0>().set(FUNC(attache_state::fdc_dma_w)); + m_dma->in_ior_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_r)); + m_dma->out_iow_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_w)); // m_dma->out_dack_callback<0>().set(FUNC(attache_state::fdc_dack_w)); UPD765A(config, m_fdc, 8_MHz_XTAL, true, true); @@ -1264,8 +1257,8 @@ void attache816_state::attache816(machine_config &config) m_dma->out_eop_callback().set(FUNC(attache_state::eop_w)); m_dma->in_memr_callback().set(FUNC(attache_state::dma_mem_r)); m_dma->out_memw_callback().set(FUNC(attache_state::dma_mem_w)); - m_dma->in_ior_callback<0>().set(FUNC(attache_state::fdc_dma_r)); - m_dma->out_iow_callback<0>().set(FUNC(attache_state::fdc_dma_w)); + m_dma->in_ior_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_r)); + m_dma->out_iow_callback<0>().set(m_fdc, FUNC(upd765a_device::dma_w)); // m_dma->out_dack_callback<0>().set(FUNC(attache_state::fdc_dack_w)); UPD765A(config, m_fdc, 8_MHz_XTAL, true, true); diff --git a/src/mame/sony/smc777.cpp b/src/mame/sony/smc777.cpp index 90ac6db57d0..dd06ae9f80b 100644 --- a/src/mame/sony/smc777.cpp +++ b/src/mame/sony/smc777.cpp @@ -22,8 +22,10 @@ #include "emu.h" #include "cpu/z80/z80.h" +#include "cpu/mcs48/mcs48.h" #include "imagedev/floppy.h" #include "imagedev/snapquik.h" +#include "machine/74259.h" #include "machine/timer.h" #include "machine/wd_fdc.h" #include "softlist_dev.h" @@ -38,8 +40,6 @@ namespace { -#define MASTER_CLOCK 4.028_MHz_XTAL - #define mc6845_h_char_total (m_crtc_vreg[0]+1) #define mc6845_h_display (m_crtc_vreg[1]) #define mc6845_h_sync_pos (m_crtc_vreg[2]) @@ -67,6 +67,7 @@ class smc777_state : public driver_device , m_crtc(*this, "crtc") , m_fdc(*this, "fdc") , m_floppy(*this, "fdc:%u", 0U) + , m_ioctrl(*this, "ioctrl") , m_beeper(*this, "beeper") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") @@ -95,6 +96,14 @@ class smc777_state : public driver_device uint8_t io_status_1c_r(); uint8_t io_status_1d_r(); void io_control_w(uint8_t data); + void raminh_w(int state); + void vsup_w(int state); + void screen_lines_w(int state); + void rgb_select_w(int state); + void mt_on_w(int state); + void sound_out_w(int state); + void printer_strb_w(int state); + void cas_out_w(int state); void color_mode_w(uint8_t data); void ramdac_w(offs_t offset, uint8_t data); uint8_t gcw_r(); @@ -125,6 +134,7 @@ class smc777_state : public driver_device required_device m_crtc; required_device m_fdc; required_device_array m_floppy; + required_device m_ioctrl; required_device m_beeper; required_device m_gfxdecode; required_device m_palette; @@ -143,7 +153,6 @@ class smc777_state : public driver_device uint8_t m_display_reg = 0; uint8_t m_fdc_irq_flag = 0; uint8_t m_fdc_drq_flag = 0; - uint8_t m_system_data = 0; struct { uint8_t r = 0, g = 0, b = 0; } m_pal; uint8_t m_raminh = 0, m_raminh_pending_change = 0; //bankswitch uint8_t m_raminh_prefetch = 0; @@ -575,29 +584,50 @@ uint8_t smc777_state::io_status_1d_r() void smc777_state::io_control_w(uint8_t data) { - /* - * flip-flop based - * ---x -111 cassette write - * ---x -110 printer strobe - * ---x -101 beeper - * ---x -100 cassette start (MONITOR_ON_OFF) - * ---x -011 0=RGB 1=Component - * ---x -010 0=525 lines 1=625 lines (NTSC/PAL switch?) - * ---x -001 1=display disable - * ---x -000 ram inibit signal - */ - m_system_data = data; - switch(m_system_data & 0x07) - { - case 0x00: - // "ROM / RAM register change is done at the beginning of the next M1 cycle" - m_raminh_pending_change = ((data & 0x10) >> 4) ^ 1; - m_raminh_prefetch = (uint8_t)(m_maincpu->state_int(Z80_R)) & 0x7f; - break; - case 0x02: printf("Screen line number %d\n",data & 0x10 ? 625 : 525); break; - case 0x05: m_beeper->set_state(data & 0x10); break; - default: printf("System FF W %02x\n",data); break; - } + m_ioctrl->write_bit(data & 0x07, BIT(data, 4)); +} + +void smc777_state::raminh_w(int state) +{ + // "ROM / RAM register change is done at the beginning of the next M1 cycle" + m_raminh_pending_change = state ^ 1; + m_raminh_prefetch = (uint8_t)(m_maincpu->state_int(Z80_R)) & 0x7f; +} + +void smc777_state::vsup_w(int state) +{ + logerror("%s: Display %sabled\n", machine().describe_context(), state ? "dis" : "en"); +} + +void smc777_state::screen_lines_w(int state) +{ + logerror("%s: Screen line number %d\n", machine().describe_context(), state ? 625 : 525); +} + +void smc777_state::rgb_select_w(int state) +{ + // 0=RGB 1=Component + logerror("%s: %s video selected\n", machine().describe_context(), state ? "Component" : "RGB"); +} + +void smc777_state::mt_on_w(int state) +{ + logerror("%s: Cassette monitor %s\n", machine().describe_context(), state ? "on" : "off"); +} + +void smc777_state::sound_out_w(int state) +{ + m_beeper->set_state(state); +} + +void smc777_state::printer_strb_w(int state) +{ + logerror("%s: Printer strobe %d\n", machine().describe_context(), !state); +} + +void smc777_state::cas_out_w(int state) +{ + logerror("%s: Cassette write %d\n", machine().describe_context(), state); } void smc777_state::color_mode_w(uint8_t data) @@ -665,11 +695,11 @@ uint8_t smc777_state::smc777_mem_r(offs_t offset) uint8_t z80_r; // TODO: do the bankswitch AFTER that the prefetch instruction is executed (hackish implementation) - if(m_raminh_prefetch != 0xff) + if(m_raminh_prefetch != 0xff && !machine().side_effects_disabled()) { z80_r = (uint8_t)m_maincpu->state_int(Z80_R); - if(z80_r == ((m_raminh_prefetch+2) & 0x7f)) + if(z80_r == ((m_raminh_prefetch+1) & 0x7f)) { m_raminh = m_raminh_pending_change; m_raminh_prefetch = 0xff; @@ -1104,11 +1134,25 @@ static void smc777_floppies(device_slot_interface &device) void smc777_state::smc777(machine_config &config) { + constexpr XTAL MASTER_CLOCK = 32.2238_MHz_XTAL; + /* basic machine hardware */ - Z80(config, m_maincpu, MASTER_CLOCK); + Z80(config, m_maincpu, MASTER_CLOCK / 8); // nominally 4.028 MHz m_maincpu->set_addrmap(AS_PROGRAM, &smc777_state::smc777_mem); m_maincpu->set_addrmap(AS_IO, &smc777_state::smc777_io); + I8041A(config, "mcu", 6_MHz_XTAL).set_disable(); + + LS259(config, m_ioctrl); + m_ioctrl->q_out_cb<0>().set(FUNC(smc777_state::raminh_w)); + m_ioctrl->q_out_cb<1>().set(FUNC(smc777_state::vsup_w)); + m_ioctrl->q_out_cb<2>().set(FUNC(smc777_state::screen_lines_w)); + m_ioctrl->q_out_cb<3>().set(FUNC(smc777_state::rgb_select_w)); + m_ioctrl->q_out_cb<4>().set(FUNC(smc777_state::mt_on_w)); + m_ioctrl->q_out_cb<5>().set(FUNC(smc777_state::sound_out_w)); + m_ioctrl->q_out_cb<6>().set(FUNC(smc777_state::printer_strb_w)); + m_ioctrl->q_out_cb<7>().set(FUNC(smc777_state::cas_out_w)); + /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -1122,14 +1166,14 @@ void smc777_state::smc777(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfxdecode_device::empty); - HD6845S(config, m_crtc, MASTER_CLOCK/2); /* HD68A45SP; unknown clock, hand tuned to get ~60 fps */ + HD6845S(config, m_crtc, MASTER_CLOCK / 16); // HD68A45SP; unknown clock, hand tuned to get ~60 fps m_crtc->set_screen(m_screen); m_crtc->set_show_border_area(true); m_crtc->set_char_width(8); m_crtc->out_vsync_callback().set(FUNC(smc777_state::vsync_w)); // floppy controller - MB8876(config, m_fdc, 1_MHz_XTAL); + MB8876(config, m_fdc, MASTER_CLOCK / 32); // divider not confirmed m_fdc->intrq_wr_callback().set(FUNC(smc777_state::fdc_intrq_w)); m_fdc->drq_wr_callback().set(FUNC(smc777_state::fdc_drq_w)); @@ -1143,7 +1187,7 @@ void smc777_state::smc777(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - SN76489A(config, "sn1", MASTER_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.50); // unknown clock / divider + SN76489A(config, "sn1", MASTER_CLOCK / 8).add_route(ALL_OUTPUTS, "mono", 0.50); // unknown clock / divider BEEP(config, m_beeper, 300); // TODO: correct frequency m_beeper->add_route(ALL_OUTPUTS, "mono", 0.50); diff --git a/src/mame/subsino/subsino.cpp b/src/mame/subsino/subsino.cpp index d01e641c196..ceade12bfa8 100644 --- a/src/mame/subsino/subsino.cpp +++ b/src/mame/subsino/subsino.cpp @@ -1714,7 +1714,7 @@ static INPUT_PORTS_START( stbsub ) PORT_START("INC") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Small / Black / Stop 3") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Reset") // hard reset PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_CODE(KEYCODE_B) PORT_NAME("Big / Red") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -1850,7 +1850,7 @@ static INPUT_PORTS_START( tesorone ) PORT_START("INC") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Small / Black / Stop 3") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Reset") // hard reset PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_CODE(KEYCODE_B) PORT_NAME("Big / Red") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -2272,7 +2272,7 @@ static INPUT_PORTS_START( smoto16 ) PORT_START( "INB" ) // d006 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) // coin PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Stats / Test") // Bookkeeping. PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) PORT_NAME("Settings") // Game Rate & others. @@ -2281,7 +2281,7 @@ static INPUT_PORTS_START( smoto16 ) PORT_START( "INC" ) // d00c PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Reset") // hard reset PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -2368,7 +2368,7 @@ static INPUT_PORTS_START( smoto20 ) PORT_START( "INB" ) // d006 PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) // coin PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Stats / Test") // Bookkeeping. PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) PORT_NAME("Settings") // Game Rate & others. @@ -2377,7 +2377,7 @@ static INPUT_PORTS_START( smoto20 ) PORT_START( "INC" ) // d00c PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper sensor PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_NAME("Reset") // hard reset PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -2808,7 +2808,7 @@ void subsino_state::victor21(machine_config &config) ppi.tri_pb_callback().set_constant(0); ppi.in_pc_callback().set_ioport("INC"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -2850,7 +2850,7 @@ void subsino_state::crsbingo(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &subsino_state::crsbingo_map); m_maincpu->set_addrmap(AS_IO, &subsino_state::subsino_iomap); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -2891,7 +2891,7 @@ void subsino_state::srider(machine_config &config) ppi2.in_pb_callback().set_ioport("INA"); ppi2.in_pc_callback().set_ioport("INB"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -2954,7 +2954,7 @@ void subsino_state::tisub(machine_config &config) ppi2.in_pb_callback().set_ioport("INA"); ppi2.in_pc_callback().set_ioport("INB"); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -3009,7 +3009,7 @@ void subsino_state::stbsub(machine_config &config) ppi2.in_pc_callback().set_ioport("INA"); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/subsino/subsino2.cpp b/src/mame/subsino/subsino2.cpp index 1373946d81c..f9ce368e3f0 100644 --- a/src/mame/subsino/subsino2.cpp +++ b/src/mame/subsino/subsino2.cpp @@ -2787,7 +2787,7 @@ void subsino2_state::bishjan(machine_config &config) io.in_port_callback<9>().set_ioport("RESET"); io.out_port_callback<9>().set(FUNC(subsino2_state::bishjan_outputs_w)); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200)); DS2430A(config, m_eeprom).set_timing_scale(0.24); @@ -3028,14 +3028,14 @@ void subsino2_state::xtrain(machine_config &config) io.out_port_callback<8>().set(FUNC(subsino2_state::xtrain_out_b_w)); // B io.out_port_callback<9>().set(FUNC(subsino2_state::xtrain_out_a_w)); // A - HOPPER(config, m_hopper, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(200)); } void subsino2_state::ptrain(machine_config &config) { xtrain(config); - TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); } void subsino2_state::expcard(machine_config &config) diff --git a/src/mame/sunelectronics/tonton.cpp b/src/mame/sunelectronics/tonton.cpp index 88e3f110748..2536cdc9b70 100644 --- a/src/mame/sunelectronics/tonton.cpp +++ b/src/mame/sunelectronics/tonton.cpp @@ -135,7 +135,7 @@ static INPUT_PORTS_START( tonton ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown A") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_START("DSW1") @@ -226,7 +226,7 @@ void tonton_state::tonton(machine_config &config) m_v9938->int_cb().set_inputline(m_maincpu, 0); SCREEN(config, "screen", SCREEN_TYPE_RASTER); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(HOPPER_PULSE)); // sound hardware SPEAKER(config, "mono").front_center(); diff --git a/src/mame/taito/cchance.cpp b/src/mame/taito/cchance.cpp index bfefa20a413..4d20a3f4ee4 100644 --- a/src/mame/taito/cchance.cpp +++ b/src/mame/taito/cchance.cpp @@ -285,7 +285,7 @@ void cchance_state::cchance(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(cchance_state::scanline_cb), "screen", 0, 1); TAITOIO_OPTO(config, "opto", 0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); X1_001(config, m_spritegen, 12_MHz_XTAL, m_palette, gfx_cchance); m_spritegen->set_fg_yoffsets(-0x12, 0x0e); diff --git a/src/mame/taito/taito_o.cpp b/src/mame/taito/taito_o.cpp index 25d621e6fc2..81b34fce472 100644 --- a/src/mame/taito/taito_o.cpp +++ b/src/mame/taito/taito_o.cpp @@ -455,7 +455,7 @@ void taitoo_state::taitoo(machine_config &config) m_tc0080vco->set_bgflip_yoffs(-2); m_tc0080vco->set_palette(m_palette); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + HOPPER(config, m_hopper, attotime::from_msec(100)); m_hopper->dispense_handler().set(FUNC(taitoo_state::hopper_int_cb)); SPEAKER(config, "mono").front_center(); diff --git a/src/mame/toaplan/toaplan2.cpp b/src/mame/toaplan/toaplan2.cpp index a1402106625..440de4c31f5 100644 --- a/src/mame/toaplan/toaplan2.cpp +++ b/src/mame/toaplan/toaplan2.cpp @@ -404,8 +404,6 @@ To reset the NVRAM in Othello Derby, hold P1 Button 1 down while booting. #include "speaker.h" -#define PWRKICK_HOPPER_PULSE 50 // time between hopper pulses in milliseconds (probably wrong) - //#define TRUXTON2_STEREO /* Uncomment to hear truxton2 music in stereo */ constexpr unsigned toaplan2_state::T2PALETTE_LENGTH; @@ -4188,7 +4186,7 @@ void pwrkick_state::pwrkick(machine_config &config) // Sunwise SW931201-1 PCB (2 NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - TICKET_DISPENSER(config, m_hopper, attotime::from_msec(PWRKICK_HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH); + TICKET_DISPENSER(config, m_hopper, attotime::from_msec(50)); // duration is probably wrong /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/ussr/debut.cpp b/src/mame/ussr/debut.cpp index f15409f83ba..1a42c38362a 100644 --- a/src/mame/ussr/debut.cpp +++ b/src/mame/ussr/debut.cpp @@ -13,7 +13,7 @@ Also sold in 1996 as Феникс (Fenix), same ROM contents as Debut-M. - where does the interrupt come from? - Debut-M is an updated version? Or is it the same program as Debut with a redesigned case? -******************************************************************************** +================================================================================ Hardware notes: - КР1810ВМ86 (i8086 clone), 16200K XTAL diff --git a/src/mame/ussr/special_gambl.cpp b/src/mame/ussr/special_gambl.cpp index 488b253a54a..ab9049ecd2e 100644 --- a/src/mame/ussr/special_gambl.cpp +++ b/src/mame/ussr/special_gambl.cpp @@ -112,7 +112,7 @@ static INPUT_PORTS_START(dice) PORT_SERVICE_NO_TOGGLE(0x02, IP_ACTIVE_LOW) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE1) PORT_NAME("Clear stats") PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN1) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_SERVICE2) PORT_NAME("Reset") PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) @@ -274,7 +274,7 @@ void dinaris_state::dice(machine_config &config) m_ppi2->out_pc_callback().set(FUNC(dinaris_state::ppi2c_w)); NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_0); - HOPPER(config, m_hopper, attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW); + HOPPER(config, m_hopper, attotime::from_msec(100)); } ROM_START(dindice) diff --git a/src/mame/vtech/gamemachine.cpp b/src/mame/vtech/gamemachine.cpp index 1bcafe8121c..0d034018ec4 100644 --- a/src/mame/vtech/gamemachine.cpp +++ b/src/mame/vtech/gamemachine.cpp @@ -138,6 +138,10 @@ class gm_state : public driver_device optional_device_array m_sound_nl; required_ioport_array<2> m_inputs; + u16 m_mux = 0; + u8 m_seg_data = 0; + u8 m_sound_data = 0; + void main_map(address_map &map); void main_io(address_map &map); @@ -149,10 +153,6 @@ class gm_state : public driver_device void sound_w(u8 data); void discrete_w(u8 data); u8 sound_r(); - - u16 m_mux = 0; - u8 m_seg_data = 0; - u8 m_sound_data = 0; }; void gm_state::machine_start() diff --git a/src/mame/vtech/nl_gamemachine.cpp b/src/mame/vtech/nl_gamemachine.cpp index 0341a1a95be..b8d683013b4 100644 --- a/src/mame/vtech/nl_gamemachine.cpp +++ b/src/mame/vtech/nl_gamemachine.cpp @@ -10,7 +10,6 @@ NETLIST_START(gamemachine) { - /* Standard stuff */ SOLVER(Solver, 48000) @@ -87,6 +86,4 @@ NETLIST_START(gamemachine) NET_C(Q1.C, SPK1.2) NET_C(C8.1, R1.1, R3.2, IC1.5) - } -