blockade: Rewrite driver

* Remove fake interrupts and rewrite coin handling
* Use correct CPU type
* Use screen raw parameters
* Use generic 8x8x1 gfx layout
* Update ROM filenames
This commit is contained in:
Dirk Best 2017-02-26 15:09:08 +01:00
parent 239dcd4449
commit 663c789014
5 changed files with 431 additions and 592 deletions

View File

@ -3090,9 +3090,6 @@ files {
MAME_DIR .. "src/mame/video/angelkds.cpp",
MAME_DIR .. "src/mame/drivers/bingoc.cpp",
MAME_DIR .. "src/mame/drivers/blockade.cpp",
MAME_DIR .. "src/mame/includes/blockade.h",
MAME_DIR .. "src/mame/audio/blockade.cpp",
MAME_DIR .. "src/mame/video/blockade.cpp",
MAME_DIR .. "src/mame/drivers/calorie.cpp",
MAME_DIR .. "src/mame/drivers/chihiro.cpp",
MAME_DIR .. "src/mame/includes/xbox_nv2a.h",

View File

@ -1,65 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Frank Palazzolo
#include "emu.h"
#include "includes/blockade.h"
#include "sound/discrete.h"
#include "sound/samples.h"
#define BLOCKADE_LOG 0
/*
* This still needs the noise generator stuff,
* along with proper mixing and volume control
*/
#define BLOCKADE_NOTE_DATA NODE_01
#define BLOCKADE_NOTE NODE_02
DISCRETE_SOUND_START(blockade)
DISCRETE_INPUT_DATA (BLOCKADE_NOTE_DATA)
/************************************************/
/* Note sound is created by a divider circuit. */
/* The master clock is the 93681.5 Hz, from the */
/* 555 oscillator. This is then sent to a */
/* preloadable 8 bit counter, which loads the */
/* value from OUT02 when overflowing from 0xFF */
/* to 0x00. Therefore it divides by 2 (OUT02 */
/* = FE) to 256 (OUT02 = 00). */
/* There is also a final /2 stage. */
/* Note that there is no music disable line. */
/* When there is no music, the game sets the */
/* oscillator to 0Hz. (OUT02 = FF) */
/************************************************/
DISCRETE_NOTE(BLOCKADE_NOTE, 1, 93681.5, BLOCKADE_NOTE_DATA, 255, 1, DISC_CLK_IS_FREQ | DISC_OUT_IS_ENERGY)
DISCRETE_CRFILTER(NODE_10, BLOCKADE_NOTE, RES_K(35), CAP_U(.01))
DISCRETE_OUTPUT(NODE_10, 7500)
DISCRETE_SOUND_END
WRITE8_MEMBER(blockade_state::blockade_sound_freq_w)
{
m_discrete->write(space,BLOCKADE_NOTE_DATA, data);
return;
}
WRITE8_MEMBER(blockade_state::blockade_env_on_w)
{
if (BLOCKADE_LOG) osd_printf_debug("Boom Start\n");
m_samples->start(0,0);
return;
}
WRITE8_MEMBER(blockade_state::blockade_env_off_w)
{
if (BLOCKADE_LOG) osd_printf_debug("Boom End\n");
return;
}
const char *const blockade_sample_names[] =
{
"*blockade",
"boom",
nullptr
};

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Frank Palazzolo
#include "sound/discrete.h"
#include "sound/samples.h"
class blockade_state : public driver_device
{
public:
blockade_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_discrete(*this, "discrete"),
m_maincpu(*this, "maincpu"),
m_samples(*this, "samples"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen") { }
required_shared_ptr<uint8_t> m_videoram;
required_device<discrete_device> m_discrete;
/* video-related */
tilemap_t *m_bg_tilemap;
/* input-related */
uint8_t m_coin_latch; /* Active Low */
uint8_t m_just_been_reset;
DECLARE_READ8_MEMBER(blockade_input_port_0_r);
DECLARE_WRITE8_MEMBER(blockade_coin_latch_w);
DECLARE_WRITE8_MEMBER(blockade_videoram_w);
DECLARE_WRITE8_MEMBER(blockade_env_on_w);
DECLARE_WRITE8_MEMBER(blockade_env_off_w);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update_blockade(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(blockade_interrupt);
DECLARE_WRITE8_MEMBER(blockade_sound_freq_w);
required_device<cpu_device> m_maincpu;
required_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
};
/*----------- defined in audio/blockade.c -----------*/
extern const char *const blockade_sample_names[];
DISCRETE_SOUND_EXTERN( blockade );

View File

@ -1,34 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Frank Palazzolo
#include "emu.h"
#include "includes/blockade.h"
WRITE8_MEMBER(blockade_state::blockade_videoram_w)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset);
if (ioport("IN3")->read() & 0x80)
{
logerror("blockade_videoram_w: scanline %d\n", m_screen->vpos());
space.device().execute().spin_until_interrupt();
}
}
TILE_GET_INFO_MEMBER(blockade_state::get_bg_tile_info)
{
int code = m_videoram[tile_index];
SET_TILE_INFO_MEMBER(0, code, 0, 0);
}
void blockade_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(blockade_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
uint32_t blockade_state::screen_update_blockade(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}