New systems marked not working

------------------------------
Happy Lucky! [Phil Bennett]

- konami/blockhl.cpp: made it use view instead of bankdev
This commit is contained in:
Ivan Vangelista 2024-02-29 07:19:03 +01:00
parent eceeca2509
commit 661208a015
3 changed files with 222 additions and 39 deletions

View file

@ -1,5 +1,6 @@
// license:BSD-3-Clause // license:BSD-3-Clause
// copyright-holders:Nicola Salmoria // copyright-holders: Nicola Salmoria
/******************************************************************************* /*******************************************************************************
Block Hole (GX973) (c) 1989 Konami Block Hole (GX973) (c) 1989 Konami
@ -18,16 +19,16 @@
*******************************************************************************/ *******************************************************************************/
#include "emu.h" #include "emu.h"
#include "k051960.h"
#include "k052109.h"
#include "konamipt.h" #include "konamipt.h"
#include "cpu/m6809/konami.h" #include "cpu/m6809/konami.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "machine/bankdev.h"
#include "machine/gen_latch.h" #include "machine/gen_latch.h"
#include "machine/watchdog.h" #include "machine/watchdog.h"
#include "sound/ymopm.h" #include "sound/ymopm.h"
#include "k052109.h"
#include "k051960.h"
#include "emupal.h" #include "emupal.h"
#include "speaker.h" #include "speaker.h"
@ -45,13 +46,26 @@ public:
blockhl_state(const machine_config &mconfig, device_type type, const char *tag) : blockhl_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag), driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_bank5800(*this, "bank5800"),
m_audiocpu(*this, "audiocpu"), m_audiocpu(*this, "audiocpu"),
m_k052109(*this, "k052109"), m_k052109(*this, "k052109"),
m_k051960(*this, "k051960"), m_k051960(*this, "k051960"),
m_rombank(*this, "rombank") m_rombank(*this, "rombank"),
m_view5800(*this, "view5800")
{ } { }
void blockhl(machine_config &config);
protected:
virtual void machine_start() override;
private:
required_device<konami_cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<k052109_device> m_k052109;
required_device<k051960_device> m_k051960;
required_memory_bank m_rombank;
memory_view m_view5800;
K052109_CB_MEMBER(tile_callback); K052109_CB_MEMBER(tile_callback);
K051960_CB_MEMBER(sprite_callback); K051960_CB_MEMBER(sprite_callback);
uint32_t screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -62,20 +76,8 @@ public:
void banking_callback(uint8_t data); void banking_callback(uint8_t data);
void blockhl(machine_config &config);
void audio_map(address_map &map); void audio_map(address_map &map);
void bank5800_map(address_map &map);
void main_map(address_map &map); void main_map(address_map &map);
protected:
virtual void machine_start() override;
private:
required_device<konami_cpu_device> m_maincpu;
required_device<address_map_bank_device> m_bank5800;
required_device<cpu_device> m_audiocpu;
required_device<k052109_device> m_k052109;
required_device<k051960_device> m_k051960;
required_memory_bank m_rombank;
}; };
@ -95,17 +97,13 @@ void blockhl_state::main_map(address_map &map)
map(0x1f97, 0x1f97).portr("DSW1"); map(0x1f97, 0x1f97).portr("DSW1");
map(0x1f98, 0x1f98).portr("DSW2"); map(0x1f98, 0x1f98).portr("DSW2");
map(0x4000, 0x57ff).ram(); map(0x4000, 0x57ff).ram();
map(0x5800, 0x5fff).m(m_bank5800, FUNC(address_map_bank_device::amap8)); map(0x5800, 0x5fff).view(m_view5800);
m_view5800[0](0x5800, 0x5fff).ram().w("palette", FUNC(palette_device::write8)).share("palette");
m_view5800[1](0x5800, 0x5fff).ram();
map(0x6000, 0x7fff).bankr("rombank"); map(0x6000, 0x7fff).bankr("rombank");
map(0x8000, 0xffff).rom().region("maincpu", 0x8000); map(0x8000, 0xffff).rom().region("maincpu", 0x8000);
} }
void blockhl_state::bank5800_map(address_map &map)
{
map(0x0000, 0x07ff).ram().w("palette", FUNC(palette_device::write8)).share("palette");
map(0x0800, 0x0fff).ram();
}
void blockhl_state::audio_map(address_map &map) void blockhl_state::audio_map(address_map &map)
{ {
map(0x0000, 0x7fff).rom(); map(0x0000, 0x7fff).rom();
@ -120,7 +118,7 @@ void blockhl_state::audio_map(address_map &map)
// VIDEO EMULATION // VIDEO EMULATION
//************************************************************************** //**************************************************************************
K052109_CB_MEMBER( blockhl_state::tile_callback ) K052109_CB_MEMBER(blockhl_state::tile_callback)
{ {
static const int layer_colorbase[] = { 0 / 16, 256 / 16, 512 / 16 }; static const int layer_colorbase[] = { 0 / 16, 256 / 16, 512 / 16 };
@ -128,7 +126,7 @@ K052109_CB_MEMBER( blockhl_state::tile_callback )
*color = layer_colorbase[layer] + ((*color & 0xe0) >> 5); *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5);
} }
K051960_CB_MEMBER( blockhl_state::sprite_callback ) K051960_CB_MEMBER(blockhl_state::sprite_callback)
{ {
enum { sprite_colorbase = 768 / 16 }; enum { sprite_colorbase = 768 / 16 };
@ -208,7 +206,7 @@ void blockhl_state::banking_callback(uint8_t data)
machine().bookkeeping().coin_counter_w(1, data & 0x10); machine().bookkeeping().coin_counter_w(1, data & 0x10);
// bit 5 = select palette RAM or work RAM at 5800-5fff // bit 5 = select palette RAM or work RAM at 5800-5fff
m_bank5800->set_bank(BIT(data, 5)); m_view5800.select(BIT(data, 5));
// bit 6 = enable char ROM reading through the video RAM // bit 6 = enable char ROM reading through the video RAM
m_k052109->set_rmrd_line(BIT(data, 6) ? ASSERT_LINE : CLEAR_LINE); m_k052109->set_rmrd_line(BIT(data, 6) ? ASSERT_LINE : CLEAR_LINE);
@ -284,12 +282,10 @@ INPUT_PORTS_END
void blockhl_state::blockhl(machine_config &config) void blockhl_state::blockhl(machine_config &config)
{ {
// basic machine hardware // basic machine hardware
KONAMI(config, m_maincpu, XTAL(24'000'000)/2); // Konami 052526 KONAMI(config, m_maincpu, XTAL(24'000'000) / 2); // Konami 052526
m_maincpu->set_addrmap(AS_PROGRAM, &blockhl_state::main_map); m_maincpu->set_addrmap(AS_PROGRAM, &blockhl_state::main_map);
m_maincpu->line().set(FUNC(blockhl_state::banking_callback)); m_maincpu->line().set(FUNC(blockhl_state::banking_callback));
ADDRESS_MAP_BANK(config, "bank5800").set_map(&blockhl_state::bank5800_map).set_options(ENDIANNESS_BIG, 8, 12, 0x800);
Z80(config, m_audiocpu, XTAL(3'579'545)); Z80(config, m_audiocpu, XTAL(3'579'545));
m_audiocpu->set_addrmap(AS_PROGRAM, &blockhl_state::audio_map); m_audiocpu->set_addrmap(AS_PROGRAM, &blockhl_state::audio_map);
@ -297,9 +293,9 @@ void blockhl_state::blockhl(machine_config &config)
// video hardware // video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(XTAL(24'000'000)/3, 528, 112, 400, 256, 16, 240); screen.set_raw(XTAL(24'000'000) / 3, 528, 112, 400, 256, 16, 240);
// 6MHz dotclock is more realistic, however needs drawing updates. replace when ready // 6MHz dotclock is more realistic, however needs drawing updates. replace when ready
// screen.set_raw(XTAL(24'000'000)/4, 396, hbend, hbstart, 256, 16, 240); // screen.set_raw(XTAL(24'000'000) / 4, 396, hbend, hbstart, 256, 16, 240);
screen.set_screen_update(FUNC(blockhl_state::screen_update_blockhl)); screen.set_screen_update(FUNC(blockhl_state::screen_update_blockhl));
screen.set_palette("palette"); screen.set_palette("palette");
@ -330,10 +326,10 @@ void blockhl_state::blockhl(machine_config &config)
//************************************************************************** //**************************************************************************
ROM_START( blockhl ) ROM_START( blockhl )
ROM_REGION( 0x10000, "maincpu", 0 ) // code + banked roms ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "973l02.e21", 0x00000, 0x10000, CRC(e14f849a) SHA1(d44cf178cc98998b72ed32c6e20b6ebdf1f97579) ) ROM_LOAD( "973l02.e21", 0x00000, 0x10000, CRC(e14f849a) SHA1(d44cf178cc98998b72ed32c6e20b6ebdf1f97579) )
ROM_REGION( 0x08000, "audiocpu", 0 ) // 32k for the sound CPU ROM_REGION( 0x08000, "audiocpu", 0 )
ROM_LOAD( "973d01.g6", 0x00000, 0x08000, CRC(eeee9d92) SHA1(6c6c324b1f6f4fba0aa12e0d1fc5dbab133ef669) ) ROM_LOAD( "973d01.g6", 0x00000, 0x08000, CRC(eeee9d92) SHA1(6c6c324b1f6f4fba0aa12e0d1fc5dbab133ef669) )
ROM_REGION( 0x20000, "k052109", 0 ) // tiles ROM_REGION( 0x20000, "k052109", 0 ) // tiles
@ -348,15 +344,15 @@ ROM_START( blockhl )
ROM_LOAD32_BYTE( "973f04.k7", 0x00002, 0x08000, CRC(69ca41bd) SHA1(9b0b1c888efd2f2d5525f14778e18fb4a7353eb6) ) ROM_LOAD32_BYTE( "973f04.k7", 0x00002, 0x08000, CRC(69ca41bd) SHA1(9b0b1c888efd2f2d5525f14778e18fb4a7353eb6) )
ROM_LOAD32_BYTE( "973f03.k4", 0x00003, 0x08000, CRC(21e98472) SHA1(8c697d369a1f57be0825c33b4e9107ce1b02a130) ) ROM_LOAD32_BYTE( "973f03.k4", 0x00003, 0x08000, CRC(21e98472) SHA1(8c697d369a1f57be0825c33b4e9107ce1b02a130) )
ROM_REGION( 0x0100, "priority", 0 ) // priority encoder (not used) ROM_REGION( 0x0100, "priority", 0 ) // not used
ROM_LOAD( "973a11.h10", 0x0000, 0x0100, CRC(46d28fe9) SHA1(9d0811a928c8907785ef483bfbee5445506b3ec8) ) ROM_LOAD( "973a11.h10", 0x0000, 0x0100, CRC(46d28fe9) SHA1(9d0811a928c8907785ef483bfbee5445506b3ec8) )
ROM_END ROM_END
ROM_START( quarth ) ROM_START( quarth )
ROM_REGION( 0x10000, "maincpu", 0 ) // code + banked roms ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "973j02.e21", 0x00000, 0x10000, CRC(27a90118) SHA1(51309385b93db29b9277d14252166c4ea1746303) ) ROM_LOAD( "973j02.e21", 0x00000, 0x10000, CRC(27a90118) SHA1(51309385b93db29b9277d14252166c4ea1746303) )
ROM_REGION( 0x08000, "audiocpu", 0 ) // 32k for the sound CPU ROM_REGION( 0x08000, "audiocpu", 0 )
ROM_LOAD( "973d01.g6", 0x00000, 0x08000, CRC(eeee9d92) SHA1(6c6c324b1f6f4fba0aa12e0d1fc5dbab133ef669) ) ROM_LOAD( "973d01.g6", 0x00000, 0x08000, CRC(eeee9d92) SHA1(6c6c324b1f6f4fba0aa12e0d1fc5dbab133ef669) )
ROM_REGION( 0x20000, "k052109", 0 ) // tiles ROM_REGION( 0x20000, "k052109", 0 ) // tiles
@ -371,7 +367,7 @@ ROM_START( quarth )
ROM_LOAD32_BYTE( "973e04.k7", 0x00002, 0x08000, CRC(d70f4a2c) SHA1(25f835a17bacf2b8debb2eb8a3cff90cab3f402a) ) ROM_LOAD32_BYTE( "973e04.k7", 0x00002, 0x08000, CRC(d70f4a2c) SHA1(25f835a17bacf2b8debb2eb8a3cff90cab3f402a) )
ROM_LOAD32_BYTE( "973e03.k4", 0x00003, 0x08000, CRC(2c5a4b4b) SHA1(e2991dd78b9cd96cf93ebd6de0d4e060d346ab9c) ) ROM_LOAD32_BYTE( "973e03.k4", 0x00003, 0x08000, CRC(2c5a4b4b) SHA1(e2991dd78b9cd96cf93ebd6de0d4e060d346ab9c) )
ROM_REGION( 0x0100, "priority", 0 ) // priority encoder (not used) ROM_REGION( 0x0100, "priority", 0 ) // not used
ROM_LOAD( "973a11.h10", 0x0000, 0x0100, CRC(46d28fe9) SHA1(9d0811a928c8907785ef483bfbee5445506b3ec8) ) ROM_LOAD( "973a11.h10", 0x0000, 0x0100, CRC(46d28fe9) SHA1(9d0811a928c8907785ef483bfbee5445506b3ec8) )
ROM_END ROM_END

View file

@ -43037,6 +43037,9 @@ halleyscj // A62 (c) 1986 Taito Corporation (Japan, rev 1)
halleyscja // A62 (c) 1986 Taito Corporation (Japan) halleyscja // A62 (c) 1986 Taito Corporation (Japan)
halleyscjp // A62 (c) 1985 Taito Corporation (Japan, prototype) halleyscjp // A62 (c) 1985 Taito Corporation (Japan, prototype)
@source:taito/haplucky.cpp
haplucky // A58
@source:taito/heromem.cpp @source:taito/heromem.cpp
heromem // E34 (c) 1997 Taito heromem // E34 (c) 1997 Taito

184
src/mame/taito/haplucky.cpp Normal file
View file

@ -0,0 +1,184 @@
// license:BSD-3-Clause
// copyright-holders:
/*
Happy Lucky! (c) 1985 Taito
Video lottery machine (as the titles screen says)
J1100059A K1100139A CPU BOARD
JII00060A K1100140A VIDEO BOARD
Main components (CPU BOARD):
2 x Z8400APS
1 x M5L8255AP-5
1 x YM2149F
1 x 8 MHz XTAL
1 x 8-DIP switch bank
Main components (VIDEO BOARD):
1 x 24 MHz XTAL
lots of TTLs and RAMs
Possibly missing a ROM board.
*/
#include "emu.h"
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
namespace {
class haplucky_state : public driver_device
{
public:
haplucky_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu")
{ }
void haplucky(machine_config &config);
protected:
virtual void machine_start() override;
private:
required_device<cpu_device> m_maincpu;
uint8_t m_sound_data = 0;
uint8_t m_sound_status = 0x0f;
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void main_map(address_map &map);
void sound_map(address_map &map);
void sound_io_map(address_map &map);
};
uint32_t haplucky_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
return 0;
}
void haplucky_state::machine_start()
{
save_item(NAME(m_sound_data));
save_item(NAME(m_sound_status));
}
void haplucky_state::main_map(address_map &map) // TODO: verify everything
{
map(0x0000, 0x7fff).rom().region("maincpu", 0); // TODO: There's only a 0x4000 ROM, but calls past it. Missing ROM board?
map(0xe000, 0xe7ff).ram();
map(0xf800, 0xffff).ram();
}
void haplucky_state::sound_map(address_map &map) // TODO: verify everything, but program is almost identical to the Super Dead Heat sub CPU one
{
map(0x0000, 0xdfff).rom().region("audiocpu", 0);
map(0x8000, 0x8000).w("dac", FUNC(dac_byte_interface::write));
map(0xf800, 0xffff).ram();
}
void haplucky_state::sound_io_map(address_map &map) // TODO: verify everything, but program is almost identical to the Super Dead Heat sub CPU one
{
map.global_mask(0xff);
map(0xff, 0xff).lr8(NAME([this] () -> uint8_t { return m_sound_data; })).lw8(NAME([this] (uint8_t data) { m_sound_status = 0; }));
}
static INPUT_PORTS_START( haplucky )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW1")
PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1")
PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2")
PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3")
PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4")
PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5")
PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6")
PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7")
PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8")
INPUT_PORTS_END
void haplucky_state::haplucky(machine_config &config)
{
// basic machine hardware
Z80(config, m_maincpu, 8_MHz_XTAL / 2); // divider not verified
m_maincpu->set_addrmap(AS_PROGRAM, &haplucky_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(haplucky_state::irq0_line_hold));
z80_device &audiocpu(Z80(config, "audiocpu", 8_MHz_XTAL / 2)); // divider not verified
audiocpu.set_addrmap(AS_PROGRAM, &haplucky_state::sound_map);
audiocpu.set_addrmap(AS_IO, &haplucky_state::sound_io_map);
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: everything to be verified
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
screen.set_size(32*8, 32*8);
screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
screen.set_screen_update(FUNC(haplucky_state::screen_update));
screen.set_palette("palette");
PALETTE(config, "palette").set_entries(0x800); // TODO: entries to be verified
// sound hardware
SPEAKER(config, "mono").front_center();
ym2149_device &ymsnd(YM2149(config, "ymsnd", 8_MHz_XTAL / 8)); // divider not verified
ymsnd.port_a_read_callback().set([this] () { logerror("%s: PA read\n", machine().describe_context()); return u8(0xff); });
ymsnd.port_a_write_callback().set([this] (u8 data) { logerror("%s: PA write %02X\n", machine().describe_context(), data); });
ymsnd.port_b_read_callback().set([this] () { logerror("%s: PB read\n", machine().describe_context()); return u8(0xff); });
ymsnd.port_b_write_callback().set([this] (u8 data) { logerror("%s: PB write %02X\n", machine().describe_context(), data); });
ymsnd.add_route(ALL_OUTPUTS, "mono", 0.5); // divider not verified
DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.5); // DAC type not verified
}
ROM_START( haplucky )
ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "a58-01-1.ic24", 0x0000, 0x4000, CRC(6bddc224) SHA1(fb3783b4b97c1f9b454e5b8301897d8cfcc0b7b7) ) // MBM27128-25 on CPU board
ROM_FILL( 0x400f, 0x01, 0xc9 ) // code jumps here early, return for now
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "a58-02.ic5", 0x0000, 0x8000, CRC(cfffcffb) SHA1(4808930f6b8cc105d39ffef1525defbc25bd43f4) ) // MBM27256-25 on CPU board
ROM_LOAD( "a58-03.ic6", 0x8000, 0x8000, CRC(470887e4) SHA1(69d9f907816c8c1b39b7c432b4196d04fcd7e365) ) // MBM27256-25 on CPU board
ROM_REGION( 0x400, "plds", 0 )
ROM_LOAD( "a40-09.ic26", 0x000, 0x104, CRC(733d1242) SHA1(3f99940f0c49023cbbd308eacfb5b102a52a68d2) ) // PAL16L8ACN, on video board
ROM_LOAD( "a58-04.ic13", 0x200, 0x104, CRC(cbbe4e50) SHA1(a7b8e23f7d34b0f4b462cffc47a0c0a3d5611d31) ) // PAL16L8ACN, on CPU board
ROM_END
} // anonymous namespace
GAME( 1985, haplucky, 0, haplucky, haplucky, haplucky_state, empty_init, ROT0, "Taito Corporation", "Happy Lucky!", MACHINE_IS_SKELETON )