Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/mame/toaplan/batsugun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"

/*
Name Board No Maker Game name
Expand Down
29 changes: 13 additions & 16 deletions src/mame/toaplan/dogyuun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"

/*
Name Board No Maker Game name
Expand Down Expand Up @@ -78,15 +77,15 @@ class dogyuun_state : public driver_device

void reset_audiocpu(int state);

void base_mem(address_map &map) ATTR_COLD;
void dogyuun_68k_mem(address_map &map) ATTR_COLD;
void v25_mem(address_map &map) ATTR_COLD;
void dogyuunto_68k_mem(address_map &map) ATTR_COLD;
void dogyuunto_sound_z80_mem(address_map &map) ATTR_COLD;
void v25_mem(address_map &map) ATTR_COLD;

required_device<toaplan_coincounter_device> m_coincounter;
required_device<screen_device> m_screen;
bitmap_ind8 m_custom_priority_bitmap;
bitmap_ind16 m_secondary_render_bitmap;
};

void dogyuun_state::reset_audiocpu(int state)
Expand All @@ -107,9 +106,7 @@ void dogyuun_state::machine_reset()
void dogyuun_state::video_start()
{
m_screen->register_screen_bitmap(m_custom_priority_bitmap);
m_secondary_render_bitmap.reset();
m_vdp[0]->custom_priority_bitmap = &m_custom_priority_bitmap;
m_screen->register_screen_bitmap(m_secondary_render_bitmap);
m_vdp[1]->custom_priority_bitmap = &m_custom_priority_bitmap;
}

Expand Down Expand Up @@ -271,37 +268,37 @@ void dogyuun_state::coin_sound_reset_w(u8 data)
m_audiocpu->set_input_line(INPUT_LINE_RESET, BIT(data, B) ? CLEAR_LINE : ASSERT_LINE);
}

void dogyuun_state::dogyuun_68k_mem(address_map &map)
void dogyuun_state::base_mem(address_map &map)
{
map(0x000000, 0x07ffff).rom();
map(0x100000, 0x103fff).ram();
map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write));
map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write));
map(0x700000, 0x700001).r(m_vdp[0], FUNC(gp9001vdp_device::vdpcount_r)); // test bit 8
}

void dogyuun_state::dogyuun_68k_mem(address_map &map)
{
base_mem(map);
map(0x200010, 0x200011).portr("IN1");
map(0x200014, 0x200015).portr("IN2");
map(0x200018, 0x200019).portr("SYS");
map(0x20001d, 0x20001d).w(FUNC(dogyuun_state::coin_sound_reset_w<5>)); // Coin count/lock + v25 reset line
map(0x210000, 0x21ffff).rw(FUNC(dogyuun_state::shared_ram_r), FUNC(dogyuun_state::shared_ram_w)).umask16(0x00ff);
map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write));
map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write));
map(0x700000, 0x700001).r(m_vdp[0], FUNC(gp9001vdp_device::vdpcount_r)); // test bit 8
}


void dogyuun_state::dogyuunto_68k_mem(address_map &map)
{
map(0x000000, 0x07ffff).rom();
map(0x100000, 0x103fff).ram();
base_mem(map);
map(0x218000, 0x218fff).rw(FUNC(dogyuun_state::shared_ram_r), FUNC(dogyuun_state::shared_ram_w)).umask16(0x00ff); // reads the same area as the finished game on startup, but then uses only this part
map(0x21c01d, 0x21c01d).w(FUNC(dogyuun_state::coin_sound_reset_w<4>)); // Coin count/lock + Z80 reset line
map(0x21c020, 0x21c021).portr("IN1");
map(0x21c024, 0x21c025).portr("IN2");
map(0x21c028, 0x21c029).portr("SYS");
map(0x21c02c, 0x21c02d).portr("DSWA");
map(0x21c030, 0x21c031).portr("DSWB");
map(0x300000, 0x30000d).rw(m_vdp[0], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write));
map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x500000, 0x50000d).rw(m_vdp[1], FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write));
map(0x700000, 0x700001).r(m_vdp[0], FUNC(gp9001vdp_device::vdpcount_r)); // test bit 8
}

void dogyuun_state::dogyuunto_sound_z80_mem(address_map &map)
Expand Down
3 changes: 2 additions & 1 deletion src/mame/toaplan/dt7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- service mode doesn't display properly
- currently only coins up with service button
- sound dies after one stage?
- merge tilemap emulation into toaplan/toaplan_txtilemap.cpp?
*/


Expand Down Expand Up @@ -585,7 +586,7 @@ ROM_START( dt7 )

/* Secondary CPU is a Toaplan marked chip, (TS-007-Spy TOA PLAN) */
/* It's a NEC V25 (PLCC94) (encrypted program uploaded by main CPU) */
/* Note, same markings as other games found in toaplan2.cpp, but table is different! */
/* Note, same markings as other games found in toaplan/toaplan2.cpp, but table is different! */

ROM_REGION( 0x400000, "gp9001_0", 0 )
ROM_LOAD( "3a.49", 0x000000, 0x080000, CRC(ba8e378c) SHA1(d5eb4a839d6b3c2b9bf0bd87f06859a01a2c0cbf) )
Expand Down
1 change: 0 additions & 1 deletion src/mame/toaplan/enmadaio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"

/*
Name Board No Maker Game name
Expand Down
97 changes: 17 additions & 80 deletions src/mame/toaplan/fixeight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "gp9001.h"
#include "toaplan_coincounter.h"
#include "toaplan_txtilemap.h"
#include "toaplan_v25_tables.h"
#include "toaplipt.h"

Expand All @@ -18,7 +19,6 @@
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"

/*
Name Board No Maker Game name
Expand Down Expand Up @@ -64,17 +64,14 @@ class fixeight_state : public driver_device
public:
fixeight_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_tx_videoram(*this, "tx_videoram")
, m_tx_lineselect(*this, "tx_lineselect")
, m_tx_linescroll(*this, "tx_linescroll")
, m_tx_gfxram(*this, "tx_gfxram")
, m_shared_ram(*this, "shared_ram")
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
, m_vdp(*this, "gp9001")
, m_oki(*this, "oki")
, m_eeprom(*this, "eeprom")
, m_gfxdecode(*this, "gfxdecode")
, m_tx_tilemap(*this, "tx_tilemap")
, m_screen(*this, "screen")
, m_palette(*this, "palette")
{ }
Expand All @@ -89,35 +86,25 @@ class fixeight_state : public driver_device
void fixeight_68k_mem(address_map &map) ATTR_COLD;
void fixeight_v25_mem(address_map &map) ATTR_COLD;

void create_tx_tilemap(int dx = 0, int dx_flipped = 0) ATTR_COLD;

u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_vblank(int state);
void tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask = ~0);

u8 shared_ram_r(offs_t offset) { return m_shared_ram[offset]; }
void shared_ram_w(offs_t offset, u8 data) { m_shared_ram[offset] = data; }

void tx_videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
void tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask = ~0);
TILE_GET_INFO_MEMBER(get_text_tile_info);

void sound_reset_w(u8 data);
tilemap_t *m_tx_tilemap = nullptr; /* Tilemap for extra-text-layer */
required_shared_ptr<u16> m_tx_videoram;
optional_shared_ptr<u16> m_tx_lineselect; // originals only
optional_shared_ptr<u16> m_tx_linescroll; // originals only
optional_shared_ptr<u16> m_tx_gfxram; // originals only
void reset_audiocpu(int state);

optional_shared_ptr<u16> m_tx_gfxram; // originals only
optional_shared_ptr<u8> m_shared_ram; // originals only - 8 bit RAM shared between 68K and sound CPU

required_device<m68000_base_device> m_maincpu;
optional_device<cpu_device> m_audiocpu; // originals only
required_device<gp9001vdp_device> m_vdp;
required_device<okim6295_device> m_oki;
optional_device<eeprom_serial_93cxx_device> m_eeprom; // originals only
required_device<gfxdecode_device> m_gfxdecode;
required_device<toaplan_txtilemap_device> m_tx_tilemap;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
bitmap_ind8 m_custom_priority_bitmap;
Expand Down Expand Up @@ -164,32 +151,6 @@ void fixeight_state::reset_audiocpu(int state)
}


TILE_GET_INFO_MEMBER(fixeight_state::get_text_tile_info)
{
const u16 attrib = m_tx_videoram[tile_index];
const u32 tile_number = attrib & 0x3ff;
const u32 color = attrib >> 10;
tileinfo.set(0,
tile_number,
color,
0);
}

void fixeight_state::tx_videoram_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_tx_videoram[offset]);
if (offset < 64*32)
m_tx_tilemap->mark_tile_dirty(offset);
}

void fixeight_state::tx_linescroll_w(offs_t offset, u16 data, u16 mem_mask)
{
/*** Line-Scroll RAM for Text Layer ***/
COMBINE_DATA(&m_tx_linescroll[offset]);

m_tx_tilemap->set_scrollx(offset, m_tx_linescroll[offset]);
}

void fixeight_state::screen_vblank(int state)
{
// rising edge
Expand All @@ -200,22 +161,12 @@ void fixeight_state::screen_vblank(int state)
}


void fixeight_state::create_tx_tilemap(int dx, int dx_flipped)
{
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(fixeight_state::get_text_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32);

m_tx_tilemap->set_scroll_rows(8*32); /* line scrolling */
m_tx_tilemap->set_scroll_cols(1);
m_tx_tilemap->set_scrolldx(dx, dx_flipped);
m_tx_tilemap->set_transparent_pen(0);
}

u32 fixeight_bootleg_state::screen_update_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(0, cliprect);
m_custom_priority_bitmap.fill(0, cliprect);
m_vdp->render_vdp(bitmap, cliprect);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0);
m_tx_tilemap->draw_tilemap_bootleg(screen, bitmap, cliprect);
return 0;
}

Expand All @@ -224,8 +175,6 @@ void fixeight_bootleg_state::video_start()
m_screen->register_screen_bitmap(m_custom_priority_bitmap);
m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap;

create_tx_tilemap();

/* This bootleg has additional layer offsets on the VDP */
m_vdp->set_tm_extra_offsets(0, -0x1d6 - 26, -0x1ef - 15, 0, 0);
m_vdp->set_tm_extra_offsets(1, -0x1d8 - 22, -0x1ef - 15, 0, 0);
Expand All @@ -241,8 +190,7 @@ void fixeight_state::video_start()
m_screen->register_screen_bitmap(m_custom_priority_bitmap);
m_vdp->custom_priority_bitmap = &m_custom_priority_bitmap;

m_gfxdecode->gfx(0)->set_source(reinterpret_cast<u8 *>(m_tx_gfxram.target()));
create_tx_tilemap(0x1d5, 0x16a);
m_tx_tilemap->gfx(0)->set_source(reinterpret_cast<u8 *>(m_tx_gfxram.target()));
}


Expand All @@ -251,21 +199,7 @@ u32 fixeight_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
bitmap.fill(0, cliprect);
m_custom_priority_bitmap.fill(0, cliprect);
m_vdp->render_vdp(bitmap, cliprect);

rectangle clip = cliprect;

/* it seems likely that flipx can be set per line! */
/* however, none of the games does it, and emulating it in the */
/* MAME tilemap system without being ultra slow would be tricky */
m_tx_tilemap->set_flip(m_tx_lineselect[0] & 0x8000 ? 0 : TILEMAP_FLIPX);

/* line select is used for 'for use in' and '8ing' screen on bbakraid, 'Raizing' logo on batrider */
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
clip.min_y = clip.max_y = y;
m_tx_tilemap->set_scrolly(0, m_tx_lineselect[y] - y);
m_tx_tilemap->draw(screen, bitmap, clip, 0);
}
m_tx_tilemap->draw_tilemap(screen, bitmap, cliprect);
return 0;
}

Expand All @@ -278,7 +212,7 @@ void fixeight_state::tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask)
if (oldword != data)
{
COMBINE_DATA(&m_tx_gfxram[offset]);
m_gfxdecode->gfx(0)->mark_dirty(offset/32);
m_tx_tilemap->gfx(0)->mark_dirty(offset/32);
}
}

Expand Down Expand Up @@ -434,9 +368,9 @@ void fixeight_state::fixeight_68k_mem(address_map &map)
map(0x280000, 0x28ffff).rw(FUNC(fixeight_state::shared_ram_r), FUNC(fixeight_state::shared_ram_w)).umask16(0x00ff);
map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write));
map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x500000, 0x501fff).ram().w(FUNC(fixeight_state::tx_videoram_w)).share(m_tx_videoram);
map(0x502000, 0x5021ff).ram().share(m_tx_lineselect);
map(0x503000, 0x5031ff).ram().w(FUNC(fixeight_state::tx_linescroll_w)).share(m_tx_linescroll);
map(0x500000, 0x501fff).rw(m_tx_tilemap, FUNC(toaplan_txtilemap_device::videoram_r), FUNC(toaplan_txtilemap_device::videoram_w));
map(0x502000, 0x5021ff).rw(m_tx_tilemap, FUNC(toaplan_txtilemap_device::lineselect_r), FUNC(toaplan_txtilemap_device::lineselect_w));
map(0x503000, 0x5031ff).rw(m_tx_tilemap, FUNC(toaplan_txtilemap_device::linescroll_r), FUNC(toaplan_txtilemap_device::linescroll_w));
map(0x600000, 0x60ffff).ram().w(FUNC(fixeight_state::tx_gfxram_w)).share(m_tx_gfxram);
map(0x700000, 0x700001).w(FUNC(fixeight_state::sound_reset_w)).umask16(0x00ff).cswidth(16);
map(0x800000, 0x800001).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r));
Expand Down Expand Up @@ -464,7 +398,7 @@ void fixeight_bootleg_state::fixeightbl_68k_mem(address_map &map)
map(0x20001c, 0x20001d).portr("DSWA");
map(0x300000, 0x30000d).rw(m_vdp, FUNC(gp9001vdp_device::read), FUNC(gp9001vdp_device::write));
map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
map(0x500000, 0x501fff).ram().w(FUNC(fixeight_bootleg_state::tx_videoram_w)).share(m_tx_videoram);
map(0x500000, 0x501fff).rw(m_tx_tilemap, FUNC(toaplan_txtilemap_device::videoram_r), FUNC(toaplan_txtilemap_device::videoram_w));
map(0x700000, 0x700001).r(m_vdp, FUNC(gp9001vdp_device::vdpcount_r));
map(0x800000, 0x87ffff).rom().region("maincpu", 0x80000);
}
Expand Down Expand Up @@ -536,13 +470,15 @@ void fixeight_state::fixeight(machine_config &config)
m_screen->screen_vblank().set(FUNC(fixeight_state::screen_vblank));
m_screen->set_palette(m_palette);

GFXDECODE(config, m_gfxdecode, m_palette, gfx);
PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH);

GP9001_VDP(config, m_vdp, 27_MHz_XTAL);
m_vdp->set_palette(m_palette);
m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_4);

TOAPLAN_TXTILEMAP(config, m_tx_tilemap, 27_MHz_XTAL, m_palette, gfx);
m_tx_tilemap->set_offset(0x1d5, 0, 0x16a, 0);

/* sound hardware */
SPEAKER(config, "mono").front_center();

Expand Down Expand Up @@ -578,13 +514,14 @@ void fixeight_bootleg_state::fixeightbl(machine_config &config)
m_screen->screen_vblank().set(FUNC(fixeight_bootleg_state::screen_vblank));
m_screen->set_palette(m_palette);

GFXDECODE(config, m_gfxdecode, m_palette, gfx_textrom);
PALETTE(config, m_palette).set_format(palette_device::xBGR_555, gp9001vdp_device::VDP_PALETTE_LENGTH);

GP9001_VDP(config, m_vdp, 27_MHz_XTAL);
m_vdp->set_palette(m_palette);
m_vdp->vint_out_cb().set_inputline(m_maincpu, M68K_IRQ_2, ASSERT_LINE);

TOAPLAN_TXTILEMAP(config, m_tx_tilemap, 27_MHz_XTAL, m_palette, gfx_textrom);

/* sound hardware */
SPEAKER(config, "mono").front_center();

Expand Down
1 change: 0 additions & 1 deletion src/mame/toaplan/ghox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"

/*
Name Board No Maker Game name
Expand Down
1 change: 0 additions & 1 deletion src/mame/toaplan/kbash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"

/*
Name Board No Maker Game name
Expand Down
13 changes: 6 additions & 7 deletions src/mame/toaplan/pipibibi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "tilemap.h"

/*
* Name Board No Maker Game name
Expand Down Expand Up @@ -477,10 +476,10 @@ ROM_END

} // anonymous namespace

GAME( 1991, pipibibs, 0, pipibibs, pipibibs, pipibibi_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pipibibsa, pipibibs, pipibibs, pipibibs, pipibibi_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pipibibsp, pipibibs, pipibibs, pipibibsp, pipibibi_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (prototype)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pipibibs, 0, pipibibs, pipibibs, pipibibi_state , empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pipibibsa, pipibibs, pipibibs, pipibibs, pipibibi_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pipibibsp, pipibibs, pipibibs, pipibibsp, pipibibi_state, empty_init, ROT0, "Toaplan", "Pipi & Bibis / Whoopee!! (prototype)", MACHINE_SUPPORTS_SAVE )

GAME( 1991, pipibibsbl, pipibibs, pipibibsbl, pipibibsbl, pipibibi_bootleg_state, init_pipibibsbl, ROT0, "bootleg (Ryouta Kikaku)", "Pipi & Bibis / Whoopee!! (Ryouta Kikaku bootleg, encrypted)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pipibibsbl2, pipibibs, pipibibsbl, pipibibsbl, pipibibi_bootleg_state, empty_init, ROT0, "bootleg", "Pipi & Bibis / Whoopee!! (bootleg, decrypted)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // different memory map, not scrambled
GAME( 1991, pipibibsbl3, pipibibs, pipibibsbl, pipibibsbl, pipibibi_bootleg_state, empty_init, ROT0, "bootleg (Ryouta Kikaku)", "Pipi & Bibis / Whoopee!! (Ryouta Kikaku bootleg, decrypted)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pipibibsbl, pipibibs, pipibibsbl, pipibibsbl, pipibibi_bootleg_state, init_pipibibsbl, ROT0, "bootleg", "Pipi & Bibis / Whoopee!! (bootleg, encrypted)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, pipibibsbl2, pipibibs, pipibibsbl, pipibibsbl, pipibibi_bootleg_state, empty_init, ROT0, "bootleg", "Pipi & Bibis / Whoopee!! (bootleg, decrypted set 1)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // different memory map, not scrambled
GAME( 1991, pipibibsbl3, pipibibs, pipibibsbl, pipibibsbl, pipibibi_bootleg_state, empty_init, ROT0, "bootleg", "Pipi & Bibis / Whoopee!! (bootleg, decrypted set 2)", MACHINE_SUPPORTS_SAVE )
Loading
Loading