cheekyms: add preliminary netlist sound based on schematics provided by Sam Grech

(nw) It doesn't work quite right yet.  The "Hammer" and "Pest" sounds
are generated by free-running 555/556 timers and gated with LM324
applifiers.  For whatever reason, the netlist system produces a kind of
buzzing from the "Hammer" circuit when it's supposed to be suppressed,
and it doesn't think the pest sound should be suppressed completely so
you can always hear it at a low level in the background.  The "Cheese"
circuit is a bit weird - either they're using the base-emitter junction
of a 2SC945 as a signal diode, or there's an error in the schematic
(collector is shown unconnected).  Connecting this part of the circuit
causes the netlist system to hang, so R2/R3/C8/Q2 are not connected for
now.
This commit is contained in:
Vas Crabb 2017-05-26 16:34:14 +10:00
parent 504071e721
commit 308c2bb72d
11 changed files with 446 additions and 55 deletions

View File

@ -4073,6 +4073,10 @@ files {
createMAMEProjects(_target, _subtarget, "univers")
files {
MAME_DIR .. "src/mame/audio/cheekyms.cpp",
MAME_DIR .. "src/mame/audio/cheekyms.h",
MAME_DIR .. "src/mame/audio/nl_cheekyms.cpp",
MAME_DIR .. "src/mame/audio/nl_cheekyms.h",
MAME_DIR .. "src/mame/drivers/cheekyms.cpp",
MAME_DIR .. "src/mame/includes/cheekyms.h",
MAME_DIR .. "src/mame/video/cheekyms.cpp",

0
src/lib/netlist/nl_base.h Executable file → Normal file
View File

0
src/lib/netlist/nl_factory.cpp Executable file → Normal file
View File

0
src/lib/netlist/nl_factory.h Executable file → Normal file
View File

View File

@ -0,0 +1,64 @@
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
#include "emu.h"
#include "audio/cheekyms.h"
#include "audio/nl_cheekyms.h"
#include "speaker.h"
DEFINE_DEVICE_TYPE(CHEEKY_MOUSE_AUDIO, cheekyms_audio_device, "cheekyms_audio", "Cheeky Mouse Sound Board")
cheekyms_audio_device::cheekyms_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, CHEEKY_MOUSE_AUDIO, tag, owner, clock)
, m_mute(*this, "sound_nl:mute")
, m_cheese(*this, "sound_nl:cheese")
, m_music(*this, "sound_nl:music")
, m_mouse(*this, "sound_nl:mouse")
, m_hammer(*this, "sound_nl:hammer")
, m_pest(*this, "sound_nl:pest")
, m_mouse_dies(*this, "sound_nl:mouse_dies")
, m_pest_dies(*this, "sound_nl:pest_dies")
, m_coin_extra(*this, "sound_nl:coin_extra")
{
}
WRITE_LINE_MEMBER(cheekyms_audio_device::mute_w) { m_mute->write_line(state); }
WRITE_LINE_MEMBER(cheekyms_audio_device::cheese_w) { m_cheese->write_line(state); }
WRITE_LINE_MEMBER(cheekyms_audio_device::music_w) { m_music->write_line(state); }
WRITE_LINE_MEMBER(cheekyms_audio_device::mouse_w) { m_mouse->write_line(state); }
WRITE_LINE_MEMBER(cheekyms_audio_device::hammer_w) { m_hammer->write_line(state); }
WRITE_LINE_MEMBER(cheekyms_audio_device::pest_w) { m_pest->write_line(state); }
WRITE_LINE_MEMBER(cheekyms_audio_device::mouse_dies_w) { m_mouse_dies->write_line(state); }
WRITE_LINE_MEMBER(cheekyms_audio_device::pest_dies_w) { m_pest_dies->write_line(state); }
WRITE_LINE_MEMBER(cheekyms_audio_device::coin_extra_w) { m_coin_extra->write_line(state); }
MACHINE_CONFIG_MEMBER(cheekyms_audio_device::device_add_mconfig)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("sound_nl", NETLIST_SOUND, 48000)
MCFG_NETLIST_SETUP(cheekyms)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "mute", "I_MUTE.IN", 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "cheese", "I_CHEESE.IN", 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "music", "I_MUSIC.IN", 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "mouse", "I_MOUSE.IN", 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "hammer", "I_HAMMER.IN", 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "pest", "I_PEST.IN", 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "mouse_dies", "I_MOUSE_DIES.IN", 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "pest_dies", "I_PEST_DIES.IN", 0)
MCFG_NETLIST_LOGIC_INPUT("sound_nl", "coin_extra", "I_COIN_EXTRA.IN", 0)
MCFG_NETLIST_STREAM_OUTPUT("sound_nl", 0, "VR1.2")
MCFG_NETLIST_ANALOG_MULT_OFFSET(30000.0 * 10.0, 0.0) // FIXME: no clue what numbers to use here
MACHINE_CONFIG_END
void cheekyms_audio_device::device_start()
{
}

44
src/mame/audio/cheekyms.h Normal file
View File

@ -0,0 +1,44 @@
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
#ifndef MAME_AUDIO_CHEEKYMS_H
#define MAME_AUDIO_CHEEKYMS_H
#pragma once
#include "machine/netlist.h"
class cheekyms_audio_device : public device_t
{
public:
cheekyms_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_WRITE_LINE_MEMBER(mute_w); // 15
DECLARE_WRITE_LINE_MEMBER(cheese_w); // 13
DECLARE_WRITE_LINE_MEMBER(music_w); // 14
DECLARE_WRITE_LINE_MEMBER(mouse_w); // 9
DECLARE_WRITE_LINE_MEMBER(hammer_w); // 12
DECLARE_WRITE_LINE_MEMBER(pest_w); // 8
DECLARE_WRITE_LINE_MEMBER(mouse_dies_w); // 11
DECLARE_WRITE_LINE_MEMBER(pest_dies_w); // 10
DECLARE_WRITE_LINE_MEMBER(coin_extra_w); // 16
protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
private:
required_device<netlist_mame_logic_input_device> m_mute;
required_device<netlist_mame_logic_input_device> m_cheese;
required_device<netlist_mame_logic_input_device> m_music;
required_device<netlist_mame_logic_input_device> m_mouse;
required_device<netlist_mame_logic_input_device> m_hammer;
required_device<netlist_mame_logic_input_device> m_pest;
required_device<netlist_mame_logic_input_device> m_mouse_dies;
required_device<netlist_mame_logic_input_device> m_pest_dies;
required_device<netlist_mame_logic_input_device> m_coin_extra;
};
DECLARE_DEVICE_TYPE(CHEEKY_MOUSE_AUDIO, cheekyms_audio_device)
#endif // MAME_AUDIO_CHEEKYMS_H

View File

@ -0,0 +1,266 @@
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
#include "audio/nl_cheekyms.h"
#include "netlist/devices/net_lib.h"
#ifndef __PLIB_PREPROCESSOR__
#endif
NETLIST_START(cheekyms_schematics)
// Shared chips
TTL_7404_DIP(IC1)
LM324_DIP(IC5)
NET_C(IC1.14, IC5.4, I_V5.Q)
NET_C(IC1.7, IC5.11, GND)
// shut the netlist parser up about unconnected inputs
NET_C(I_V5.Q, IC1.11, IC1.13)
// Mute
RES(R1, RES_K(10))
CAP(C10, CAP_U(10))
QBJT_EB(Q1, "2SC945")
NET_C(IC1.2, R1.1)
NET_C(R1.2, C10.1, Q1.B)
NET_C(C10.2, Q1.E, GND)
// Cheese
#if 0
// FIXME: Not working right, causes the netlist system to die
// Note that the collector of Q2 is not connected, they're just using the base-emitter junction as a diode
// Well, either that or there's an error in the schematic
RES(R2, RES_M(1))
RES(R3, RES_K(1))
RES(R4, RES_K(100))
RES(R5, RES_K(1))
RES(R6, RES_K(100))
RES(R7, RES_K(1))
RES(R8, RES_M(1))
RES(R9, RES_K(10))
RES(R10, RES_K(10))
RES(R11, RES_K(10))
RES(R12, RES_K(100))
CAP(C8, CAP_U(0.1))
CAP(C9, CAP_U(0.1))
CAP(C11, CAP_U(0.1))
QBJT_EB(Q2, "2SC945")
NET_C(R2.1, I_VPLUS.Q)
NET_C(R2.2, C8.1, Q2.E)
NET_C(R3.1, C8.2)
NET_C(R3.2, R4.1, IC5.10)
NET_C(R5.2, R6.1, IC5.9)
NET_C(R6.2, C9.1, IC5.8)
NET_C(R7.1, C9.2)
NET_C(R7.2, R8.1, IC5.13)
NET_C(R8.2, C11.1, IC5.14)
NET_C(R10.2, IC1.4)
NET_C(R9.1, R10.1, IC5.12)
NET_C(R9.2, I_V5.Q)
NET_C(R11.1, R12.1, C11.2)
NET_C(R4.2, R5.1, R11.2, Q2.B, GND)
#else
// Rip out just enough to make it not blow up
RES(R4, RES_K(100))
RES(R5, RES_K(1))
RES(R6, RES_K(100))
RES(R7, RES_K(1))
RES(R8, RES_M(1))
RES(R9, RES_K(10))
RES(R10, RES_K(10))
RES(R11, RES_K(10))
RES(R12, RES_K(100))
CAP(C9, CAP_U(0.1))
CAP(C11, CAP_U(0.1))
NET_C(R4.1, IC5.10)
NET_C(R5.2, R6.1, IC5.9)
NET_C(R6.2, C9.1, IC5.8)
NET_C(R7.1, C9.2)
NET_C(R7.2, R8.1, IC5.13)
NET_C(R8.2, C11.1, IC5.14)
NET_C(R10.1, IC1.4)
NET_C(R9.1, R10.2, IC5.12)
NET_C(R9.2, I_V5.Q)
NET_C(R11.1, R12.1, C11.2)
NET_C(R4.2, R5.1, R11.2, GND)
#endif
// Music
RES(R13, RES_K(100))
// Mouse
RES(R14, RES_K(4.7))
RES(R15, RES_K(1))
RES(R16, RES_K(68))
RES(R17, RES_K(100))
CAP(C12, CAP_U(0.01))
CAP(C13, CAP_U(10))
DIODE(D4, "1S1588")
NE555(IC4_1) // one half of a 556 (other half does coin & extra)
NET_C(D4.K, R14.1, IC4_1.RESET)
NET_C(D4.A, R14.2, C13.1, IC4_1.CONT)
NET_C(R15.1, IC4_1.VCC, I_V5.Q)
NET_C(R15.2, R16.1, IC4_1.DISCH)
NET_C(R16.2, C12.1, IC4_1.TRIG, IC4_1.THRESH)
NET_C(C13.2, C12.2, IC4_1.GND, GND)
NET_C(R17.1, IC4_1.OUT)
// Hammer
RES(R18, RES_K(1))
RES(R19, RES_K(150))
RES(R20, RES_K(10))
RES(R21, RES_K(100))
RES(R22, RES_K(100))
RES(R23, RES_M(1))
RES(R24, RES_K(51))
CAP(C14, CAP_U(0.01))
CAP(C15, CAP_U(0.01))
CAP(C16, CAP_U(0.1))
DIODE(D5, "1S1588")
DIODE(D6, "1S1588")
NE555(IC6_1) // one half of a 556 (other half does pest)
NET_C(R18.1, R23.1, IC6_1.RESET, IC6_1.VCC, I_V5.Q)
NET_C(R18.2, R19.1, IC6_1.DISCH)
NET_C(R19.2, C14.1, IC6_1.TRIG, IC6_1.THRESH)
NET_C(R20.1, IC6_1.OUT)
NET_C(R20.2, R21.1, C15.1)
NET_C(R21.2, R22.1, IC5.6)
NET_C(R22.2, R24.1, IC5.7)
NET_C(D5.K, IC1.6)
NET_C(D5.A, D6.K)
NET_C(R23.2, C16.1, D6.A, IC5.5)
NET_C(C14.2, C15.2, C16.2, IC6_1.GND, GND)
// Pest
RES(R25, RES_K(20))
RES(R26, RES_K(10))
RES(R27, 220)
RES(R28, RES_K(100))
RES(R29, RES_K(4.7))
RES(R30, RES_K(1))
RES(R31, RES_K(68))
RES(R32, RES_K(100))
RES(R33, RES_K(100))
RES(R34, RES_K(51))
RES(R35, RES_M(1))
CAP(C17, CAP_U(2.2))
CAP(C18, CAP_U(10))
CAP(C19, CAP_U(0.01))
CAP(C20, CAP_U(0.22))
DIODE(D7, "1S1588")
DIODE(D8, "1S1588")
DIODE(D9, "1S1588")
NE555(IC3)
NE555(IC6_2) // one half of a 556 (other half does hammer)
NET_C(R25.1, R29.1, R30.1, R35.2, IC3.RESET, IC3.VCC, IC6_2.RESET, IC6_2.VCC, I_V5.Q)
NET_C(R25.2, R26.1, IC3.DISCH)
NET_C(R26.2, C17.1, IC3.TRIG, IC3.THRESH)
NET_C(R27.1, R28.1, IC3.OUT)
NET_C(R27.2, D7.K)
NET_C(R28.2, R29.2, C18.1, D7.A, IC6_2.CONT)
NET_C(R30.2, R31.1, IC6_2.DISCH)
NET_C(R31.2, C19.1, IC6_2.TRIG, IC6_2.THRESH)
NET_C(R32.1, IC6_2.OUT)
NET_C(R32.2, R33.1, IC5.2)
NET_C(R33.2, R34.1, IC5.1)
NET_C(D8.K, IC1.8)
NET_C(D8.A, D9.K)
NET_C(R35.1, C20.1, D9.A, IC5.3)
NET_C(C17.2, C18.2, C19.2, C20.2, IC3.GND, IC6_2.GND, GND)
// Mouse dies
RES(R36, RES_K(1))
RES(R37, RES_K(33))
RES(R38, 560)
RES(R39, RES_K(100))
CAP(C21, CAP_U(0.01))
CAP(C22, CAP_U(47))
NE555(IC2_2) // one half of a 556 (other half does pest dies)
NET_C(R38.1, IC2_2.RESET)
NET_C(R38.2, C22.1, IC2_2.CONT)
NET_C(R36.1, IC2_2.VCC, I_V5.Q)
NET_C(R36.2, R37.1, IC2_2.DISCH)
NET_C(R37.2, C21.1, IC2_2.TRIG, IC2_2.THRESH)
NET_C(C22.2, C21.2, IC2_2.GND, GND)
NET_C(R39.1, IC2_2.OUT)
// Pest dies
RES(R40, RES_K(1))
RES(R41, RES_K(47))
RES(R42, RES_K(100))
CAP(C23, CAP_U(0.033))
NE555(IC2_1) // one half of a 556 (other half does mouse dies)
NET_C(R40.1, IC2_1.VCC, I_V5.Q)
NET_C(R40.2, R41.1, IC2_1.DISCH)
NET_C(R41.2, C23.1, IC2_1.TRIG, IC2_1.THRESH)
NET_C(C23.2, IC2_1.GND, GND)
NET_C(R42.1, IC2_1.OUT)
// Coin & extra
RES(R44, RES_K(1))
RES(R45, RES_K(47))
RES(R46, RES_K(100))
CAP(C24, CAP_U(0.01))
NE555(IC4_2) // one half of a 556 (other half does mouse)
NET_C(R44.1, IC4_2.VCC, I_V5.Q)
NET_C(R44.2, R45.1, IC4_2.DISCH)
NET_C(R45.2, C24.1, IC4_2.TRIG, IC4_2.THRESH)
NET_C(C24.2, IC4_2.GND, GND)
NET_C(R46.1, IC4_2.OUT)
// Mixdown
RES(R43, RES_K(10))
POT(VR1, RES_K(1))
NET_C(R12.2, R13.2, R17.2, R24.2, R34.2, R39.2, R42.2, R43.1, Q1.C)
NET_C(R46.2, R43.2, VR1.1)
NET_C(VR1.3, GND)
NETLIST_END()
NETLIST_START(cheekyms)
SOLVER(Solver, 18000)
PARAM(Solver.ACCURACY, 1e-8)
PARAM(Solver.NR_LOOPS, 300)
PARAM(Solver.GS_LOOPS, 1)
PARAM(Solver.METHOD, "MAT_CR")
PARAM(Solver.PARALLEL, 0)
PARAM(Solver.SOR_FACTOR, 1.00)
PARAM(Solver.DYNAMIC_TS, 0)
PARAM(Solver.DYNAMIC_LTE, 5e-4)
PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 20e-6)
LOCAL_SOURCE(cheekyms_schematics)
ANALOG_INPUT(I_V5, 5)
ANALOG_INPUT(I_VPLUS, 12.9) // very approximate - 15V dropped by three diodes and filtered
//ANALOG_INPUT(I_V0, 0)
ALIAS(I_V0.Q, GND)
INCLUDE(cheekyms_schematics)
LOGIC_INPUT(I_MUTE, 1, "74XX") // FIXME: need 74LS family model (half the sink capability)
LOGIC_INPUT(I_CHEESE, 1, "74XX") // FIXME: need 74LS family model (half the sink capability)
LOGIC_INPUT(I_MUSIC, 1, "74XX") // FIXME: need 74LS family model (half the sink capability)
LOGIC_INPUT(I_MOUSE, 1, "74XX") // FIXME: need 74LS family model (half the sink capability)
LOGIC_INPUT(I_HAMMER, 1, "74XX") // FIXME: need 74LS family model (half the sink capability)
LOGIC_INPUT(I_PEST, 1, "74XX") // FIXME: need 74LS family model (half the sink capability)
LOGIC_INPUT(I_MOUSE_DIES, 1, "74XX") // FIXME: need 74LS family model (half the sink capability)
LOGIC_INPUT(I_PEST_DIES, 1, "74XX") // FIXME: need 74LS family model (half the sink capability)
LOGIC_INPUT(I_COIN_EXTRA, 1, "74XX") // FIXME: need 74LS family model (half the sink capability)
NET_C(I_MUTE.Q, IC1.1)
NET_C(I_CHEESE.Q, IC1.3)
NET_C(I_MUSIC.Q, R13.1)
NET_C(I_MOUSE.Q, IC4_1.RESET)
NET_C(I_HAMMER.Q, IC1.5)
NET_C(I_PEST.Q, IC1.9)
NET_C(I_MOUSE_DIES.Q, IC2_2.RESET)
NET_C(I_PEST_DIES.Q, IC2_1.RESET)
NET_C(I_COIN_EXTRA.Q, IC4_2.RESET)
NETLIST_END()

View File

@ -0,0 +1,12 @@
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
#ifndef MAME_AUDIO_NL_CHEEKYMS_H
#define MAME_AUDIO_NL_CHEEKYMS_H
#pragma once
#include "netlist/nl_setup.h"
NETLIST_EXTERNAL(cheekyms)
#endif // MAME_AUDIO_NL_CHEEKYMS_H

View File

@ -10,8 +10,6 @@
#include "includes/cheekyms.h"
#include "cpu/z80/z80.h"
#include "sound/volt_reg.h"
#include "speaker.h"
INPUT_CHANGED_MEMBER(cheekyms_state::coin_inserted)
@ -144,6 +142,8 @@ static MACHINE_CONFIG_START( cheekyms )
MCFG_PALETTE_INIT_OWNER(cheekyms_state, cheekyms)
/* audio hardware */
MCFG_DEVICE_ADD("soundboard", CHEEKY_MOUSE_AUDIO, 0)
#if 0
MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("dac0", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.25)
@ -163,6 +163,7 @@ static MACHINE_CONFIG_START( cheekyms )
MCFG_SOUND_ROUTE_EX(0, "dac5", 1.0, DAC_VREF_POS_INPUT)
MCFG_SOUND_ROUTE_EX(0, "dac6", 1.0, DAC_VREF_POS_INPUT)
MCFG_SOUND_ROUTE_EX(0, "dac7", 1.0, DAC_VREF_POS_INPUT)
#endif
MACHINE_CONFIG_END

View File

@ -5,7 +5,12 @@
Cheeky Mouse
*************************************************************************/
#ifndef MAME_INCLUDES_CHEEKYMS_H
#define MAME_INCLUDES_CHEEKYMS_H
#pragma once
#include "audio/cheekyms.h"
#include "sound/dac.h"
#include "screen.h"
@ -13,47 +18,17 @@ class cheekyms_state : public driver_device
{
public:
cheekyms_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_dac0(*this, "dac0"),
m_dac1(*this, "dac1"),
m_dac2(*this, "dac2"),
m_dac3(*this, "dac3"),
m_dac4(*this, "dac4"),
m_dac5(*this, "dac5"),
m_dac6(*this, "dac6"),
m_dac7(*this, "dac7"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_port_80(*this, "port_80") { }
/* devices */
required_device<cpu_device> m_maincpu;
required_device<dac_bit_interface> m_dac0;
required_device<dac_bit_interface> m_dac1;
required_device<dac_bit_interface> m_dac2;
required_device<dac_bit_interface> m_dac3;
required_device<dac_bit_interface> m_dac4;
required_device<dac_bit_interface> m_dac5;
required_device<dac_bit_interface> m_dac6;
required_device<dac_bit_interface> m_dac7;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
/* memory pointers */
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_port_80;
/* video-related */
tilemap_t *m_cm_tilemap;
std::unique_ptr<bitmap_ind16> m_bitmap_buffer;
uint8_t m_irq_mask;
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_sound_board(*this, "soundboard")
, m_gfxdecode(*this, "gfxdecode")
, m_screen(*this, "screen")
, m_palette(*this, "palette")
, m_videoram(*this, "videoram")
, m_spriteram(*this, "spriteram")
, m_port_80(*this, "port_80")
{
}
DECLARE_WRITE8_MEMBER(port_40_w);
DECLARE_WRITE8_MEMBER(port_80_w);
@ -63,10 +38,34 @@ public:
TILE_GET_INFO_MEMBER(get_tile_info);
virtual void machine_start() override;
virtual void video_start() override;
DECLARE_PALETTE_INIT(cheekyms);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int flip );
protected:
virtual void machine_start() override;
virtual void video_start() override;
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int flip);
private:
// devices
required_device<cpu_device> m_maincpu;
required_device<cheekyms_audio_device> m_sound_board;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
// memory pointers
required_shared_ptr<uint8_t> m_videoram;
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_port_80;
// video-related
tilemap_t *m_cm_tilemap;
std::unique_ptr<bitmap_ind16> m_bitmap_buffer;
uint8_t m_irq_mask;
};
#endif // MAME_INCLUDES_CHEEKYMS_H

View File

@ -40,20 +40,21 @@ PALETTE_INIT_MEMBER(cheekyms_state, cheekyms)
WRITE8_MEMBER(cheekyms_state::port_40_w)
{
m_dac0->write(BIT(data, 7)); // tune
m_dac1->write(BIT(data, 6)); // mouse eating cheese
m_dac2->write(BIT(data, 5)); // hammer
m_dac3->write(BIT(data, 4)); // mouse died
m_dac4->write(BIT(data, 3)); // mystery died
m_dac5->write(BIT(data, 2)); // mouse appears
m_dac6->write(BIT(data, 1)); // mystery appears
m_dac7->write(BIT(data, 0));
m_sound_board->music_w(BIT(data, 7));
m_sound_board->cheese_w(BIT(data, 6));
m_sound_board->hammer_w(BIT(data, 5));
m_sound_board->mouse_dies_w(BIT(data, 4));
m_sound_board->pest_dies_w(BIT(data, 3));
m_sound_board->mouse_w(BIT(data, 2));
m_sound_board->pest_w(BIT(data, 1));
}
WRITE8_MEMBER(cheekyms_state::port_80_w)
{
/* d0-d1 - sound enables, not sure which bit is which */
m_sound_board->coin_extra_w(BIT(data, 1));
m_sound_board->mute_w(BIT(data, 0));
/* d3-d5 - man scroll amount */
/* d6 - palette select (selects either 0 = PROM M9, 1 = PROM M8) */
/* d7 - screen flip */