mirror of
https://github.com/holub/mame
synced 2025-04-19 07:00:31 +03:00
(nw) misc stuff:
* screen: validate crystal values used for set_raw * driver: get rid of sound start/reset overrides in machine configuration * vrender0.cpp, nexus3d.cpp: corrected pixel clock crystal value * mw8080bw.cpp: turned several audio subsystems into devices * bus/sat_ctrl: don't start subdevices in device_start - the machine does it for you * mb14241.cpp: simplify handlers * fgoal.cpp: updated for simplified handlers * devfind, screen: repair some doxy comments that had rotted with refactoring * doxygen: disable warnings for undocumented things - it's most of our codebase * snowbros.cpp: restore an output level setting lost in MCFG removal There's an outstanding validation error from the HP98543 DIO video card not using a valid crystal value. Someone needs to find a picture of the card and confirm or deny the existence of the 39.504MHz crystal. The various start/reset overrides are bugs waiting to happen. It's not immediately obvious that the ones run earlier can end up being called multiple times if subsequent ones throw missing dependencies exceptions. They're a relic of when everything from the old C-style drivers was thrown into classes all jumbled together.
This commit is contained in:
parent
a110c8923c
commit
f43b28ed4a
@ -689,7 +689,7 @@ WARNINGS = YES
|
||||
# will automatically be disabled.
|
||||
# The default value is: YES.
|
||||
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_UNDOCUMENTED = NO
|
||||
|
||||
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
|
||||
# potential errors in the documentation, such as not documenting some parameters
|
||||
|
@ -2688,6 +2688,7 @@ files {
|
||||
MAME_DIR .. "src/mame/includes/mw8080bw.h",
|
||||
MAME_DIR .. "src/mame/machine/mw8080bw.cpp",
|
||||
MAME_DIR .. "src/mame/audio/mw8080bw.cpp",
|
||||
MAME_DIR .. "src/mame/audio/mw8080bw.h",
|
||||
MAME_DIR .. "src/mame/video/mw8080bw.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/rotaryf.cpp",
|
||||
}
|
||||
|
@ -22,10 +22,6 @@ DEFINE_DEVICE_TYPE(SATURN_MULTITAP, saturn_multitap_device, "saturn_multitap", "
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// saturn_multitap_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
saturn_multitap_device::saturn_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, SATURN_MULTITAP, tag, owner, clock)
|
||||
, device_saturn_control_port_interface(mconfig, *this)
|
||||
@ -34,49 +30,23 @@ saturn_multitap_device::saturn_multitap_device(const machine_config &mconfig, co
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void saturn_multitap_device::device_start()
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
m_subctrl_port[i]->device_start();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void saturn_multitap_device::device_reset()
|
||||
void saturn_multitap_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
for (auto &port : m_subctrl_port)
|
||||
SATURN_CONTROL_PORT(config, port, saturn_joys, "joypad");
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_ctrl
|
||||
//-------------------------------------------------
|
||||
|
||||
uint8_t saturn_multitap_device::read_ctrl(uint8_t offset)
|
||||
{
|
||||
return m_subctrl_port[offset < 12 ? (offset >> 1) : 0]->read_ctrl(offset & 1);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_id
|
||||
//-------------------------------------------------
|
||||
|
||||
uint8_t saturn_multitap_device::read_id(int idx)
|
||||
{
|
||||
return m_subctrl_port[idx < 6 ? idx : 0]->read_id(0);
|
||||
}
|
||||
|
||||
|
||||
void saturn_multitap_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[0], saturn_joys, "joypad");
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[1], saturn_joys, "joypad");
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[2], saturn_joys, "joypad");
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[3], saturn_joys, "joypad");
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[4], saturn_joys, "joypad");
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[5], saturn_joys, "joypad");
|
||||
}
|
||||
|
@ -15,15 +15,11 @@
|
||||
#include "ctrl.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> saturn_multitap_device
|
||||
|
||||
class saturn_multitap_device : public device_t,
|
||||
public device_saturn_control_port_interface
|
||||
class saturn_multitap_device : public device_t, public device_saturn_control_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -32,9 +28,6 @@ public:
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
// device_saturn_control_port_interface overrides
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "segatap.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
@ -22,10 +21,6 @@ DEFINE_DEVICE_TYPE(SATURN_SEGATAP, saturn_segatap_device, "saturn_segatap", "sat
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// saturn_segatap_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
saturn_segatap_device::saturn_segatap_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, SATURN_SEGATAP, tag, owner, clock)
|
||||
, device_saturn_control_port_interface(mconfig, *this)
|
||||
@ -34,47 +29,23 @@ saturn_segatap_device::saturn_segatap_device(const machine_config &mconfig, cons
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void saturn_segatap_device::device_start()
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
m_subctrl_port[i]->device_start();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void saturn_segatap_device::device_reset()
|
||||
void saturn_segatap_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
for (auto &port : m_subctrl_port)
|
||||
SATURN_CONTROL_PORT(config, port, saturn_joys, "joypad");
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_ctrl
|
||||
//-------------------------------------------------
|
||||
|
||||
uint8_t saturn_segatap_device::read_ctrl(uint8_t offset)
|
||||
{
|
||||
return m_subctrl_port[offset < 8 ? (offset >> 1) : 0]->read_ctrl(offset & 1);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// read_id
|
||||
//-------------------------------------------------
|
||||
|
||||
uint8_t saturn_segatap_device::read_id(int idx)
|
||||
{
|
||||
return m_subctrl_port[idx < 4 ? idx : 0]->read_id(0);
|
||||
}
|
||||
|
||||
|
||||
void saturn_segatap_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[0], saturn_joys, "joypad");
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[1], saturn_joys, "joypad");
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[2], saturn_joys, "joypad");
|
||||
SATURN_CONTROL_PORT(config, m_subctrl_port[3], saturn_joys, "joypad");
|
||||
}
|
||||
|
@ -20,10 +20,7 @@
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> saturn_segatap_device
|
||||
|
||||
class saturn_segatap_device : public device_t,
|
||||
public device_saturn_control_port_interface
|
||||
class saturn_segatap_device : public device_t, public device_saturn_control_port_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
@ -32,9 +29,6 @@ public:
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// optional information overrides
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
// device_saturn_control_port_interface overrides
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
DEFINE_DEVICE_TYPE(MB14241, mb14241_device, "mb14241", "MB14241 Data Shifter")
|
||||
|
||||
mb14241_device::mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
mb14241_device::mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
: device_t(mconfig, MB14241, tag, owner, clock), m_shift_data(0), m_shift_count(0)
|
||||
{
|
||||
}
|
||||
@ -47,17 +47,17 @@ void mb14241_device::device_reset()
|
||||
IMPLEMENTATION
|
||||
*****************************************************************************/
|
||||
|
||||
WRITE8_MEMBER( mb14241_device::shift_count_w )
|
||||
void mb14241_device::shift_count_w(u8 data)
|
||||
{
|
||||
m_shift_count = ~data & 0x07;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( mb14241_device::shift_data_w )
|
||||
void mb14241_device::shift_data_w(u8 data)
|
||||
{
|
||||
m_shift_data = (m_shift_data >> 8) | ((uint16_t)data << 7);
|
||||
m_shift_data = (m_shift_data >> 8) | (u16(data) << 7);
|
||||
}
|
||||
|
||||
READ8_MEMBER( mb14241_device::shift_result_r )
|
||||
u8 mb14241_device::shift_result_r()
|
||||
{
|
||||
return m_shift_data >> m_shift_count;
|
||||
return u8((m_shift_data >> m_shift_count) & 0x00ff);
|
||||
}
|
||||
|
@ -14,11 +14,11 @@
|
||||
class mb14241_device : public device_t
|
||||
{
|
||||
public:
|
||||
mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
DECLARE_WRITE8_MEMBER( shift_count_w );
|
||||
DECLARE_WRITE8_MEMBER( shift_data_w );
|
||||
DECLARE_READ8_MEMBER( shift_result_r );
|
||||
void shift_count_w(u8 data);
|
||||
void shift_data_w(u8 data);
|
||||
u8 shift_result_r();
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
@ -27,9 +27,8 @@ protected:
|
||||
|
||||
private:
|
||||
// internal state
|
||||
|
||||
uint16_t m_shift_data; /* 15 bits only */
|
||||
uint8_t m_shift_count; /* 3 bits */
|
||||
u16 m_shift_data; // 15 bits only
|
||||
u8 m_shift_count; // 3 bits
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(MB14241, mb14241_device)
|
||||
|
@ -115,7 +115,7 @@ void vrender0soc_device::device_add_mconfig(machine_config &config)
|
||||
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
// evolution soccer defaults
|
||||
m_screen->set_raw((XTAL(14'318'180)*2)/4, 455, 0, 320, 262, 0, 240);
|
||||
m_screen->set_raw((XTAL(14'318'181)*2)/4, 455, 0, 320, 262, 0, 240);
|
||||
m_screen->set_screen_update(FUNC(vrender0soc_device::screen_update));
|
||||
m_screen->screen_vblank().set(FUNC(vrender0soc_device::screen_vblank));
|
||||
m_screen->set_palette(m_palette);
|
||||
|
@ -100,8 +100,8 @@ public:
|
||||
/// int argument.
|
||||
/// \param [in] start Number to add to element index when
|
||||
/// calculating values for string format argument.
|
||||
/// \arg [in] Optional additional constructor argument(s) passed to
|
||||
/// all elements.
|
||||
/// \param [in] arg Optional additional constructor argument(s) passed
|
||||
/// to all elements.
|
||||
/// \sa util::string_format
|
||||
template <typename F, typename... Param>
|
||||
object_array_finder(device_t &base, F const &fmt, unsigned start, Param const &... arg)
|
||||
@ -117,8 +117,8 @@ public:
|
||||
/// \param [in] tags Tags to search for, e.g. { "player", "dips" }.
|
||||
/// The tags are not copied, it is the caller's responsibility to
|
||||
/// ensure the pointers remain valid until resolution time.
|
||||
/// \arg [in] Optional additional constructor argument(s) passed to
|
||||
/// all elements.
|
||||
/// \param [in] arg Optional additional constructor argument(s) passed
|
||||
/// to all elements.
|
||||
template <typename... Param>
|
||||
object_array_finder(device_t &base, std::array<char const *, Count> const &tags, Param const &... arg)
|
||||
: object_array_finder(base, tags, std::make_integer_sequence<unsigned, Count>(), arg...)
|
||||
@ -368,9 +368,9 @@ protected:
|
||||
/// with the requested tag is found, but it doesn't match the
|
||||
/// desired width.
|
||||
/// \param [in] width Desired memory share width in bits.
|
||||
/// \param [out] bytes Set to memoyr share length in bytes if a
|
||||
/// \param [out] bytes Set to memory share length in bytes if a
|
||||
/// matching memory share is found, otherwise left unchanged.
|
||||
/// \param [in] required. Whether warning message should be printed
|
||||
/// \param [in] required Whether warning message should be printed
|
||||
/// if a memory share with matching tag of incorrect width is
|
||||
/// found.
|
||||
/// \return Pointer to base of memory share if a matching memory
|
||||
@ -387,7 +387,7 @@ protected:
|
||||
/// or a space with the designated number.
|
||||
/// \param [in] spacenum Address space number.
|
||||
/// \param [in] width Specific data width, or 0.
|
||||
/// \param [in] required. Whether warning message should be printed
|
||||
/// \param [in] required Whether warning message should be printed
|
||||
/// if a device with no memory interface or space of that number
|
||||
/// is found.
|
||||
/// \return Pointer to address space if a matching address space
|
||||
@ -400,7 +400,7 @@ protected:
|
||||
/// found, or false otherwise.
|
||||
/// \param [in] spacenum Address space number.
|
||||
/// \param [in] width Specific data width, or 0.
|
||||
/// \param [in] required. Whether warning message should be printed
|
||||
/// \param [in] required Whether warning message should be printed
|
||||
/// if a device with no memory interface or space of that number
|
||||
/// is found.
|
||||
/// \return True if the space is optional, or if the space is
|
||||
|
@ -236,10 +236,7 @@ void driver_device::device_start()
|
||||
else
|
||||
machine_start();
|
||||
|
||||
if (!m_callbacks[CB_SOUND_START].isnull())
|
||||
m_callbacks[CB_SOUND_START]();
|
||||
else
|
||||
sound_start();
|
||||
sound_start();
|
||||
|
||||
if (!m_callbacks[CB_VIDEO_START].isnull())
|
||||
m_callbacks[CB_VIDEO_START]();
|
||||
@ -268,10 +265,7 @@ void driver_device::device_reset_after_children()
|
||||
else
|
||||
machine_reset();
|
||||
|
||||
if (!m_callbacks[CB_SOUND_RESET].isnull())
|
||||
m_callbacks[CB_SOUND_RESET]();
|
||||
else
|
||||
sound_reset();
|
||||
sound_reset();
|
||||
|
||||
if (!m_callbacks[CB_VIDEO_RESET].isnull())
|
||||
m_callbacks[CB_VIDEO_RESET]();
|
||||
|
@ -32,13 +32,6 @@
|
||||
#define MCFG_MACHINE_RESET_REMOVE() \
|
||||
driver_device::static_set_callback(config.root_device(), driver_device::CB_MACHINE_RESET, driver_callback_delegate());
|
||||
|
||||
// core sound callbacks
|
||||
#define MCFG_SOUND_START_OVERRIDE(_class, _func) \
|
||||
driver_device::static_set_callback(config.root_device(), driver_device::CB_SOUND_START, driver_callback_delegate(&_class::SOUND_START_NAME(_func), this));
|
||||
|
||||
#define MCFG_SOUND_RESET_OVERRIDE(_class, _func) \
|
||||
driver_device::static_set_callback(config.root_device(), driver_device::CB_SOUND_RESET, driver_callback_delegate(&_class::SOUND_RESET_NAME(_func), this));
|
||||
|
||||
|
||||
// core video callbacks
|
||||
#define MCFG_VIDEO_START_OVERRIDE(_class, _func) \
|
||||
@ -63,15 +56,6 @@
|
||||
#define DECLARE_MACHINE_RESET(name) void MACHINE_RESET_NAME(name)()
|
||||
#define MACHINE_RESET_MEMBER(cls,name) void cls::MACHINE_RESET_NAME(name)()
|
||||
|
||||
#define SOUND_START_NAME(name) sound_start_##name
|
||||
#define DECLARE_SOUND_START(name) void SOUND_START_NAME(name)() ATTR_COLD
|
||||
#define SOUND_START_MEMBER(cls,name) void cls::SOUND_START_NAME(name)()
|
||||
|
||||
#define SOUND_RESET_NAME(name) sound_reset_##name
|
||||
#define SOUND_RESET_CALL_MEMBER(name) SOUND_RESET_NAME(name)()
|
||||
#define DECLARE_SOUND_RESET(name) void SOUND_RESET_NAME(name)()
|
||||
#define SOUND_RESET_MEMBER(cls,name) void cls::SOUND_RESET_NAME(name)()
|
||||
|
||||
#define VIDEO_START_NAME(name) video_start_##name
|
||||
#define VIDEO_START_CALL_MEMBER(name) VIDEO_START_NAME(name)()
|
||||
#define DECLARE_VIDEO_START(name) void VIDEO_START_NAME(name)() ATTR_COLD
|
||||
@ -110,8 +94,6 @@ public:
|
||||
{
|
||||
CB_MACHINE_START,
|
||||
CB_MACHINE_RESET,
|
||||
CB_SOUND_START,
|
||||
CB_SOUND_RESET,
|
||||
CB_VIDEO_START,
|
||||
CB_VIDEO_RESET,
|
||||
CB_COUNT
|
||||
|
185
src/emu/screen.h
185
src/emu/screen.h
@ -207,7 +207,24 @@ public:
|
||||
void set_orientation(int orientation) { assert(!configured()); m_orientation = orientation; }
|
||||
void set_physical_aspect(unsigned x, unsigned y) { assert(!configured()); m_phys_aspect = std::make_pair(x, y); }
|
||||
void set_native_aspect() { assert(!configured()); m_phys_aspect = std::make_pair(~0U, ~0U); }
|
||||
void set_raw(u32 pixclock, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart)
|
||||
|
||||
/// \brief Configure screen parameters
|
||||
///
|
||||
/// \param [in] pixclock Pixel clock frequency in Hertz.
|
||||
/// \param [in] htotal Total pixel clocks per line, including
|
||||
/// horizontal blanking period.
|
||||
/// \param [in] hbend Index of first visible pixel after horizontal
|
||||
/// blanking period ends.
|
||||
/// \param [in] hbstart Index of first pixel in horzontal blanking
|
||||
/// period after visible pixels.
|
||||
/// \param [in] vtotal Total lines per frame, including vertical
|
||||
/// blanking period.
|
||||
/// \param [in] vbend Index of first visible line after vertical
|
||||
/// blanking period ends.
|
||||
/// \param [in] vbstart Index of first line in vertical blanking
|
||||
/// period after visible lines.
|
||||
/// \return Reference to device for method chaining.
|
||||
screen_device &set_raw(u32 pixclock, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart)
|
||||
{
|
||||
assert(pixclock != 0);
|
||||
m_clock = pixclock;
|
||||
@ -216,15 +233,101 @@ public:
|
||||
m_width = htotal;
|
||||
m_height = vtotal;
|
||||
m_visarea.set(hbend, hbstart - 1, vbend, vbstart - 1);
|
||||
return *this;
|
||||
}
|
||||
screen_device &set_raw(const XTAL &xtal, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart)
|
||||
{
|
||||
xtal.validate(std::string("Configuring screen ") + tag());
|
||||
return set_raw(xtal.value(), htotal, hbend, hbstart, vtotal, vbend, vbstart);
|
||||
}
|
||||
void set_raw(const XTAL &xtal, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart) { set_raw(xtal.value(), htotal, hbend, hbstart, vtotal, vbend, vbstart); }
|
||||
void set_refresh(attoseconds_t rate) { m_refresh = rate; }
|
||||
template <typename T> void set_refresh_hz(T &&hz) { set_refresh(HZ_TO_ATTOSECONDS(std::forward<T>(hz))); }
|
||||
void set_vblank_time(attoseconds_t time) { m_vblank = time; m_oldstyle_vblank_supplied = true; }
|
||||
void set_size(u16 width, u16 height) { m_width = width; m_height = height; }
|
||||
void set_visarea(s16 minx, s16 maxx, s16 miny, s16 maxy) { m_visarea.set(minx, maxx, miny, maxy); }
|
||||
void set_visarea_full() { m_visarea.set(0, m_width - 1, 0, m_height - 1); } // call after set_size
|
||||
void set_default_position(double xscale, double xoffs, double yscale, double yoffs) {
|
||||
|
||||
/// \brief Set refresh rate in Hertz
|
||||
///
|
||||
/// Sets refresh rate in Hertz (frames per second). Used in
|
||||
/// conjunction with #set_vblank_time, #set_size and #set_visarea.
|
||||
/// For raster displays, please use #set_raw to configure screen
|
||||
/// parameters in terms of pixel clock.
|
||||
/// \param [in] hz Desired refresh rate.
|
||||
/// \return Reference to device for method chaining.
|
||||
template <typename T> screen_device &set_refresh_hz(T &&hz)
|
||||
{
|
||||
set_refresh(HZ_TO_ATTOSECONDS(std::forward<T>(hz)));
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// \brief Set vertical blanking interval time
|
||||
///
|
||||
/// Sets vertical blanking interval period. Used in conjunction
|
||||
/// with #set_refresh_hz, #set_size and #set_visarea. For raster
|
||||
/// displays, please use #set_raw to configure screen parameters in
|
||||
/// terms of pixel clock.
|
||||
/// \param [in] time Length of vertical blanking interval.
|
||||
/// \return Reference to device for method chaining.
|
||||
screen_device &set_vblank_time(attoseconds_t time)
|
||||
{
|
||||
m_vblank = time;
|
||||
m_oldstyle_vblank_supplied = true;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// \brief Set total screen size
|
||||
///
|
||||
/// Set the total screen size in pixels, including blanking areas if
|
||||
/// applicable. This sets the size of the screen bitmap. Used in
|
||||
/// conjunction with #set_refresh_hz, #set_vblank_time and
|
||||
/// #set_visarea. For raster displays, please use #set_raw to
|
||||
/// configure screen parameters in terms of pixel clock.
|
||||
/// \param [in] width Total width in pixels, including horizontal
|
||||
/// blanking period if applicable.
|
||||
/// \param [in] height Total height in lines, including vertical
|
||||
/// blanking period if applicable.
|
||||
/// \return Reference to device for method chaining.
|
||||
screen_device &set_size(u16 width, u16 height)
|
||||
{
|
||||
m_width = width;
|
||||
m_height = height;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// \brief Set visible screen area
|
||||
///
|
||||
/// Set visible screen area. This should fit within the total
|
||||
/// screen area. Used in conjunction with #set_refresh_hz,
|
||||
/// #set_vblank_time and #set_size. For raster displays, please
|
||||
/// use #set_raw to configure screen parameters in terms of pixel
|
||||
/// clock.
|
||||
/// \param [in] minx First visible pixel index after horizontal
|
||||
/// blanking period ends.
|
||||
/// \param [in] maxx Last visible pixel index before horizontal
|
||||
/// blanking period starts.
|
||||
/// \param [in] miny First visible line index after vertical
|
||||
/// blanking period ends.
|
||||
/// \param [in] maxy Last visible line index before vertical
|
||||
/// blanking period starts.
|
||||
/// \return Reference to device for method chaining.
|
||||
screen_device &set_visarea(s16 minx, s16 maxx, s16 miny, s16 maxy)
|
||||
{
|
||||
m_visarea.set(minx, maxx, miny, maxy);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// \brief Set visible area to full area
|
||||
///
|
||||
/// Set visible screen area to the full screen area (i.e. noi
|
||||
/// horizontal or vertical blanking period). This is generally not
|
||||
/// possible for raster displays, but is useful for other display
|
||||
/// simulations. Must be called after calling #set_size.
|
||||
/// \return Reference to device for method chaining.
|
||||
/// \sa set_visarea
|
||||
screen_device &set_visarea_full()
|
||||
{
|
||||
m_visarea.set(0, m_width - 1, 0, m_height - 1);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void set_default_position(double xscale, double xoffs, double yscale, double yoffs)
|
||||
{
|
||||
m_xscale = xscale;
|
||||
m_xoffset = xoffs;
|
||||
m_yscale = yscale;
|
||||
@ -445,72 +548,6 @@ typedef device_type_iterator<screen_device> screen_device_iterator;
|
||||
@def set_type
|
||||
Modify the screen device type
|
||||
@see screen_type_enum
|
||||
|
||||
@def set_raw
|
||||
Configures screen parameters for the given screen.
|
||||
@remark It's better than using @see set_refresh_hz and @see set_vblank_time but still not enough.
|
||||
|
||||
@param _pixclock
|
||||
Pixel Clock frequency value
|
||||
|
||||
@param _htotal
|
||||
Total number of horizontal pixels, including hblank period.
|
||||
|
||||
@param _hbend
|
||||
Horizontal pixel position for HBlank end event, also first pixel where screen rectangle is visible.
|
||||
|
||||
@param _hbstart
|
||||
Horizontal pixel position for HBlank start event, also last pixel where screen rectangle is visible.
|
||||
|
||||
@param _vtotal
|
||||
Total number of vertical pixels, including vblank period.
|
||||
|
||||
@param _vbend
|
||||
Vertical pixel position for VBlank end event, also first pixel where screen rectangle is visible.
|
||||
|
||||
@param _vbstart
|
||||
Vertical pixel position for VBlank start event, also last pixel where screen rectangle is visible.
|
||||
|
||||
@def set_refresh_hz
|
||||
Sets the number of Frames Per Second for this screen
|
||||
@remarks Please use @see set_raw instead. Gives imprecise timings.
|
||||
|
||||
@param _rate
|
||||
FPS number
|
||||
|
||||
@def set_vblank_time
|
||||
Sets the vblank time of the given screen
|
||||
@remarks Please use @see MCFG_SCREEN_RAW_PARAMS instead. Gives imprecise timings.
|
||||
|
||||
@param _time
|
||||
Time parameter, in attotime value
|
||||
|
||||
@def set_size
|
||||
Sets total screen size, including H/V-Blanks
|
||||
@remarks Please use @see set_raw instead. Gives imprecise timings.
|
||||
|
||||
@param _width
|
||||
Screen horizontal size
|
||||
|
||||
@param _height
|
||||
Screen vertical size
|
||||
|
||||
@def set_visarea
|
||||
Sets screen visible area
|
||||
@remarks Please use @see set_raw instead. Gives imprecise timings.
|
||||
|
||||
@param _minx
|
||||
Screen left border
|
||||
|
||||
@param _maxx
|
||||
Screen right border, must be in N-1 format
|
||||
|
||||
@param _miny
|
||||
Screen top border
|
||||
|
||||
@param _maxx
|
||||
Screen bottom border, must be in N-1 format
|
||||
|
||||
@}
|
||||
*/
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
169
src/mame/audio/mw8080bw.h
Normal file
169
src/mame/audio/mw8080bw.h
Normal file
@ -0,0 +1,169 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Nicola Salmoria, Tormod Tjaberg, Mirko Buffoni,Lee Taylor, Valerio Verrando, Zsolt Vasvari,Derrick Renaud
|
||||
// thanks-to:Michael Strutts, Marco Cassili
|
||||
/***************************************************************************
|
||||
|
||||
Midway 8080-based black and white hardware
|
||||
|
||||
****************************************************************************/
|
||||
#ifndef MAME_AUDIO_MW8080BW_H
|
||||
#define MAME_AUDIO_MW8080BW_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sound/discrete.h"
|
||||
#include "sound/samples.h"
|
||||
#include "sound/sn76477.h"
|
||||
|
||||
|
||||
class seawolf_audio_device : public device_t
|
||||
{
|
||||
public:
|
||||
seawolf_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
void write(u8 data);
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
required_device<samples_device> m_samples;
|
||||
u8 m_prev;
|
||||
};
|
||||
|
||||
|
||||
class gunfight_audio_device : public device_t
|
||||
{
|
||||
public:
|
||||
gunfight_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
void write(u8 data);
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
required_device_array<samples_device, 2> m_samples;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class gmissile_audio_device : public device_t
|
||||
{
|
||||
public:
|
||||
gmissile_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
void p1_w(u8 data);
|
||||
void p2_w(u8 data);
|
||||
void p3_w(u8 data);
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
required_device_array<samples_device, 2> m_samples;
|
||||
output_finder<> m_l_exp;
|
||||
output_finder<> m_r_exp;
|
||||
u8 m_p1;
|
||||
};
|
||||
|
||||
|
||||
class clowns_audio_device : public device_t
|
||||
{
|
||||
public:
|
||||
auto ctrl_sel_out() { return m_ctrl_sel_out.bind(); }
|
||||
|
||||
clowns_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
void p1_w(u8 data);
|
||||
void p2_w(u8 data);
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
required_device<samples_device> m_samples;
|
||||
required_device<discrete_sound_device> m_discrete;
|
||||
devcb_write_line m_ctrl_sel_out;
|
||||
u8 m_p1;
|
||||
u8 m_p2;
|
||||
};
|
||||
|
||||
|
||||
class spcenctr_audio_device : public device_t
|
||||
{
|
||||
public:
|
||||
spcenctr_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
void p1_w(u8 data);
|
||||
void p2_w(u8 data);
|
||||
void p3_w(u8 data);
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
TIMER_CALLBACK_MEMBER(strobe_callback);
|
||||
|
||||
required_device<sn76477_device> m_sn;
|
||||
required_device<discrete_sound_device> m_discrete;
|
||||
output_finder<> m_lamp;
|
||||
output_finder<> m_strobe;
|
||||
emu_timer *m_strobe_timer;
|
||||
u8 m_strobe_enable;
|
||||
};
|
||||
|
||||
|
||||
class m4_audio_device : public device_t
|
||||
{
|
||||
public:
|
||||
m4_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
void p1_w(u8 data);
|
||||
void p2_w(u8 data);
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
required_device_array<samples_device, 2> m_samples;
|
||||
u8 m_p1;
|
||||
u8 m_p2;
|
||||
};
|
||||
|
||||
|
||||
class phantom2_audio_device : public device_t
|
||||
{
|
||||
public:
|
||||
phantom2_audio_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
void p1_w(u8 data);
|
||||
void p2_w(u8 data);
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
required_device<samples_device> m_samples;
|
||||
output_finder<> m_exp;
|
||||
u8 m_p1;
|
||||
u8 m_p2;
|
||||
};
|
||||
|
||||
|
||||
DECLARE_DEVICE_TYPE(SEAWOLF_AUDIO, seawolf_audio_device)
|
||||
DECLARE_DEVICE_TYPE(GUNFIGHT_AUDIO, gunfight_audio_device)
|
||||
DECLARE_DEVICE_TYPE(GMISSILE_AUDIO, gmissile_audio_device)
|
||||
DECLARE_DEVICE_TYPE(CLOWNS_AUDIO, clowns_audio_device)
|
||||
DECLARE_DEVICE_TYPE(SPCENCTR_AUDIO, spcenctr_audio_device)
|
||||
DECLARE_DEVICE_TYPE(M4_AUDIO, m4_audio_device)
|
||||
DECLARE_DEVICE_TYPE(PHANTOM2_AUDIO, phantom2_audio_device)
|
||||
|
||||
#endif // MAME_AUDIO_MW8080BW_H
|
@ -142,13 +142,13 @@ READ8_MEMBER(fgoal_state::row_r)
|
||||
WRITE8_MEMBER(fgoal_state::row_w)
|
||||
{
|
||||
m_row = data;
|
||||
m_mb14241->shift_data_w(space, 0, 0);
|
||||
m_mb14241->shift_data_w(0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(fgoal_state::col_w)
|
||||
{
|
||||
m_col = data;
|
||||
m_mb14241->shift_count_w(space, 0, data);
|
||||
m_mb14241->shift_count_w(data);
|
||||
}
|
||||
|
||||
READ8_MEMBER(fgoal_state::address_hi_r)
|
||||
@ -163,14 +163,14 @@ READ8_MEMBER(fgoal_state::address_lo_r)
|
||||
|
||||
READ8_MEMBER(fgoal_state::shifter_r)
|
||||
{
|
||||
uint8_t v = m_mb14241->shift_result_r(space, 0);
|
||||
uint8_t v = m_mb14241->shift_result_r();
|
||||
|
||||
return bitswap<8>(v, 7, 6, 5, 4, 3, 2, 1, 0);
|
||||
}
|
||||
|
||||
READ8_MEMBER(fgoal_state::shifter_reverse_r)
|
||||
{
|
||||
uint8_t v = m_mb14241->shift_result_r(space, 0);
|
||||
uint8_t v = m_mb14241->shift_result_r();
|
||||
|
||||
return bitswap<8>(v, 0, 1, 2, 3, 4, 5, 6, 7);
|
||||
}
|
||||
|
@ -151,9 +151,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/mw8080bw.h"
|
||||
|
||||
#include "cpu/i8085/i8085.h"
|
||||
#include "machine/rescap.h"
|
||||
#include "includes/mw8080bw.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "280zzzap.lh"
|
||||
#include "clowns.lh"
|
||||
@ -177,7 +180,7 @@
|
||||
|
||||
READ8_MEMBER(mw8080bw_state::mw8080bw_shift_result_rev_r)
|
||||
{
|
||||
uint8_t ret = m_mb14241->shift_result_r(space, 0);
|
||||
uint8_t ret = m_mb14241->shift_result_r();
|
||||
|
||||
return bitswap<8>(ret,0,1,2,3,4,5,6,7);
|
||||
}
|
||||
@ -188,20 +191,16 @@ READ8_MEMBER(mw8080bw_state::mw8080bw_reversable_shift_result_r)
|
||||
uint8_t ret;
|
||||
|
||||
if (m_rev_shift_res)
|
||||
{
|
||||
ret = mw8080bw_shift_result_rev_r(space, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = m_mb14241->shift_result_r(space, 0);
|
||||
}
|
||||
ret = m_mb14241->shift_result_r();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mw8080bw_state::mw8080bw_reversable_shift_count_w)
|
||||
{
|
||||
m_mb14241->shift_count_w(space, offset, data);
|
||||
m_mb14241->shift_count_w(data);
|
||||
|
||||
m_rev_shift_res = data & 0x08;
|
||||
}
|
||||
@ -345,7 +344,7 @@ void mw8080bw_state::seawolf_io_map(address_map &map)
|
||||
map(0x02, 0x02).w(FUNC(mw8080bw_state::seawolf_periscope_lamp_w));
|
||||
map(0x03, 0x03).w(m_mb14241, FUNC(mb14241_device::shift_data_w));
|
||||
map(0x04, 0x04).w(m_mb14241, FUNC(mb14241_device::shift_count_w));
|
||||
map(0x05, 0x05).w(FUNC(mw8080bw_state::seawolf_audio_w));
|
||||
map(0x05, 0x05).w("soundboard", FUNC(seawolf_audio_device::write));
|
||||
}
|
||||
|
||||
|
||||
@ -421,7 +420,7 @@ void mw8080bw_state::seawolf(machine_config &config)
|
||||
MB14241(config, m_mb14241);
|
||||
|
||||
/* audio hardware */
|
||||
seawolf_audio(config);
|
||||
SEAWOLF_AUDIO(config, "soundboard");
|
||||
}
|
||||
|
||||
|
||||
@ -432,21 +431,20 @@ void mw8080bw_state::seawolf(machine_config &config)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_MEMBER(mw8080bw_state::gunfight_io_w)
|
||||
void gunfight_state::io_w(offs_t offset, u8 data)
|
||||
{
|
||||
if (offset & 0x01)
|
||||
gunfight_audio_w(space, 0, data);
|
||||
m_soundboard->write(data);
|
||||
|
||||
if (offset & 0x02)
|
||||
m_mb14241->shift_count_w(space, 0, data);
|
||||
m_mb14241->shift_count_w(data);
|
||||
|
||||
if (offset & 0x04)
|
||||
m_mb14241->shift_data_w(space, 0, data);
|
||||
|
||||
m_mb14241->shift_data_w(data);
|
||||
}
|
||||
|
||||
|
||||
void mw8080bw_state::gunfight_io_map(address_map &map)
|
||||
void gunfight_state::io_map(address_map &map)
|
||||
{
|
||||
map.global_mask(0x7);
|
||||
map(0x00, 0x00).mirror(0x04).portr("IN0");
|
||||
@ -454,8 +452,7 @@ void mw8080bw_state::gunfight_io_map(address_map &map)
|
||||
map(0x02, 0x02).mirror(0x04).portr("IN2");
|
||||
map(0x03, 0x03).mirror(0x04).r(m_mb14241, FUNC(mb14241_device::shift_result_r));
|
||||
|
||||
/* no decoder, just 3 AND gates */
|
||||
map(0x00, 0x07).w(FUNC(mw8080bw_state::gunfight_io_w));
|
||||
map(0x00, 0x07).w(FUNC(gunfight_state::io_w)); // no decoder, just 3 AND gates
|
||||
}
|
||||
|
||||
|
||||
@ -510,19 +507,20 @@ static INPUT_PORTS_START( gunfight )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
void mw8080bw_state::gunfight(machine_config &config)
|
||||
void gunfight_state::gunfight(machine_config &config)
|
||||
{
|
||||
mw8080bw_root(config);
|
||||
|
||||
/* basic machine hardware */
|
||||
m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::gunfight_io_map);
|
||||
/* there is no watchdog */
|
||||
// basic machine hardware
|
||||
m_maincpu->set_addrmap(AS_IO, &gunfight_state::io_map);
|
||||
|
||||
/* add shifter */
|
||||
// there is no watchdog
|
||||
|
||||
// add shifter
|
||||
MB14241(config, m_mb14241);
|
||||
|
||||
/* audio hardware */
|
||||
gunfight_audio(config);
|
||||
// audio hardware
|
||||
GUNFIGHT_AUDIO(config, m_soundboard);
|
||||
}
|
||||
|
||||
|
||||
@ -634,10 +632,10 @@ WRITE8_MEMBER(mw8080bw_state::tornbase_io_w)
|
||||
tornbase_audio_w(space, 0, data);
|
||||
|
||||
if (offset & 0x02)
|
||||
m_mb14241->shift_count_w(space, 0, data);
|
||||
m_mb14241->shift_count_w(data);
|
||||
|
||||
if (offset & 0x04)
|
||||
m_mb14241->shift_data_w(space, 0, data);
|
||||
m_mb14241->shift_data_w(data);
|
||||
}
|
||||
|
||||
|
||||
@ -1533,11 +1531,11 @@ void mw8080bw_state::gmissile_io_map(address_map &map)
|
||||
|
||||
map(0x01, 0x01).w(FUNC(mw8080bw_state::mw8080bw_reversable_shift_count_w));
|
||||
map(0x02, 0x02).w(m_mb14241, FUNC(mb14241_device::shift_data_w));
|
||||
map(0x03, 0x03).w(FUNC(mw8080bw_state::gmissile_audio_1_w));
|
||||
map(0x03, 0x03).w("soundboard", FUNC(gmissile_audio_device::p1_w));
|
||||
map(0x04, 0x04).w(m_watchdog, FUNC(watchdog_timer_device::reset_w));
|
||||
map(0x05, 0x05).w(FUNC(mw8080bw_state::gmissile_audio_2_w));
|
||||
map(0x05, 0x05).w("soundboard", FUNC(gmissile_audio_device::p2_w));
|
||||
/* also writes 0x00 to 0x06, but it is not connected */
|
||||
map(0x07, 0x07).w(FUNC(mw8080bw_state::gmissile_audio_3_w));
|
||||
map(0x07, 0x07).w("soundboard", FUNC(gmissile_audio_device::p3_w));
|
||||
}
|
||||
|
||||
|
||||
@ -1600,7 +1598,7 @@ void mw8080bw_state::gmissile(machine_config &config)
|
||||
MB14241(config, m_mb14241);
|
||||
|
||||
/* audio hardware */
|
||||
gmissile_audio(config);
|
||||
GMISSILE_AUDIO(config, "soundboard");
|
||||
}
|
||||
|
||||
|
||||
@ -1630,9 +1628,9 @@ void mw8080bw_state::m4_io_map(address_map &map)
|
||||
|
||||
map(0x01, 0x01).w(FUNC(mw8080bw_state::mw8080bw_reversable_shift_count_w));
|
||||
map(0x02, 0x02).w(m_mb14241, FUNC(mb14241_device::shift_data_w));
|
||||
map(0x03, 0x03).w(FUNC(mw8080bw_state::m4_audio_1_w));
|
||||
map(0x03, 0x03).w("soundboard", FUNC(m4_audio_device::p1_w));
|
||||
map(0x04, 0x04).w(m_watchdog, FUNC(watchdog_timer_device::reset_w));
|
||||
map(0x05, 0x05).w(FUNC(mw8080bw_state::m4_audio_2_w));
|
||||
map(0x05, 0x05).w("soundboard", FUNC(m4_audio_device::p2_w));
|
||||
}
|
||||
|
||||
|
||||
@ -1695,7 +1693,7 @@ void mw8080bw_state::m4(machine_config &config)
|
||||
MB14241(config, m_mb14241);
|
||||
|
||||
/* audio hardware */
|
||||
m4_audio(config);
|
||||
M4_AUDIO(config, "soundboard");
|
||||
}
|
||||
|
||||
|
||||
@ -1746,11 +1744,11 @@ void mw8080bw_state::clowns_io_map(address_map &map)
|
||||
|
||||
map(0x01, 0x01).w(m_mb14241, FUNC(mb14241_device::shift_count_w));
|
||||
map(0x02, 0x02).w(m_mb14241, FUNC(mb14241_device::shift_data_w));
|
||||
map(0x03, 0x03).w(FUNC(mw8080bw_state::clowns_audio_1_w));
|
||||
map(0x03, 0x03).w("soundboard", FUNC(clowns_audio_device::p1_w));
|
||||
map(0x04, 0x04).w(m_watchdog, FUNC(watchdog_timer_device::reset_w));
|
||||
map(0x05, 0x05).w(FUNC(mw8080bw_state::midway_tone_generator_lo_w));
|
||||
map(0x06, 0x06).w(FUNC(mw8080bw_state::midway_tone_generator_hi_w));
|
||||
map(0x07, 0x07).w(FUNC(mw8080bw_state::clowns_audio_2_w));
|
||||
map(0x07, 0x07).w("soundboard", FUNC(clowns_audio_device::p2_w));
|
||||
}
|
||||
|
||||
|
||||
@ -1865,7 +1863,7 @@ void mw8080bw_state::clowns(machine_config &config)
|
||||
MB14241(config, m_mb14241);
|
||||
|
||||
/* audio hardware */
|
||||
clowns_audio(config);
|
||||
CLOWNS_AUDIO(config, "soundboard").ctrl_sel_out().set([this] (int state) { m_clowns_controller_select = state ? 1 : 0; });
|
||||
}
|
||||
|
||||
|
||||
@ -2142,70 +2140,55 @@ void mw8080bw_state::dogpatch(machine_config &config)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
#define SPCENCTR_STROBE_FREQ (9.00) /* Hz - calculated from the 555 timer */
|
||||
#define SPCENCTR_STROBE_DUTY_CYCLE (95.0) /* % */
|
||||
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(mw8080bw_state::spcenctr_strobe_timer_callback)
|
||||
MACHINE_START_MEMBER(spcenctr_state, spcenctr)
|
||||
{
|
||||
output().set_value("STROBE", param && m_spcenctr_strobe_state);
|
||||
}
|
||||
m_trench_width = 0U;
|
||||
m_trench_center = 0U;
|
||||
std::fill(std::begin(m_trench_slope), std::end(m_trench_slope), 0U);
|
||||
m_bright_control = 0U;
|
||||
m_brightness = 0U;
|
||||
|
||||
|
||||
MACHINE_START_MEMBER(mw8080bw_state,spcenctr)
|
||||
{
|
||||
/* setup for save states */
|
||||
save_item(NAME(m_spcenctr_strobe_state));
|
||||
save_item(NAME(m_spcenctr_trench_width));
|
||||
save_item(NAME(m_spcenctr_trench_center));
|
||||
save_item(NAME(m_spcenctr_trench_slope));
|
||||
save_item(NAME(m_spcenctr_bright_control));
|
||||
save_item(NAME(m_spcenctr_brightness));
|
||||
save_item(NAME(m_trench_width));
|
||||
save_item(NAME(m_trench_center));
|
||||
save_item(NAME(m_trench_slope));
|
||||
save_item(NAME(m_bright_control));
|
||||
save_item(NAME(m_brightness));
|
||||
|
||||
MACHINE_START_CALL_MEMBER(mw8080bw);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(mw8080bw_state::spcenctr_io_w)
|
||||
{ /* A7 A6 A5 A4 A3 A2 A1 A0 */
|
||||
|
||||
if ((offset & 0x07) == 0x02)
|
||||
m_watchdog->watchdog_reset(); /* - - - - - 0 1 0 */
|
||||
|
||||
else if ((offset & 0x5f) == 0x01)
|
||||
spcenctr_audio_1_w(space, 0, data); /* - 0 - 0 0 0 0 1 */
|
||||
|
||||
else if ((offset & 0x5f) == 0x09)
|
||||
spcenctr_audio_2_w(space, 0, data); /* - 0 - 0 1 0 0 1 */
|
||||
|
||||
else if ((offset & 0x5f) == 0x11)
|
||||
spcenctr_audio_3_w(space, 0, data); /* - 0 - 1 0 0 0 1 */
|
||||
|
||||
else if ((offset & 0x07) == 0x03)
|
||||
{ /* - - - - - 0 1 1 */
|
||||
uint8_t addr = ((offset & 0xc0) >> 4) | ((offset & 0x18) >> 3);
|
||||
m_spcenctr_trench_slope[addr] = data;
|
||||
}
|
||||
else if ((offset & 0x07) == 0x04)
|
||||
m_spcenctr_trench_center = data; /* - - - - - 1 0 0 */
|
||||
|
||||
else if ((offset & 0x07) == 0x07)
|
||||
m_spcenctr_trench_width = data; /* - - - - - 1 1 1 */
|
||||
|
||||
else if ((offset & 0x07) == 0x00)
|
||||
void spcenctr_state::io_w(offs_t offset, u8 data)
|
||||
{ // A7 A6 A5 A4 A3 A2 A1 A0
|
||||
if ((offset & 0x07) == 0x00)
|
||||
// hex flip-flop B5
|
||||
// bit 3: /BRITE
|
||||
// bit 2: /NO_PLANET
|
||||
// bit 1: /SET_WSL
|
||||
// bit 0: COIN_COUNTER
|
||||
m_spcenctr_bright_control = ~data & 0x08; /* - - - - - 0 0 0 */
|
||||
|
||||
m_bright_control = BIT(~data, 3); // - - - - - 0 0 0
|
||||
else if ((offset & 0x5f) == 0x01)
|
||||
m_soundboard->p1_w(data); // - 0 - 0 0 0 0 1
|
||||
else if ((offset & 0x5f) == 0x09)
|
||||
m_soundboard->p2_w(data); // - 0 - 0 1 0 0 1
|
||||
else if ((offset & 0x5f) == 0x11)
|
||||
m_soundboard->p3_w(data); // - 0 - 1 0 0 0 1
|
||||
else if ((offset & 0x07) == 0x02)
|
||||
m_watchdog->watchdog_reset(); // - - - - - 0 1 0
|
||||
else if ((offset & 0x07) == 0x03)
|
||||
{ // - - - - - 0 1 1
|
||||
m_trench_slope[bitswap<4>(offset, 7, 6, 4, 3)] = data;
|
||||
}
|
||||
else if ((offset & 0x07) == 0x04)
|
||||
m_trench_center = data; // - - - - - 1 0 0
|
||||
else if ((offset & 0x07) == 0x07)
|
||||
m_trench_width = data; // - - - - - 1 1 1
|
||||
else
|
||||
logerror("%04x: Unmapped I/O port write to %02x = %02x\n", m_maincpu->pc(), offset, data);
|
||||
logerror("%s: Unmapped I/O port write to %02x = %02x\n", machine().describe_context(), offset, data);
|
||||
}
|
||||
|
||||
|
||||
void mw8080bw_state::spcenctr_io_map(address_map &map)
|
||||
void spcenctr_state::io_map(address_map &map)
|
||||
{
|
||||
map.global_mask(0xff);
|
||||
map(0x00, 0x00).mirror(0xfc).portr("IN0");
|
||||
@ -2213,8 +2196,7 @@ void mw8080bw_state::spcenctr_io_map(address_map &map)
|
||||
map(0x02, 0x02).mirror(0xfc).portr("IN2");
|
||||
map(0x03, 0x03).mirror(0xfc).nopr();
|
||||
|
||||
/* complicated addressing logic */
|
||||
map(0x00, 0xff).w(FUNC(mw8080bw_state::spcenctr_io_w));
|
||||
map(0x00, 0xff).w(FUNC(spcenctr_state::io_w)); // complicated addressing logic
|
||||
}
|
||||
|
||||
|
||||
@ -2268,32 +2250,22 @@ static INPUT_PORTS_START( spcenctr )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
void mw8080bw_state::spcenctr(machine_config &config)
|
||||
void spcenctr_state::spcenctr(machine_config &config)
|
||||
{
|
||||
mw8080bw_root(config);
|
||||
|
||||
/* basic machine hardware */
|
||||
m_maincpu->set_addrmap(AS_IO, &mw8080bw_state::spcenctr_io_map);
|
||||
// basic machine hardware
|
||||
m_maincpu->set_addrmap(AS_IO, &spcenctr_state::io_map);
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(mw8080bw_state,spcenctr)
|
||||
MCFG_MACHINE_START_OVERRIDE(spcenctr_state, spcenctr)
|
||||
|
||||
WATCHDOG_TIMER(config, m_watchdog).set_time(255 * attotime::from_hz(MW8080BW_60HZ));
|
||||
|
||||
/* timers */
|
||||
timer_device &strobeon(TIMER(config, "strobeon"));
|
||||
strobeon.configure_periodic(FUNC(mw8080bw_state::spcenctr_strobe_timer_callback), attotime::from_hz(SPCENCTR_STROBE_FREQ));
|
||||
strobeon.config_param(true); /* indicates strobe ON */
|
||||
// video hardware
|
||||
m_screen->set_screen_update(FUNC(spcenctr_state::screen_update));
|
||||
|
||||
timer_device &strobeoff(TIMER(config, "strobeoff"));
|
||||
strobeoff.configure_periodic(FUNC(mw8080bw_state::spcenctr_strobe_timer_callback), attotime::from_hz(SPCENCTR_STROBE_FREQ));
|
||||
strobeoff.set_start_delay(attotime::from_hz(SPCENCTR_STROBE_FREQ) * (100 - SPCENCTR_STROBE_DUTY_CYCLE) / 100);
|
||||
strobeoff.config_param(false); /* indicates strobe OFF */
|
||||
|
||||
/* video hardware */
|
||||
m_screen->set_screen_update(FUNC(mw8080bw_state::screen_update_spcenctr));
|
||||
|
||||
/* audio hardware */
|
||||
spcenctr_audio(config);
|
||||
// audio hardware
|
||||
SPCENCTR_AUDIO(config, m_soundboard);
|
||||
}
|
||||
|
||||
|
||||
@ -2325,8 +2297,8 @@ void mw8080bw_state::phantom2_io_map(address_map &map)
|
||||
map(0x01, 0x01).w(m_mb14241, FUNC(mb14241_device::shift_count_w));
|
||||
map(0x02, 0x02).w(m_mb14241, FUNC(mb14241_device::shift_data_w));
|
||||
map(0x04, 0x04).w(m_watchdog, FUNC(watchdog_timer_device::reset_w));
|
||||
map(0x05, 0x05).w(FUNC(mw8080bw_state::phantom2_audio_1_w));
|
||||
map(0x06, 0x06).w(FUNC(mw8080bw_state::phantom2_audio_2_w));
|
||||
map(0x05, 0x05).w("soundboard", FUNC(phantom2_audio_device::p1_w));
|
||||
map(0x06, 0x06).w("soundboard", FUNC(phantom2_audio_device::p2_w));
|
||||
}
|
||||
|
||||
|
||||
@ -2385,7 +2357,7 @@ void mw8080bw_state::phantom2(machine_config &config)
|
||||
MB14241(config, m_mb14241);
|
||||
|
||||
/* audio hardware */
|
||||
phantom2_audio(config);
|
||||
PHANTOM2_AUDIO(config, "soundboard");
|
||||
}
|
||||
|
||||
|
||||
@ -2402,7 +2374,7 @@ READ8_MEMBER(mw8080bw_state::bowler_shift_result_r)
|
||||
anything unusual on the schematics that would cause
|
||||
the bits to flip */
|
||||
|
||||
return ~m_mb14241->shift_result_r(space, 0);
|
||||
return ~m_mb14241->shift_result_r();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mw8080bw_state::bowler_lights_1_w)
|
||||
@ -3244,12 +3216,12 @@ ROM_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
/* PCB # year rom parent machine inp init monitor,company,fullname,flags */
|
||||
// PCB # year rom parent machine inp state init monitor company,fullname,flags
|
||||
|
||||
/* 596 */ GAMEL( 1976, seawolf, 0, seawolf, seawolf, mw8080bw_state, empty_init, ROT0, "Dave Nutting Associates / Midway", "Sea Wolf (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_seawolf )
|
||||
/* 596 */ GAMEL( 1976, seawolfo, seawolf, seawolf, seawolf, mw8080bw_state, empty_init, ROT0, "Dave Nutting Associates / Midway", "Sea Wolf (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_seawolf )
|
||||
/* 597 */ GAMEL( 1975, gunfight, 0, gunfight, gunfight, mw8080bw_state, empty_init, ROT0, "Dave Nutting Associates / Midway", "Gun Fight (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_gunfight )
|
||||
/* 597 */ GAMEL( 1975, gunfighto, gunfight, gunfight, gunfight, mw8080bw_state, empty_init, ROT0, "Dave Nutting Associates / Midway", "Gun Fight (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_gunfight )
|
||||
/* 597 */ GAMEL( 1975, gunfight, 0, gunfight, gunfight, gunfight_state, empty_init, ROT0, "Dave Nutting Associates / Midway", "Gun Fight (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_gunfight )
|
||||
/* 597 */ GAMEL( 1975, gunfighto, gunfight, gunfight, gunfight, gunfight_state, empty_init, ROT0, "Dave Nutting Associates / Midway", "Gun Fight (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_gunfight )
|
||||
/* 604 Gun Fight (cocktail, dump does not exist) */
|
||||
/* 605 */ GAME( 1976, tornbase, 0, tornbase, tornbase, mw8080bw_state, empty_init, ROT0, "Dave Nutting Associates / Midway / Taito", "Tornado Baseball / Ball Park", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
/* 610 */ GAMEL( 1976, 280zzzap, 0, zzzap, zzzap, mw8080bw_state, empty_init, ROT0, "Dave Nutting Associates / Midway", "280-ZZZAP", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE, layout_280zzzap )
|
||||
@ -3268,7 +3240,7 @@ ROM_END
|
||||
/* 642 */ GAME( 1978, einning, 0, dplay, einning, mw8080bw_state, empty_init, ROT0, "Midway / Taito", "Extra Inning / Ball Park II", MACHINE_SUPPORTS_SAVE )
|
||||
/* 643 */ GAME( 1978, shuffle, 0, shuffle, shuffle, mw8080bw_state, empty_init, ROT90, "Midway", "Shuffleboard", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
/* 644 */ GAME( 1977, dogpatch, 0, dogpatch, dogpatch, mw8080bw_state, empty_init, ROT0, "Midway", "Dog Patch", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
/* 645 */ GAMEL( 1980, spcenctr, 0, spcenctr, spcenctr, mw8080bw_state, empty_init, ROT0, "Midway", "Space Encounters", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_spcenctr )
|
||||
/* 645 */ GAMEL( 1980, spcenctr, 0, spcenctr, spcenctr, spcenctr_state, empty_init, ROT0, "Midway", "Space Encounters", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_spcenctr )
|
||||
/* 652 */ GAMEL( 1979, phantom2, 0, phantom2, phantom2, mw8080bw_state, empty_init, ROT0, "Midway", "Phantom II", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_phantom2 )
|
||||
/* 730 */ GAME( 1978, bowler, 0, bowler, bowler, mw8080bw_state, empty_init, ROT90, "Midway", "Bowling Alley", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
|
||||
/* 739 */ GAMEL( 1978, invaders, 0, invaders, invaders, mw8080bw_state, empty_init, ROT270, "Taito / Midway", "Space Invaders / Space Invaders M", MACHINE_SUPPORTS_SAVE, layout_invaders )
|
||||
|
@ -318,7 +318,7 @@ void nexus3d_state::nexus3d(machine_config &config)
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &nexus3d_state::nexus3d_map);
|
||||
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_raw((XTAL(14'318'180)*2), 454*2, 0, 640, 262*2, 0, 480); // not accurate, needs CRTC understanding
|
||||
m_screen->set_raw((XTAL(14'318'181)*2), 454*2, 0, 640, 262*2, 0, 480); // not accurate, needs CRTC understanding
|
||||
m_screen->set_screen_update(FUNC(nexus3d_state::screen_update));
|
||||
m_screen->screen_vblank().set(FUNC(nexus3d_state::screen_vblank));
|
||||
m_screen->set_palette("palette");
|
||||
|
@ -1952,6 +1952,7 @@ void snowbros_state::finalttr(machine_config &config)
|
||||
ymsnd.add_route(1, "mono", 0.08);
|
||||
|
||||
m_oki->set_clock(999900);
|
||||
m_oki->reset_routes().add_route(ALL_OUTPUTS, "mono", 0.4);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,12 @@
|
||||
Midway 8080-based black and white hardware
|
||||
|
||||
****************************************************************************/
|
||||
#ifndef MAME_INCLUDES_MW8080BW_H
|
||||
#define MAME_INCLUDES_MW8080BW_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "audio/mw8080bw.h"
|
||||
|
||||
#include "machine/mb14241.h"
|
||||
#include "machine/timer.h"
|
||||
@ -33,16 +39,15 @@
|
||||
#define MW8080BW_INT_TRIGGER_VBLANK_2 (1)
|
||||
#define MW8080BW_60HZ (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)
|
||||
|
||||
/* +4 is added to HBSTART because the hardware displays that many pixels after
|
||||
setting HBLANK */
|
||||
// +4 is added to HBSTART because the hardware displays that many pixels after setting HBLANK
|
||||
#define MW8080BW_HPIXCOUNT (MW8080BW_HBSTART + 4)
|
||||
|
||||
|
||||
class mw8080bw_state : public driver_device
|
||||
{
|
||||
public:
|
||||
mw8080bw_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
mw8080bw_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this,"maincpu"),
|
||||
m_mb14241(*this,"mb14241"),
|
||||
m_watchdog(*this, "watchdog"),
|
||||
@ -51,8 +56,6 @@ public:
|
||||
m_colorram2(*this, "colorram2"),
|
||||
m_discrete(*this, "discrete"),
|
||||
m_samples(*this, "samples"),
|
||||
m_samples1(*this, "samples1"),
|
||||
m_samples2(*this, "samples2"),
|
||||
m_sn1(*this, "sn1"),
|
||||
m_sn2(*this, "sn2"),
|
||||
m_sn(*this, "snsnd"),
|
||||
@ -68,7 +71,6 @@ public:
|
||||
void checkmat(machine_config &config);
|
||||
void checkmat_audio(machine_config &config);
|
||||
void clowns(machine_config &config);
|
||||
void clowns_audio(machine_config &config);
|
||||
void desertgu(machine_config &config);
|
||||
void desertgu_audio(machine_config &config);
|
||||
void dogpatch(machine_config &config);
|
||||
@ -76,29 +78,21 @@ public:
|
||||
void dplay(machine_config &config);
|
||||
void dplay_audio(machine_config &config);
|
||||
void gmissile(machine_config &config);
|
||||
void gmissile_audio(machine_config &config);
|
||||
void gunfight(machine_config &config);
|
||||
void gunfight_audio(machine_config &config);
|
||||
void invad2ct(machine_config &config);
|
||||
void invad2ct_audio(machine_config &config);
|
||||
void invaders(machine_config &config);
|
||||
void invaders_audio(machine_config &config);
|
||||
void invaders_samples_audio(machine_config &config);
|
||||
void m4(machine_config &config);
|
||||
void m4_audio(machine_config &config);
|
||||
void maze(machine_config &config);
|
||||
void maze_audio(machine_config &config);
|
||||
void mw8080bw_root(machine_config &config);
|
||||
void phantom2(machine_config &config);
|
||||
void phantom2_audio(machine_config &config);
|
||||
void seawolf(machine_config &config);
|
||||
void seawolf_audio(machine_config &config);
|
||||
void shuffle(machine_config &config);
|
||||
void shuffle_audio(machine_config &config);
|
||||
void spacwalk(machine_config &config);
|
||||
void spacwalk_audio(machine_config &config);
|
||||
void spcenctr(machine_config &config);
|
||||
void spcenctr_audio(machine_config &config);
|
||||
void tornbase(machine_config &config);
|
||||
void tornbase_audio(machine_config &config);
|
||||
void zzzap(machine_config &config);
|
||||
@ -142,16 +136,12 @@ protected:
|
||||
|
||||
/* other devices */
|
||||
optional_device<samples_device> m_samples;
|
||||
optional_device<samples_device> m_samples1;
|
||||
optional_device<samples_device> m_samples2;
|
||||
optional_device<sn76477_device> m_sn1;
|
||||
optional_device<sn76477_device> m_sn2;
|
||||
optional_device<sn76477_device> m_sn;
|
||||
required_device<screen_device> m_screen;
|
||||
|
||||
/* sound-related */
|
||||
uint8_t m_port_1_last;
|
||||
uint8_t m_port_2_last;
|
||||
uint8_t m_port_1_last_extra;
|
||||
uint8_t m_port_2_last_extra;
|
||||
uint8_t m_port_3_last_extra;
|
||||
@ -176,13 +166,6 @@ private:
|
||||
uint8_t m_desertgun_controller_select;
|
||||
uint8_t m_clowns_controller_select;
|
||||
|
||||
uint8_t m_spcenctr_strobe_state;
|
||||
uint8_t m_spcenctr_trench_width;
|
||||
uint8_t m_spcenctr_trench_center;
|
||||
uint8_t m_spcenctr_trench_slope[16]; /* 16x4 bit RAM */
|
||||
uint8_t m_spcenctr_bright_control;
|
||||
uint8_t m_spcenctr_brightness;
|
||||
|
||||
/* timers */
|
||||
emu_timer *m_interrupt_timer;
|
||||
emu_timer *m_maze_tone_timer;
|
||||
@ -194,27 +177,15 @@ private:
|
||||
DECLARE_WRITE8_MEMBER(mw8080bw_reversable_shift_count_w);
|
||||
DECLARE_WRITE8_MEMBER(seawolf_explosion_lamp_w);
|
||||
DECLARE_WRITE8_MEMBER(seawolf_periscope_lamp_w);
|
||||
DECLARE_WRITE8_MEMBER(gunfight_io_w);
|
||||
DECLARE_WRITE8_MEMBER(tornbase_io_w);
|
||||
DECLARE_WRITE8_MEMBER(maze_coin_counter_w);
|
||||
DECLARE_WRITE8_MEMBER(maze_io_w);
|
||||
DECLARE_WRITE8_MEMBER(checkmat_io_w);
|
||||
DECLARE_WRITE8_MEMBER(spcenctr_io_w);
|
||||
DECLARE_READ8_MEMBER(bowler_shift_result_r);
|
||||
DECLARE_WRITE8_MEMBER(bowler_lights_1_w);
|
||||
DECLARE_WRITE8_MEMBER(bowler_lights_2_w);
|
||||
DECLARE_WRITE8_MEMBER(seawolf_audio_w);
|
||||
DECLARE_WRITE8_MEMBER(gunfight_audio_w);
|
||||
DECLARE_WRITE8_MEMBER(zzzap_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(zzzap_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(gmissile_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(gmissile_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(gmissile_audio_3_w);
|
||||
DECLARE_WRITE8_MEMBER(m4_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(m4_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(clowns_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(phantom2_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(phantom2_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(bowler_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(bowler_audio_3_w);
|
||||
DECLARE_WRITE8_MEMBER(bowler_audio_4_w);
|
||||
@ -226,16 +197,12 @@ private:
|
||||
DECLARE_MACHINE_START(gmissile);
|
||||
DECLARE_MACHINE_START(m4);
|
||||
DECLARE_MACHINE_START(clowns);
|
||||
DECLARE_MACHINE_START(spcenctr);
|
||||
DECLARE_MACHINE_START(phantom2);
|
||||
DECLARE_MACHINE_START(invaders);
|
||||
DECLARE_SOUND_START(samples);
|
||||
uint32_t screen_update_spcenctr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_phantom2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_phantom2);
|
||||
TIMER_CALLBACK_MEMBER(maze_tone_timing_timer_callback);
|
||||
TIMER_CALLBACK_MEMBER(interrupt_trigger);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(spcenctr_strobe_timer_callback);
|
||||
DECLARE_WRITE8_MEMBER(midway_tone_generator_lo_w);
|
||||
DECLARE_WRITE8_MEMBER(midway_tone_generator_hi_w);
|
||||
DECLARE_WRITE8_MEMBER(tornbase_audio_w);
|
||||
@ -244,15 +211,11 @@ private:
|
||||
DECLARE_WRITE8_MEMBER(desertgu_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(desertgu_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(dplay_audio_w);
|
||||
DECLARE_WRITE8_MEMBER(clowns_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(spacwalk_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(spacwalk_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(shuffle_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(shuffle_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(dogpatch_audio_w);
|
||||
DECLARE_WRITE8_MEMBER(spcenctr_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(spcenctr_audio_2_w);
|
||||
DECLARE_WRITE8_MEMBER(spcenctr_audio_3_w);
|
||||
DECLARE_WRITE8_MEMBER(bowler_audio_1_w);
|
||||
DECLARE_WRITE8_MEMBER(blueshrk_audio_w);
|
||||
DECLARE_WRITE8_MEMBER(invad2ct_audio_1_w);
|
||||
@ -276,7 +239,6 @@ private:
|
||||
void dogpatch_io_map(address_map &map);
|
||||
void dplay_io_map(address_map &map);
|
||||
void gmissile_io_map(address_map &map);
|
||||
void gunfight_io_map(address_map &map);
|
||||
void invad2ct_io_map(address_map &map);
|
||||
void invaders_io_map(address_map &map);
|
||||
void m4_io_map(address_map &map);
|
||||
@ -286,12 +248,61 @@ private:
|
||||
void seawolf_io_map(address_map &map);
|
||||
void shuffle_io_map(address_map &map);
|
||||
void spacwalk_io_map(address_map &map);
|
||||
void spcenctr_io_map(address_map &map);
|
||||
void tornbase_io_map(address_map &map);
|
||||
void zzzap_io_map(address_map &map);
|
||||
};
|
||||
|
||||
|
||||
class gunfight_state : public mw8080bw_state
|
||||
{
|
||||
public:
|
||||
gunfight_state(machine_config const &mconfig, device_type type, char const *tag) :
|
||||
mw8080bw_state(mconfig, type, tag),
|
||||
m_soundboard(*this, "soundboard")
|
||||
{
|
||||
}
|
||||
|
||||
void gunfight(machine_config &config);
|
||||
|
||||
private:
|
||||
void io_w(offs_t offset, u8 data);
|
||||
|
||||
void io_map(address_map &map);
|
||||
|
||||
required_device<gunfight_audio_device> m_soundboard;
|
||||
};
|
||||
|
||||
|
||||
class spcenctr_state : public mw8080bw_state
|
||||
{
|
||||
public:
|
||||
spcenctr_state(machine_config const &mconfig, device_type type, char const *tag) :
|
||||
mw8080bw_state(mconfig, type, tag),
|
||||
m_soundboard(*this, "soundboard")
|
||||
{
|
||||
}
|
||||
|
||||
void spcenctr(machine_config &config);
|
||||
|
||||
protected:
|
||||
DECLARE_MACHINE_START(spcenctr);
|
||||
|
||||
private:
|
||||
void io_w(offs_t offset, u8 data);
|
||||
|
||||
u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect);
|
||||
|
||||
void io_map(address_map &map);
|
||||
|
||||
required_device<spcenctr_audio_device> m_soundboard;
|
||||
u8 m_trench_width;
|
||||
u8 m_trench_center;
|
||||
u8 m_trench_slope[16]; // 16x4 bit RAM
|
||||
u8 m_bright_control;
|
||||
u8 m_brightness;
|
||||
};
|
||||
|
||||
|
||||
#define SEAWOLF_GUN_PORT_TAG ("GUN")
|
||||
|
||||
#define TORNBASE_CAB_TYPE_UPRIGHT_OLD (0)
|
||||
@ -334,3 +345,4 @@ private:
|
||||
|
||||
extern const internal_layout layout_invaders;
|
||||
|
||||
#endif // MAME_INCLUDES_MW8080BW_H
|
||||
|
@ -19,21 +19,19 @@ uint32_t mw8080bw_state::screen_update_mw8080bw(screen_device &screen, bitmap_rg
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* plot the current pixel */
|
||||
// plot the current pixel
|
||||
pen_t pen = (video_data & 0x01) ? rgb_t::white() : rgb_t::black();
|
||||
bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, x) = pen;
|
||||
|
||||
/* next pixel */
|
||||
// next pixel
|
||||
video_data = video_data >> 1;
|
||||
x = x + 1;
|
||||
|
||||
/* end of line? */
|
||||
if (x == 0)
|
||||
{
|
||||
/* yes, flush out the shift register */
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
// yes, flush out the shift register
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
pen = (video_data & 0x01) ? rgb_t::white() : rgb_t::black();
|
||||
bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, 256 + i) = pen;
|
||||
@ -41,18 +39,17 @@ uint32_t mw8080bw_state::screen_update_mw8080bw(screen_device &screen, bitmap_rg
|
||||
video_data = video_data >> 1;
|
||||
}
|
||||
|
||||
/* next row, video_data is now 0, so the next line will start
|
||||
with 4 blank pixels */
|
||||
// next row, video_data is now 0, so the next line will start with 4 blank pixels
|
||||
y = y + 1;
|
||||
|
||||
/* end of screen? */
|
||||
// end of screen?
|
||||
if (y == 0)
|
||||
break;
|
||||
}
|
||||
/* the video RAM is read at every 8 pixels starting with pixel 4 */
|
||||
else if ((x & 0x07) == 0x04)
|
||||
{
|
||||
offs_t offs = ((offs_t)y << 5) | (x >> 3);
|
||||
offs_t const offs = ((offs_t)y << 5) | (x >> 3);
|
||||
video_data = m_main_ram[offs];
|
||||
}
|
||||
}
|
||||
@ -95,7 +92,7 @@ uint32_t mw8080bw_state::screen_update_mw8080bw(screen_device &screen, bitmap_rg
|
||||
#define SPCENCTR_BRIGHTNESS_DECAY 10
|
||||
|
||||
|
||||
uint32_t mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
uint32_t spcenctr_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
uint8_t line_buf[256]; /* 256x1 bit RAM */
|
||||
|
||||
@ -105,41 +102,38 @@ uint32_t mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rg
|
||||
uint8_t draw_line = 0;
|
||||
uint8_t draw_trench = 0;
|
||||
uint8_t draw_floor = 0;
|
||||
uint8_t width = m_spcenctr_trench_width;
|
||||
uint8_t width = m_trench_width;
|
||||
uint8_t floor_width = width;
|
||||
uint8_t center = m_spcenctr_trench_center;
|
||||
uint8_t center = m_trench_center;
|
||||
|
||||
memset(line_buf, 0, 256);
|
||||
|
||||
if(m_spcenctr_bright_control)
|
||||
m_spcenctr_brightness = 255;
|
||||
else if(m_spcenctr_brightness > SPCENCTR_BRIGHTNESS_DECAY)
|
||||
m_spcenctr_brightness -= SPCENCTR_BRIGHTNESS_DECAY;
|
||||
if (m_bright_control)
|
||||
m_brightness = 255;
|
||||
else if (m_brightness > SPCENCTR_BRIGHTNESS_DECAY)
|
||||
m_brightness -= SPCENCTR_BRIGHTNESS_DECAY;
|
||||
else
|
||||
m_spcenctr_brightness = 0;
|
||||
m_brightness = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* plot the current pixel */
|
||||
// plot the current pixel
|
||||
uint8_t bit = video_data & 0x01;
|
||||
pen_t pen = bit ? rgb_t::white() : rgb_t::black();
|
||||
|
||||
/* possibly draw trench in the background, top of trench first */
|
||||
if (!(width & 0x80) && draw_trench)
|
||||
if (!(width & 0x80) && draw_trench) // possibly draw trench in the background, top of trench first
|
||||
{
|
||||
line_buf[x] = draw_line;
|
||||
|
||||
if (!bit)
|
||||
pen = draw_line ? SPCENCTR_TOP_TRENCH_LIGHT_RGB32_PEN : SPCENCTR_TOP_TRENCH_DARK_RGB32_PEN;
|
||||
}
|
||||
/* sides of trench? */
|
||||
else if (!(floor_width & 0x80) && (draw_trench || draw_floor))
|
||||
else if (!(floor_width & 0x80) && (draw_trench || draw_floor)) // sides of trench?
|
||||
{
|
||||
if (!bit)
|
||||
pen = line_buf[x] ? SPCENCTR_SIDE_TRENCH_LIGHT_RGB32_PEN : SPCENCTR_SIDE_TRENCH_DARK_RGB32_PEN;
|
||||
}
|
||||
/* bottom of trench? */
|
||||
else if (draw_floor)
|
||||
else if (draw_floor) // bottom of trench?
|
||||
{
|
||||
line_buf[x] = line_buf[x - 1];
|
||||
|
||||
@ -147,8 +141,8 @@ uint32_t mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rg
|
||||
pen = line_buf[x] ? SPCENCTR_BOTTOM_TRENCH_LIGHT_RGB32_PEN : SPCENCTR_BOTTOM_TRENCH_DARK_RGB32_PEN;
|
||||
}
|
||||
|
||||
if(m_spcenctr_brightness > (pen & 0xff))
|
||||
pen = rgb_t(m_spcenctr_brightness, m_spcenctr_brightness, m_spcenctr_brightness);
|
||||
if (m_brightness > (pen & 0xff))
|
||||
pen = rgb_t(m_brightness, m_brightness, m_brightness);
|
||||
|
||||
bitmap.pix32(y - MW8080BW_VCOUNTER_START_NO_VBLANK, x) = pen;
|
||||
|
||||
@ -156,25 +150,19 @@ uint32_t mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rg
|
||||
width = width + ((center & 0x80) ? -1 : 1);
|
||||
floor_width = floor_width + ((center & 0x80) ? -1 : 1);
|
||||
|
||||
/* next pixel */
|
||||
// next pixel
|
||||
video_data = video_data >> 1;
|
||||
x = x + 1;
|
||||
|
||||
/* end of line? */
|
||||
if (x == 0)
|
||||
if (x == 0) // end of line?
|
||||
{
|
||||
offs_t offs;
|
||||
uint8_t trench_control;
|
||||
|
||||
/* yes, flush out the shift register */
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
// yes, flush out the shift register
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if(video_data & 0x01)
|
||||
if (video_data & 0x01)
|
||||
pen = rgb_t::white();
|
||||
else if(m_spcenctr_brightness)
|
||||
pen = rgb_t(m_spcenctr_brightness, m_spcenctr_brightness, m_spcenctr_brightness);
|
||||
else if(m_brightness)
|
||||
pen = rgb_t(m_brightness, m_brightness, m_brightness);
|
||||
else
|
||||
pen = rgb_t::black();
|
||||
|
||||
@ -184,8 +172,8 @@ uint32_t mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rg
|
||||
}
|
||||
|
||||
/* update the trench control for the next line */
|
||||
offs = ((offs_t)y << 5) | 0x1f;
|
||||
trench_control = m_main_ram[offs];
|
||||
offs_t const offs = ((offs_t)y << 5) | 0x1f;
|
||||
uint8_t const trench_control = m_main_ram[offs];
|
||||
|
||||
if (trench_control & 0x40)
|
||||
draw_trench = 1;
|
||||
@ -201,26 +189,24 @@ uint32_t mw8080bw_state::screen_update_spcenctr(screen_device &screen, bitmap_rg
|
||||
|
||||
draw_line = (trench_control & 0x80) >> 7;
|
||||
|
||||
/* add the lower 2 bits stored in the slope array to width */
|
||||
// add the lower 2 bits stored in the slope array to width
|
||||
if (draw_trench)
|
||||
width = width + (m_spcenctr_trench_slope[y & 0x0f] & 0x03);
|
||||
width = width + (m_trench_slope[y & 0x0f] & 0x03);
|
||||
|
||||
/* add the higher 2 bits stored in the slope array to floor width */
|
||||
// add the higher 2 bits stored in the slope array to floor width
|
||||
if (draw_floor)
|
||||
floor_width = floor_width + ((m_spcenctr_trench_slope[y & 0x0f] & 0x0c) >> 2);
|
||||
floor_width = floor_width + ((m_trench_slope[y & 0x0f] & 0x0c) >> 2);
|
||||
|
||||
/* next row, video_data is now 0, so the next line will start
|
||||
with 4 blank pixels */
|
||||
// next row, video_data is now 0, so the next line will start with 4 blank pixels
|
||||
y = y + 1;
|
||||
|
||||
/* end of screen? */
|
||||
// end of screen?
|
||||
if (y == 0)
|
||||
break;
|
||||
}
|
||||
/* the video RAM is read at every 8 pixels starting with pixel 4 */
|
||||
else if ((x & 0x07) == 0x04)
|
||||
else if ((x & 0x07) == 0x04) // the video RAM is read at every 8 pixels starting with pixel 4
|
||||
{
|
||||
offs_t offs = ((offs_t)y << 5) | (x >> 3);
|
||||
offs_t const offs = ((offs_t)y << 5) | (x >> 3);
|
||||
video_data = m_main_ram[offs];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user