Skip to content

Commit 347d50a

Browse files
committed
-igs/igs_m027xa.xpp: Fixed inputs for Crazy Bugs (V103JP).
* The hopper is hooked up because an input for it appears in the I/O test, however both the Payout and Ticket buttons seem to use the ticker dispenser to pay out credits. -machine/sc16is741.cpp: Implemented CTS/RTS deasserted interrupt. -bus/spectrum/musicmachine.cpp: Get device out of global namespace, and some cleanup. -lnux4004.xml: Include Linux distro in software item description.
1 parent 3526880 commit 347d50a

File tree

6 files changed

+129
-58
lines changed

6 files changed

+129
-58
lines changed

hash/lnux4004.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license:CC0-1.0
77
<softwarelist name="lnux4004" description="Linux/4004 SD Card images">
88

99
<software name="linux">
10-
<description>uMIPS Linux 4.4.292+</description>
10+
<description>Debian GNU/Linux 7 (Linux uMIPS 4.4.292+)</description>
1111
<year>2024</year>
1212
<publisher>Dmitry Grinberg</publisher>
1313
<part name="linux4004" interface="sdcard">

src/devices/bus/spectrum/musicmachine.cpp

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,39 @@
99
#include "musicmachine.h"
1010

1111
#include "bus/midi/midi.h"
12+
#include "machine/6850acia.h"
1213
#include "machine/clock.h"
14+
#include "sound/dac.h"
15+
1316
#include "speaker.h"
1417

1518

16-
//**************************************************************************
17-
// DEVICE DEFINITIONS
18-
//**************************************************************************
19+
namespace {
20+
21+
class spectrum_musicmachine_device : public device_t, public device_spectrum_expansion_interface
22+
{
23+
public:
24+
// construction/destruction
25+
spectrum_musicmachine_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
26+
27+
void write_acia_clock(u8 data);
28+
29+
protected:
30+
// device_t implementation
31+
virtual void device_start() override ATTR_COLD;
32+
virtual void device_reset() override ATTR_COLD;
33+
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
34+
35+
// device_spectrum_expansion_interface implementation
36+
virtual u8 iorq_r(offs_t offset) override;
37+
virtual void iorq_w(offs_t offset, u8 data) override;
1938

20-
DEFINE_DEVICE_TYPE(SPECTRUM_MUSICMACHINE, spectrum_musicmachine_device, "spectrummusic", "The Music Machine (ZX)")
39+
private:
40+
required_device<acia6850_device> m_acia;
41+
required_device<dac_byte_interface> m_dac;
42+
43+
bool m_irq_select;
44+
};
2145

2246

2347
void spectrum_musicmachine_device::device_add_mconfig(machine_config &config)
@@ -33,6 +57,7 @@ void spectrum_musicmachine_device::device_add_mconfig(machine_config &config)
3357
ZN429E(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.2);
3458
}
3559

60+
3661
//**************************************************************************
3762
// LIVE DEVICE
3863
//**************************************************************************
@@ -51,6 +76,7 @@ spectrum_musicmachine_device::spectrum_musicmachine_device(const machine_config
5176

5277
void spectrum_musicmachine_device::device_start()
5378
{
79+
save_item(NAME(m_irq_select));
5480
}
5581

5682
//-------------------------------------------------
@@ -70,7 +96,7 @@ void spectrum_musicmachine_device::write_acia_clock(u8 data)
7096

7197
u8 spectrum_musicmachine_device::iorq_r(offs_t offset)
7298
{
73-
u8 data = offset & 1 ? m_slot->fb_r() : 0xff;
99+
u8 data = (offset & 1) ? m_slot->fb_r() : 0xff;
74100

75101
switch (offset & 0xff)
76102
{
@@ -112,3 +138,12 @@ void spectrum_musicmachine_device::iorq_w(offs_t offset, u8 data)
112138
break;
113139
}
114140
}
141+
142+
} // anonymous namespace
143+
144+
145+
//**************************************************************************
146+
// DEVICE DEFINITIONS
147+
//**************************************************************************
148+
149+
DEFINE_DEVICE_TYPE_PRIVATE(SPECTRUM_MUSICMACHINE, device_spectrum_expansion_interface, spectrum_musicmachine_device, "spectrummusic", "The Music Machine (ZX)")

src/devices/bus/spectrum/musicmachine.h

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,8 @@
1313
#pragma once
1414

1515
#include "exp.h"
16-
#include "machine/6850acia.h"
17-
#include "sound/dac.h"
1816

19-
class spectrum_musicmachine_device : public device_t
20-
, public device_spectrum_expansion_interface
21-
{
22-
public:
23-
// construction/destruction
24-
spectrum_musicmachine_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
2517

26-
void write_acia_clock(u8 data);
27-
28-
protected:
29-
// device-level overrides
30-
virtual void device_start() override ATTR_COLD;
31-
virtual void device_reset() override ATTR_COLD;
32-
33-
// optional information overrides
34-
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
35-
36-
virtual u8 iorq_r(offs_t offset) override;
37-
virtual void iorq_w(offs_t offset, u8 data) override;
38-
39-
private:
40-
required_device<acia6850_device> m_acia;
41-
required_device<dac_byte_interface> m_dac;
42-
43-
bool m_irq_select;
44-
};
45-
46-
// device type definition
47-
DECLARE_DEVICE_TYPE(SPECTRUM_MUSICMACHINE, spectrum_musicmachine_device)
18+
DECLARE_DEVICE_TYPE(SPECTRUM_MUSICMACHINE, device_spectrum_expansion_interface)
4819

4920
#endif // MAME_BUS_SPECTRUM_MUSICMACHINE_H

src/devices/machine/sc16is741.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ enum sc16is741a_device::interrupt : u8
126126
INTERRUPT_MODEM_STATUS = 0x08,
127127
INTERRUPT_XOFF = 0x04,
128128
INTERRUPT_SPECIAL_CHAR = 0x02,
129-
INTERRUPT_RTS_CTS = 0x01
129+
INTERRUPT_CTS_RTS = 0x01
130130
};
131131

132132

@@ -254,6 +254,11 @@ void sc16is741a_device::cts_w(int state)
254254
if (bool(state) != bool(m_cts))
255255
{
256256
m_interrupts |= INTERRUPT_MODEM_STATUS;
257+
if (state && IER_CTS_INT() && !(m_interrupts & INTERRUPT_CTS_RTS))
258+
{
259+
LOG("CTS deasserted, setting CTS interrupt\n");
260+
m_interrupts |= INTERRUPT_CTS_RTS;
261+
}
257262
update_irq();
258263
}
259264
m_cts = state ? 1 : 0;
@@ -572,13 +577,21 @@ inline void sc16is741a_device::iir_r(bool first)
572577
else if (IER_THR_INT() && (m_interrupts & INTERRUPT_THR))
573578
{
574579
m_buffer |= 0x02;
580+
575581
LOG("clearing THR interrupt\n");
576582
m_interrupts &= ~INTERRUPT_THR;
577583
}
578584
else if (IER_MODEM_STATUS_INT() && (m_interrupts & INTERRUPT_MODEM_STATUS))
579585
{
580586
m_buffer |= 0x00;
581587
}
588+
else if ((IER_CTS_INT() || IER_RTS_INT()) && (m_interrupts & INTERRUPT_CTS_RTS))
589+
{
590+
m_buffer |= 0x20;
591+
592+
LOG("clearing CTS/RTS interrupt\n");
593+
m_interrupts &= ~INTERRUPT_CTS_RTS;
594+
}
582595

583596
LOG("read IIR (0x%1$02x)\n", m_buffer);
584597
}
@@ -1144,12 +1157,24 @@ TIMER_CALLBACK_MEMBER(sc16is741a_device::rx_shift)
11441157
if (level >= (trigger * 4))
11451158
{
11461159
LOG("RX FIFO level %1$u exceeds %2$u*4, deasserting RTS\n", level, trigger);
1160+
if (IER_RTS_INT() && !(m_interrupts & INTERRUPT_CTS_RTS))
1161+
{
1162+
LOG("setting RTS interrupt\n");
1163+
m_interrupts |= INTERRUPT_CTS_RTS;
1164+
update_irq();
1165+
}
11471166
set_rts(1);
11481167
}
11491168
}
11501169
else
11511170
{
11521171
LOG("RHR full, deasserting RTS\n");
1172+
if (IER_RTS_INT() && !(m_interrupts & INTERRUPT_CTS_RTS))
1173+
{
1174+
LOG("setting RTS interrupt\n");
1175+
m_interrupts |= INTERRUPT_CTS_RTS;
1176+
update_irq();
1177+
}
11531178
set_rts(1);
11541179
}
11551180
}

src/mame/hitachi/bml3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#include "bus/bml3/bml3bus.h"
1010
#include "imagedev/cassette.h"
1111
#include "machine/6850acia.h"
12+
#include "machine/timer.h"
1213
#include "sound/spkrdev.h"
1314
#include "sound/ymopn.h"
14-
#include "machine/timer.h"
1515
#include "video/mc6845.h"
1616

1717
#include "emupal.h"

src/mame/igs/igs_m027xa.cpp

Lines changed: 60 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ These games use the IGS027A processor.
99
Triple Fever (V105US) (tripfevb) hangs after paying out tickets, with the MCU
1010
apparently attempting serial communication with something.
1111
12+
TODO:
13+
* Does crzybugsj actually support a hopper? It shows in the input test, but
14+
both the Payout and Ticket buttons seem to use the ticket dispenser.
1215
*/
1316

1417
#include "emu.h"
@@ -31,9 +34,6 @@ apparently attempting serial communication with something.
3134
#include "crzybugs.lh"
3235
#include "tripfev.lh"
3336

34-
#define LOG_DEBUG (1U << 1)
35-
//#define VERBOSE (LOG_DEBUG)
36-
#include "logmacro.h"
3737

3838
namespace {
3939

@@ -49,14 +49,16 @@ class igs_m027xa_state : public driver_device
4949
m_oki(*this, "oki"),
5050
m_screen(*this, "screen"),
5151
m_ticket(*this, "ticket"),
52+
m_hopper(*this, "hopper"),
5253
m_external_rom(*this, "user1"),
5354
m_io_test(*this, "TEST%u", 0U),
5455
m_io_dsw(*this, "DSW%u", 1U),
5556
m_out_lamps(*this, "lamp%u", 1U)
5657
{ }
5758

58-
void igs_mahjong_xa(machine_config &config);
59-
void igs_mahjong_xa_xor(machine_config &config);
59+
void base(machine_config &config);
60+
void base_xor(machine_config &config);
61+
void hopper_xor(machine_config &config);
6062

6163
void init_crzybugs();
6264
void init_crzybugsj();
@@ -77,6 +79,7 @@ class igs_m027xa_state : public driver_device
7779
required_device<okim6295_device> m_oki;
7880
required_device<screen_device> m_screen;
7981
optional_device<ticket_dispenser_device> m_ticket;
82+
optional_device<hopper_device> m_hopper;
8083
required_region_ptr<u32> m_external_rom;
8184

8285
optional_ioport_array<3> m_io_test;
@@ -226,13 +229,19 @@ INPUT_PORTS_START( crzybugs )
226229

227230
PORT_MODIFY("TEST1")
228231
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Stop All Reels")
229-
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Ticket")
230232
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)
231233

232234
PORT_MODIFY("TEST2")
233235
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Small")
234236
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Take Score")
235237
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Double Up")
238+
INPUT_PORTS_END
239+
240+
INPUT_PORTS_START( crzybugs_us )
241+
PORT_INCLUDE(crzybugs)
242+
243+
PORT_MODIFY("TEST1")
244+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Ticket")
236245

237246
PORT_MODIFY("DSW1")
238247
PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1")
@@ -278,6 +287,30 @@ INPUT_PORTS_START( crzybugs )
278287
PORT_DIPSETTING( 0x00, DEF_STR(Yes) )
279288
INPUT_PORTS_END
280289

290+
INPUT_PORTS_START( crzybugs_jp )
291+
PORT_INCLUDE(crzybugs)
292+
293+
PORT_MODIFY("TEST0")
294+
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r)
295+
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
296+
297+
PORT_MODIFY("TEST1")
298+
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Ticket")
299+
300+
PORT_MODIFY("DSW1")
301+
PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1")
302+
PORT_DIPSETTING( 0x00, DEF_STR(Off) )
303+
PORT_DIPSETTING( 0x01, DEF_STR(On) )
304+
PORT_DIPNAME( 0x06, 0x06, "Symbol" ) PORT_DIPLOCATION("SW1:2,3")
305+
PORT_DIPSETTING( 0x00, "Both" )
306+
PORT_DIPSETTING( 0x02, "Both (duplicate)" )
307+
PORT_DIPSETTING( 0x04, "Fruit" )
308+
PORT_DIPSETTING( 0x06, "Bug" )
309+
PORT_DIPNAME( 0x08, 0x08, "Hold Pair" ) PORT_DIPLOCATION("SW1:4")
310+
PORT_DIPSETTING( 0x08, DEF_STR(Off) )
311+
PORT_DIPSETTING( 0x00, "Regular" )
312+
INPUT_PORTS_END
313+
281314
INPUT_PORTS_START( tripfev )
282315
PORT_INCLUDE(base)
283316

@@ -436,7 +469,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(igs_m027xa_state::interrupt)
436469
}
437470

438471

439-
void igs_m027xa_state::igs_mahjong_xa(machine_config &config)
472+
void igs_m027xa_state::base(machine_config &config)
440473
{
441474
IGS027A(config, m_maincpu, 22'000'000); // Crazy Bugs has a 22MHz crystal, what about the others?
442475
m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027xa_state::main_map);
@@ -479,13 +512,20 @@ void igs_m027xa_state::igs_mahjong_xa(machine_config &config)
479512
OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5);
480513
}
481514

482-
void igs_m027xa_state::igs_mahjong_xa_xor(machine_config &config)
515+
void igs_m027xa_state::base_xor(machine_config &config)
483516
{
484-
igs_mahjong_xa(config);
517+
base(config);
485518

486519
m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027xa_state::main_xor_map);
487520
}
488521

522+
void igs_m027xa_state::hopper_xor(machine_config &config)
523+
{
524+
base_xor(config);
525+
526+
HOPPER(config, m_hopper, attotime::from_msec(50));
527+
}
528+
489529
// prg at u34
490530
// text at u15
491531
// cg at u32 / u12
@@ -733,7 +773,7 @@ void igs_m027xa_state::pgm_create_dummy_internal_arm_region()
733773
for (int i = 0; i < 0x4000 / 2; i += 2)
734774
{
735775
temp16[i] = 0xff1e;
736-
temp16[i +1] = 0xe12f;
776+
temp16[i + 1] = 0xe12f;
737777

738778
}
739779

@@ -788,17 +828,17 @@ void igs_m027xa_state::init_wldfruit()
788828

789829
// These use the MX10EXAQC (80c51XA from Philips)
790830
// the PCBs are closer to igs_fear.cpp in terms of layout
791-
GAME( 2008, haunthig, 0, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V109US)", MACHINE_NOT_WORKING ) // IGS FOR V109US 2008 10 14
792-
GAME( 2006, haunthiga, haunthig, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V101US)", MACHINE_NOT_WORKING ) // IGS FOR V101US 2006 08 23
831+
GAME( 2008, haunthig, 0, base, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V109US)", MACHINE_NOT_WORKING ) // IGS FOR V109US 2008 10 14
832+
GAME( 2006, haunthiga, haunthig, base, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V101US)", MACHINE_NOT_WORKING ) // IGS FOR V101US 2006 08 23
793833

794-
GAMEL( 2009, crzybugs, 0, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V204US)", 0, layout_crzybugs ) // IGS FOR V204US 2009 5 19
795-
GAMEL( 2006, crzybugsa, crzybugs, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V202US)", 0, layout_crzybugs ) // IGS FOR V100US 2006 3 29 but also V202US string
796-
GAMEL( 2005, crzybugsb, crzybugs, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V200US)", 0, layout_crzybugs ) // FOR V100US 2005 7 20 but also V200US string
834+
GAMEL( 2009, crzybugs, 0, base_xor, crzybugs_us, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V204US)", 0, layout_crzybugs ) // IGS FOR V204US 2009 5 19
835+
GAMEL( 2006, crzybugsa, crzybugs, base_xor, crzybugs_us, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V202US)", 0, layout_crzybugs ) // IGS FOR V100US 2006 3 29 but also V202US string
836+
GAMEL( 2005, crzybugsb, crzybugs, base_xor, crzybugs_us, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V200US)", 0, layout_crzybugs ) // FOR V100US 2005 7 20 but also V200US string
797837

798-
GAMEL( 2007, crzybugsj, crzybugs, igs_mahjong_xa_xor, crzybugs, igs_m027xa_state, init_crzybugsj, ROT0, "IGS", "Crazy Bugs (V103JP)", 0, layout_crzybugs ) // IGS FOR V101JP 2007 06 08 (test mode calls this V102JP, ROM label was V103JP)
838+
GAMEL( 2007, crzybugsj, crzybugs, hopper_xor, crzybugs_jp, igs_m027xa_state, init_crzybugsj, ROT0, "IGS", "Crazy Bugs (V103JP)", 0, layout_crzybugs ) // IGS FOR V101JP 2007 06 08 (test mode calls this V102JP, ROM label was V103JP)
799839

800-
GAMEL( 2006, tripfev, 0, igs_mahjong_xa_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V108US)", 0, layout_tripfev )
801-
GAMEL( 2006, tripfeva, tripfev, igs_mahjong_xa_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V107US)", 0, layout_tripfev ) // IGS FOR V107US 2006 09 07
802-
GAMEL( 2006, tripfevb, tripfev, igs_mahjong_xa_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V105US)", MACHINE_NOT_WORKING, layout_tripfev )
840+
GAMEL( 2006, tripfev, 0, base_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V108US)", 0, layout_tripfev )
841+
GAMEL( 2006, tripfeva, tripfev, base_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V107US)", 0, layout_tripfev ) // IGS FOR V107US 2006 09 07
842+
GAMEL( 2006, tripfevb, tripfev, base_xor, tripfev, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V105US)", MACHINE_NOT_WORKING, layout_tripfev )
803843

804-
GAME( 200?, wldfruit, 0, igs_mahjong_xa, base, igs_m027xa_state, init_wldfruit, ROT0, "IGS", "Wild Fruit (V208US)", MACHINE_NOT_WORKING ) // IGS-----97----V208US
844+
GAME( 200?, wldfruit, 0, base, base, igs_m027xa_state, init_wldfruit, ROT0, "IGS", "Wild Fruit (V208US)", MACHINE_NOT_WORKING ) // IGS-----97----V208US

0 commit comments

Comments
 (0)