summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/piratesh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/piratesh.cpp')
-rw-r--r--src/mame/drivers/piratesh.cpp63
1 files changed, 32 insertions, 31 deletions
diff --git a/src/mame/drivers/piratesh.cpp b/src/mame/drivers/piratesh.cpp
index df7940e6279..5c989ecbe32 100644
--- a/src/mame/drivers/piratesh.cpp
+++ b/src/mame/drivers/piratesh.cpp
@@ -28,9 +28,10 @@
**************************************************************************/
#include "emu.h"
-#include "speaker.h"
-#include "cpu/m68000/m68000.h"
+
#include "includes/konamigx.h" // TODO: WHY?
+
+#include "cpu/m68000/m68000.h"
#include "machine/gen_latch.h"
#include "machine/k053252.h"
#include "machine/nvram.h"
@@ -43,22 +44,25 @@
#include "video/k055555.h"
#include "video/konami_helper.h"
+#include "speaker.h"
+
+
class piratesh_state : public driver_device
{
public:
- piratesh_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this,"maincpu"),
- m_k053250(*this, "k053250"),
- m_k053252(*this, "k053252"),
- m_k056832(*this, "k056832"),
- m_k055673(*this, "k055673"),
- m_k055555(*this, "k055555"),
-// m_k053246(*this, "k053246"),
- m_k054539(*this, "k054539"),
- m_tickets(*this, "ticket"),
- m_hopper(*this, "hopper"),
- m_spriteram(*this,"spriteram")
+ piratesh_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
+ m_maincpu(*this,"maincpu"),
+ m_k053250(*this, "k053250"),
+ m_k053252(*this, "k053252"),
+ m_k056832(*this, "k056832"),
+ m_k055673(*this, "k055673"),
+ m_k055555(*this, "k055555"),
+ //m_k053246(*this, "k053246"),
+ m_k054539(*this, "k054539"),
+ m_tickets(*this, "ticket"),
+ m_hopper(*this, "hopper"),
+ m_spriteram(*this,"spriteram")
{ }
void piratesh(machine_config &config);
@@ -66,6 +70,11 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(helm_r);
DECLARE_CUSTOM_INPUT_MEMBER(battery_r);
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
private:
required_device<cpu_device> m_maincpu;
@@ -104,9 +113,6 @@ private:
DECLARE_READ16_MEMBER(k053247_martchmp_word_r);
DECLARE_WRITE16_MEMBER(k053247_martchmp_word_w);
- DECLARE_MACHINE_START(piratesh);
- DECLARE_MACHINE_RESET(piratesh);
- DECLARE_VIDEO_START(piratesh);
uint32_t screen_update_piratesh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(k054539_nmi_gen);
TIMER_DEVICE_CALLBACK_MEMBER(piratesh_interrupt);
@@ -139,7 +145,7 @@ K056832_CB_MEMBER(piratesh_state::piratesh_tile_callback)
// Color
// Flags
// if (*color != 0)
-// printf("%x %x %x\n", layer, *code, *color >> 2);
+// logerror("%x %x %x\n", layer, *code, *color >> 2);
*color = (m_layer_colorbase[layer] << 4) + ((*color >> 2));// & 0x0f);
}
@@ -189,7 +195,7 @@ K055673_CB_MEMBER(piratesh_state::piratesh_sprite_callback)
-VIDEO_START_MEMBER(piratesh_state, piratesh)
+void piratesh_state::video_start()
{
// TODO: These come from the 055555
m_layer_colorbase[0] = 0;
@@ -347,7 +353,7 @@ WRITE16_MEMBER(piratesh_state::control1_w)
// .... x... .... .... - Lamp? (active when waiting to start game)
if (data & ~0x0f00)
- printf("CTRL3: %x %x %x\n", offset, data, mem_mask);
+ logerror("CTRL3: %x %x %x\n", offset, data, mem_mask);
}
WRITE16_MEMBER(piratesh_state::control2_w)
@@ -369,7 +375,7 @@ WRITE16_MEMBER(piratesh_state::control2_w)
update_interrupts();
if (data & ~0xfbf0)
- printf("CTRL2: %x %x %x\n", offset, data, mem_mask);
+ logerror("CTRL2: %x %x %x\n", offset, data, mem_mask);
}
WRITE16_MEMBER(piratesh_state::control3_w)
@@ -381,9 +387,9 @@ WRITE16_MEMBER(piratesh_state::control3_w)
// .... ...x .... .... - Unknown (always 1?)
if ((data & ~0x0133) || (~data & 0x100))
- printf("CTRL1 W: %x %x %x\n", offset, data, mem_mask);
+ logerror("CTRL1 W: %x %x %x\n", offset, data, mem_mask);
-// printf("CTRL 1: %x\n", data & 0x0010);
+// logerror("CTRL 1: %x\n", data & 0x0010);
m_tickets->motor_w(data & 0x0010 ? 1 : 0);
m_hopper->motor_w(data & 0x0020 ? 1 : 0);
@@ -559,7 +565,7 @@ INPUT_PORTS_END
/**********************************************************************************/
-MACHINE_START_MEMBER(piratesh_state, piratesh)
+void piratesh_state::machine_start()
{
#if 0
m_sound_ctrl = 2;
@@ -574,7 +580,7 @@ MACHINE_START_MEMBER(piratesh_state, piratesh)
#endif
}
-MACHINE_RESET_MEMBER(piratesh_state,piratesh)
+void piratesh_state::machine_reset()
{
m_int_status = 0;
@@ -603,9 +609,6 @@ MACHINE_CONFIG_START(piratesh_state::piratesh)
MCFG_DEVICE_ADD("k053252", K053252, XTAL(32'000'000)/4)
MCFG_K053252_OFFSETS(40, 16) // TODO
- MCFG_MACHINE_START_OVERRIDE(piratesh_state, piratesh)
- MCFG_MACHINE_RESET_OVERRIDE(piratesh_state, piratesh)
-
MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
@@ -647,8 +650,6 @@ MACHINE_CONFIG_START(piratesh_state::piratesh)
MCFG_DEVICE_ADD("k054338", K054338, 0, "k055555")
MCFG_K054338_ALPHAINV(1)
- MCFG_VIDEO_START_OVERRIDE(piratesh_state, piratesh)
-
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();