mirror of
https://github.com/holub/mame
synced 2025-04-27 02:33:13 +03:00
Merge pull request #5134 from cam900/exedexes_args
exedexes.cpp : Updates
This commit is contained in:
commit
aabfa56b66
@ -22,14 +22,14 @@
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(exedexes_state::exedexes_scanline)
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(exedexes_state::scanline)
|
||||
{
|
||||
int scanline = param;
|
||||
|
||||
if(scanline == 240) // vblank-out irq
|
||||
if (scanline == 240) // vblank-out irq
|
||||
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* Z80 - RST 10h - vblank */
|
||||
|
||||
if(scanline == 0) // unknown irq event
|
||||
if (scanline == 0) // unknown irq event
|
||||
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* Z80 - RST 08h */
|
||||
}
|
||||
|
||||
@ -43,20 +43,19 @@ void exedexes_state::exedexes_map(address_map &map)
|
||||
map(0xc003, 0xc003).portr("DSW0");
|
||||
map(0xc004, 0xc004).portr("DSW1");
|
||||
map(0xc800, 0xc800).w("soundlatch", FUNC(generic_latch_8_device::write));
|
||||
map(0xc804, 0xc804).w(FUNC(exedexes_state::exedexes_c804_w)); /* coin counters + text layer enable */
|
||||
map(0xc804, 0xc804).w(FUNC(exedexes_state::c804_w)); /* coin counters + text layer enable */
|
||||
map(0xc806, 0xc806).nopw(); /* Watchdog ?? */
|
||||
map(0xd000, 0xd3ff).ram().w(FUNC(exedexes_state::exedexes_videoram_w)).share("videoram"); /* Video RAM */
|
||||
map(0xd400, 0xd7ff).ram().w(FUNC(exedexes_state::exedexes_colorram_w)).share("colorram"); /* Color RAM */
|
||||
map(0xd000, 0xd3ff).ram().w(FUNC(exedexes_state::videoram_w)).share("videoram"); /* Video RAM */
|
||||
map(0xd400, 0xd7ff).ram().w(FUNC(exedexes_state::colorram_w)).share("colorram"); /* Color RAM */
|
||||
map(0xd800, 0xd801).writeonly().share("nbg_yscroll");
|
||||
map(0xd802, 0xd803).writeonly().share("nbg_xscroll");
|
||||
map(0xd804, 0xd805).writeonly().share("bg_scroll");
|
||||
map(0xd807, 0xd807).w(FUNC(exedexes_state::exedexes_gfxctrl_w)); /* layer enables */
|
||||
map(0xd807, 0xd807).w(FUNC(exedexes_state::gfxctrl_w)); /* layer enables */
|
||||
map(0xe000, 0xefff).ram(); /* Work RAM */
|
||||
map(0xf000, 0xffff).ram().share("spriteram"); /* Sprite RAM */
|
||||
}
|
||||
|
||||
|
||||
|
||||
void exedexes_state::sound_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x3fff).rom();
|
||||
@ -68,7 +67,6 @@ void exedexes_state::sound_map(address_map &map)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static INPUT_PORTS_START( exedexes )
|
||||
PORT_START("SYSTEM")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
|
||||
@ -150,51 +148,41 @@ static INPUT_PORTS_START( exedexes )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
|
||||
static const gfx_layout charlayout =
|
||||
{
|
||||
8,8, /* 8*8 characters */
|
||||
512, /* 512 characters */
|
||||
RGN_FRAC(1,1), /* 512 characters */
|
||||
2, /* 2 bits per pixel */
|
||||
{ 4, 0 },
|
||||
{ 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3 },
|
||||
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
|
||||
{ STEP4(0,1), STEP4(4*2,1) },
|
||||
{ STEP8(0,4*2*2) },
|
||||
16*8 /* every char takes 16 consecutive bytes */
|
||||
};
|
||||
|
||||
static const gfx_layout spritelayout =
|
||||
{
|
||||
16,16, /* 16*16 sprites */
|
||||
256, /* 256 sprites */
|
||||
4, /* 4 bits per pixel */
|
||||
{ 0x4000*8+4, 0x4000*8+0, 4, 0 },
|
||||
{ 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
|
||||
32*8+0, 32*8+1, 32*8+2, 32*8+3, 33*8+0, 33*8+1, 33*8+2, 33*8+3 },
|
||||
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
|
||||
8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
|
||||
RGN_FRAC(1,2), /* 256 sprites */
|
||||
4, /* 4 bits per pixel */
|
||||
{ RGN_FRAC(1,2)+4, RGN_FRAC(1,2)+0, 4, 0 },
|
||||
{ STEP4(0,1), STEP4(4*2,1), STEP4(4*2*2*16,1), STEP4(4*2*2*16+4*2,1) },
|
||||
{ STEP16(0,4*2*2) },
|
||||
64*8 /* every sprite takes 64 consecutive bytes */
|
||||
};
|
||||
|
||||
static const gfx_layout tilelayout =
|
||||
{
|
||||
32,32, /* 32*32 tiles */
|
||||
64, /* 64 tiles */
|
||||
RGN_FRAC(1,1), /* 64 tiles */
|
||||
2, /* 2 bits per pixel */
|
||||
{ 4, 0 },
|
||||
{ 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
|
||||
64*8+0, 64*8+1, 64*8+2, 64*8+3, 65*8+0, 65*8+1, 65*8+2, 65*8+3,
|
||||
128*8+0, 128*8+1, 128*8+2, 128*8+3, 129*8+0, 129*8+1, 129*8+2, 129*8+3,
|
||||
192*8+0, 192*8+1, 192*8+2, 192*8+3, 193*8+0, 193*8+1, 193*8+2, 193*8+3 },
|
||||
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
|
||||
8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16,
|
||||
16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16,
|
||||
24*16, 25*16, 26*16, 27*16, 28*16, 29*16, 30*16, 31*16 },
|
||||
{ STEP4(0,1), STEP4(4*2,1), STEP4(4*2*2*32,1), STEP4(4*2*2*32+4*2,1),
|
||||
STEP4(4*2*2*64,1), STEP4(4*2*2*64+4*2,1), STEP4(4*2*2*96,1), STEP4(4*2*2*96+4*2,1) },
|
||||
{ STEP32(0,4*2*2) },
|
||||
256*8 /* every tile takes 256 consecutive bytes */
|
||||
};
|
||||
|
||||
|
||||
|
||||
static GFXDECODE_START( gfx_exedexes )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 64 )
|
||||
GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 64*4, 64 ) /* 32x32 Tiles */
|
||||
@ -224,13 +212,12 @@ void exedexes_state::exedexes(machine_config &config)
|
||||
/* basic machine hardware */
|
||||
Z80(config, m_maincpu, 4000000); /* 4 MHz (?) */
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &exedexes_state::exedexes_map);
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(exedexes_state::exedexes_scanline), "screen", 0, 1);
|
||||
TIMER(config, "scantimer").configure_scanline(FUNC(exedexes_state::scanline), "screen", 0, 1);
|
||||
|
||||
z80_device &audiocpu(Z80(config, "audiocpu", 3000000)); /* 3 MHz ??? */
|
||||
audiocpu.set_addrmap(AS_PROGRAM, &exedexes_state::sound_map);
|
||||
audiocpu.set_periodic_int(FUNC(exedexes_state::irq0_line_hold), attotime::from_hz(4*60));
|
||||
|
||||
|
||||
/* video hardware */
|
||||
BUFFERED_SPRITERAM8(config, m_spriteram);
|
||||
|
||||
@ -239,7 +226,7 @@ void exedexes_state::exedexes(machine_config &config)
|
||||
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(exedexes_state::screen_update_exedexes));
|
||||
screen.set_screen_update(FUNC(exedexes_state::screen_update));
|
||||
screen.screen_vblank().set(m_spriteram, FUNC(buffered_spriteram8_device::vblank_copy_rising));
|
||||
screen.set_palette(m_palette);
|
||||
|
||||
@ -260,7 +247,6 @@ void exedexes_state::exedexes(machine_config &config)
|
||||
}
|
||||
|
||||
|
||||
|
||||
ROM_START( exedexes )
|
||||
ROM_REGION( 0x10000, "maincpu", 0 )
|
||||
ROM_LOAD( "11m_ee04.bin", 0x0000, 0x4000, CRC(44140dbd) SHA1(7b56f614f7cd7655ffa3e1f4adba5a20fa25822d) )
|
||||
@ -284,7 +270,7 @@ ROM_START( exedexes )
|
||||
ROM_LOAD( "j11_ee10.bin", 0x00000, 0x4000, CRC(bc83e265) SHA1(ac9b4cce9e539c560414abf2fc239910f2bfbb2d) ) /* Sprites planes 0-1 */
|
||||
ROM_LOAD( "j12_ee11.bin", 0x04000, 0x4000, CRC(0e0f300d) SHA1(2f973748e459b16673115abf7de8615219e39fa4) ) /* Sprites planes 2-3 */
|
||||
|
||||
ROM_REGION( 0x6000, "gfx5", 0 ) /* background tilemaps */
|
||||
ROM_REGION( 0x6000, "tilerom", 0 ) /* background tilemaps */
|
||||
ROM_LOAD( "c01_ee07.bin", 0x0000, 0x4000, CRC(3625a68d) SHA1(83010ca356385b713bafe03a502c566f6a9a8365) ) /* Front Tile Map */
|
||||
ROM_LOAD( "h04_ee09.bin", 0x4000, 0x2000, CRC(6057c907) SHA1(886790641b84b8cd659d2eb5fd1adbabdd7dad3d) ) /* Back Tile map */
|
||||
|
||||
@ -326,7 +312,7 @@ ROM_START( savgbees )
|
||||
ROM_LOAD( "j11_ee10.bin", 0x00000, 0x4000, CRC(bc83e265) SHA1(ac9b4cce9e539c560414abf2fc239910f2bfbb2d) ) /* Sprites planes 0-1 */
|
||||
ROM_LOAD( "j12_ee11.bin", 0x04000, 0x4000, CRC(0e0f300d) SHA1(2f973748e459b16673115abf7de8615219e39fa4) ) /* Sprites planes 2-3 */
|
||||
|
||||
ROM_REGION( 0x6000, "gfx5", 0 ) /* background tilemaps */
|
||||
ROM_REGION( 0x6000, "tilerom", 0 ) /* background tilemaps */
|
||||
ROM_LOAD( "c01_ee07.bin", 0x0000, 0x4000, CRC(3625a68d) SHA1(83010ca356385b713bafe03a502c566f6a9a8365) ) /* Front Tile Map */
|
||||
ROM_LOAD( "h04_ee09.bin", 0x4000, 0x2000, CRC(6057c907) SHA1(886790641b84b8cd659d2eb5fd1adbabdd7dad3d) ) /* Back Tile map */
|
||||
|
||||
@ -346,6 +332,5 @@ ROM_START( savgbees )
|
||||
ROM_END
|
||||
|
||||
|
||||
|
||||
GAME( 1985, exedexes, 0, exedexes, exedexes, exedexes_state, empty_init, ROT270, "Capcom", "Exed Exes", MACHINE_SUPPORTS_SAVE )
|
||||
GAME( 1985, savgbees, exedexes, exedexes, exedexes, exedexes_state, empty_init, ROT270, "Capcom (Memetron license)", "Savage Bees", MACHINE_SUPPORTS_SAVE )
|
||||
|
@ -25,6 +25,7 @@ public:
|
||||
m_nbg_yscroll(*this, "nbg_yscroll"),
|
||||
m_nbg_xscroll(*this, "nbg_xscroll"),
|
||||
m_bg_scroll(*this, "bg_scroll"),
|
||||
m_tilerom(*this, "tilerom"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette")
|
||||
@ -35,37 +36,38 @@ public:
|
||||
private:
|
||||
/* memory pointers */
|
||||
required_device<buffered_spriteram8_device> m_spriteram;
|
||||
required_shared_ptr<uint8_t> m_videoram;
|
||||
required_shared_ptr<uint8_t> m_colorram;
|
||||
required_shared_ptr<uint8_t> m_nbg_yscroll;
|
||||
required_shared_ptr<uint8_t> m_nbg_xscroll;
|
||||
required_shared_ptr<uint8_t> m_bg_scroll;
|
||||
required_shared_ptr<u8> m_videoram;
|
||||
required_shared_ptr<u8> m_colorram;
|
||||
required_shared_ptr<u8> m_nbg_yscroll;
|
||||
required_shared_ptr<u8> m_nbg_xscroll;
|
||||
required_shared_ptr<u8> m_bg_scroll;
|
||||
required_region_ptr<u8> m_tilerom;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_bg_tilemap;
|
||||
tilemap_t *m_fg_tilemap;
|
||||
tilemap_t *m_tx_tilemap;
|
||||
tilemap_t *m_bg_tilemap;
|
||||
tilemap_t *m_fg_tilemap;
|
||||
tilemap_t *m_tx_tilemap;
|
||||
int m_chon;
|
||||
int m_objon;
|
||||
int m_sc1on;
|
||||
int m_sc2on;
|
||||
|
||||
DECLARE_WRITE8_MEMBER(exedexes_videoram_w);
|
||||
DECLARE_WRITE8_MEMBER(exedexes_colorram_w);
|
||||
DECLARE_WRITE8_MEMBER(exedexes_c804_w);
|
||||
DECLARE_WRITE8_MEMBER(exedexes_gfxctrl_w);
|
||||
void videoram_w(offs_t offset, u8 data);
|
||||
void colorram_w(offs_t offset, u8 data);
|
||||
void c804_w(u8 data);
|
||||
void gfxctrl_w(u8 data);
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_fg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_tx_tile_info);
|
||||
TILEMAP_MAPPER_MEMBER(exedexes_bg_tilemap_scan);
|
||||
TILEMAP_MAPPER_MEMBER(exedexes_fg_tilemap_scan);
|
||||
TILEMAP_MAPPER_MEMBER(bg_tilemap_scan);
|
||||
TILEMAP_MAPPER_MEMBER(fg_tilemap_scan);
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
void exedexes_palette(palette_device &palette) const;
|
||||
uint32_t screen_update_exedexes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(exedexes_scanline);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority );
|
||||
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
|
||||
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
@ -10,11 +10,7 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/exedexes.h"
|
||||
|
||||
|
||||
#define TileMap(offs) (machine.root_device().memregion("gfx5")->base()[offs])
|
||||
#define BackTileMap(offs) (machine.root_device().memregion("gfx5")->base()[offs+0x4000])
|
||||
|
||||
#include "screen.h"
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
@ -35,14 +31,14 @@
|
||||
|
||||
void exedexes_state::exedexes_palette(palette_device &palette) const
|
||||
{
|
||||
const uint8_t *color_prom = memregion("proms")->base();
|
||||
const u8 *color_prom = memregion("proms")->base();
|
||||
|
||||
// create a lookup table for the palette
|
||||
for (int i = 0; i < 0x100; i++)
|
||||
{
|
||||
int const r = pal4bit(color_prom[i + 0x000]);
|
||||
int const g = pal4bit(color_prom[i + 0x100]);
|
||||
int const b = pal4bit(color_prom[i + 0x200]);
|
||||
const int r = pal4bit(color_prom[i + 0x000]);
|
||||
const int g = pal4bit(color_prom[i + 0x100]);
|
||||
const int b = pal4bit(color_prom[i + 0x200]);
|
||||
|
||||
palette.set_indirect_color(i, rgb_t(r, g, b));
|
||||
}
|
||||
@ -53,45 +49,45 @@ void exedexes_state::exedexes_palette(palette_device &palette) const
|
||||
// characters use colors 0xc0-0xcf
|
||||
for (int i = 0; i < 0x100; i++)
|
||||
{
|
||||
uint8_t const ctabentry = color_prom[i] | 0xc0;
|
||||
const u8 ctabentry = color_prom[i] | 0xc0;
|
||||
palette.set_pen_indirect(i, ctabentry);
|
||||
}
|
||||
|
||||
// 32x32 tiles use colors 0-0x0f
|
||||
for (int i = 0x100; i < 0x200; i++)
|
||||
{
|
||||
uint8_t const ctabentry = color_prom[i];
|
||||
const u8 ctabentry = color_prom[i];
|
||||
palette.set_pen_indirect(i, ctabentry);
|
||||
}
|
||||
|
||||
// 16x16 tiles use colors 0x40-0x4f
|
||||
for (int i = 0x200; i < 0x300; i++)
|
||||
{
|
||||
uint8_t const ctabentry = color_prom[i] | 0x40;
|
||||
const u8 ctabentry = color_prom[i] | 0x40;
|
||||
palette.set_pen_indirect(i, ctabentry);
|
||||
}
|
||||
|
||||
// sprites use colors 0x80-0xbf in four banks
|
||||
for (int i = 0x300; i < 0x400; i++)
|
||||
{
|
||||
uint8_t const ctabentry = color_prom[i] | (color_prom[i + 0x100] << 4) | 0x80;
|
||||
const u8 ctabentry = color_prom[i] | (color_prom[i + 0x100] << 4) | 0x80;
|
||||
palette.set_pen_indirect(i, ctabentry);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(exedexes_state::exedexes_videoram_w)
|
||||
void exedexes_state::videoram_w(offs_t offset, u8 data)
|
||||
{
|
||||
m_videoram[offset] = data;
|
||||
m_tx_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(exedexes_state::exedexes_colorram_w)
|
||||
void exedexes_state::colorram_w(offs_t offset, u8 data)
|
||||
{
|
||||
m_colorram[offset] = data;
|
||||
m_tx_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(exedexes_state::exedexes_c804_w)
|
||||
void exedexes_state::c804_w(u8 data)
|
||||
{
|
||||
/* bits 0 and 1 are coin counters */
|
||||
machine().bookkeeping().coin_counter_w(0, data & 0x01);
|
||||
@ -106,7 +102,7 @@ WRITE8_MEMBER(exedexes_state::exedexes_c804_w)
|
||||
/* other bits seem to be unused */
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(exedexes_state::exedexes_gfxctrl_w)
|
||||
void exedexes_state::gfxctrl_w(u8 data)
|
||||
{
|
||||
/* bit 4 is bg enable */
|
||||
m_sc2on = data & 0x10;
|
||||
@ -123,40 +119,38 @@ WRITE8_MEMBER(exedexes_state::exedexes_gfxctrl_w)
|
||||
|
||||
TILE_GET_INFO_MEMBER(exedexes_state::get_bg_tile_info)
|
||||
{
|
||||
uint8_t *tilerom = memregion("gfx5")->base();
|
||||
|
||||
int attr = tilerom[tile_index];
|
||||
int code = attr & 0x3f;
|
||||
int color = tilerom[tile_index + (8 * 8)];
|
||||
int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
|
||||
const u8 attr = m_tilerom[tile_index];
|
||||
const u8 code = attr & 0x3f;
|
||||
const u8 color = m_tilerom[tile_index + (8 * 8)];
|
||||
const int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
|
||||
|
||||
SET_TILE_INFO_MEMBER(1, code, color, flags);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(exedexes_state::get_fg_tile_info)
|
||||
{
|
||||
int code = memregion("gfx5")->base()[tile_index];
|
||||
const u8 code = m_tilerom[tile_index];
|
||||
|
||||
SET_TILE_INFO_MEMBER(2, code, 0, 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(exedexes_state::get_tx_tile_info)
|
||||
{
|
||||
int code = m_videoram[tile_index] + 2 * (m_colorram[tile_index] & 0x80);
|
||||
int color = m_colorram[tile_index] & 0x3f;
|
||||
const u32 code = m_videoram[tile_index] + 2 * (m_colorram[tile_index] & 0x80);
|
||||
const u8 color = m_colorram[tile_index] & 0x3f;
|
||||
|
||||
tileinfo.group = color;
|
||||
|
||||
SET_TILE_INFO_MEMBER(0, code, color, 0);
|
||||
}
|
||||
|
||||
TILEMAP_MAPPER_MEMBER(exedexes_state::exedexes_bg_tilemap_scan)
|
||||
TILEMAP_MAPPER_MEMBER(exedexes_state::bg_tilemap_scan)
|
||||
{
|
||||
/* logical (col,row) -> memory offset */
|
||||
return ((col * 32 & 0xe0) >> 5) + ((row * 32 & 0xe0) >> 2) + ((col * 32 & 0x3f00) >> 1) + 0x4000;
|
||||
}
|
||||
|
||||
TILEMAP_MAPPER_MEMBER(exedexes_state::exedexes_fg_tilemap_scan)
|
||||
TILEMAP_MAPPER_MEMBER(exedexes_state::fg_tilemap_scan)
|
||||
{
|
||||
/* logical (col,row) -> memory offset */
|
||||
return ((col * 16 & 0xf0) >> 4) + (row * 16 & 0xf0) + (col * 16 & 0x700) + ((row * 16 & 0x700) << 3);
|
||||
@ -164,66 +158,61 @@ TILEMAP_MAPPER_MEMBER(exedexes_state::exedexes_fg_tilemap_scan)
|
||||
|
||||
void exedexes_state::video_start()
|
||||
{
|
||||
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(exedexes_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(exedexes_state::exedexes_bg_tilemap_scan),this), 32, 32, 64, 64);
|
||||
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(exedexes_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(exedexes_state::exedexes_fg_tilemap_scan),this), 16, 16, 128, 128);
|
||||
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(exedexes_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(exedexes_state::bg_tilemap_scan),this), 32, 32, 64, 64);
|
||||
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(exedexes_state::get_fg_tile_info),this), tilemap_mapper_delegate(FUNC(exedexes_state::fg_tilemap_scan),this), 16, 16, 128, 128);
|
||||
m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(exedexes_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
|
||||
|
||||
m_fg_tilemap->set_transparent_pen(0);
|
||||
m_tx_tilemap->configure_groups(*m_gfxdecode->gfx(0), 0xcf);
|
||||
}
|
||||
|
||||
void exedexes_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority )
|
||||
void exedexes_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
uint8_t *buffered_spriteram = m_spriteram->buffer();
|
||||
int offs;
|
||||
const u8 *buffered_spriteram = m_spriteram->buffer();
|
||||
|
||||
if (!m_objon)
|
||||
return;
|
||||
|
||||
priority = priority ? 0x40 : 0x00;
|
||||
|
||||
for (offs = m_spriteram->bytes() - 32;offs >= 0;offs -= 32)
|
||||
for (int offs = 0; offs < m_spriteram->bytes(); offs += 32)
|
||||
{
|
||||
if ((buffered_spriteram[offs + 1] & 0x40) == priority)
|
||||
{
|
||||
int code, color, flipx, flipy, sx, sy;
|
||||
u32 primask = 0;
|
||||
if (buffered_spriteram[offs + 1] & 0x40)
|
||||
primask |= GFX_PMASK_2;
|
||||
|
||||
code = buffered_spriteram[offs];
|
||||
color = buffered_spriteram[offs + 1] & 0x0f;
|
||||
flipx = buffered_spriteram[offs + 1] & 0x10;
|
||||
flipy = buffered_spriteram[offs + 1] & 0x20;
|
||||
sx = buffered_spriteram[offs + 3] - ((buffered_spriteram[offs + 1] & 0x80) << 1);
|
||||
sy = buffered_spriteram[offs + 2];
|
||||
const u32 code = buffered_spriteram[offs];
|
||||
const u32 color = buffered_spriteram[offs + 1] & 0x0f;
|
||||
const bool flipx = buffered_spriteram[offs + 1] & 0x10;
|
||||
const bool flipy = buffered_spriteram[offs + 1] & 0x20;
|
||||
const int sx = buffered_spriteram[offs + 3] - ((buffered_spriteram[offs + 1] & 0x80) << 1);
|
||||
const int sy = buffered_spriteram[offs + 2];
|
||||
|
||||
m_gfxdecode->gfx(3)->transpen(bitmap,cliprect,
|
||||
code,
|
||||
color,
|
||||
flipx,flipy,
|
||||
sx,sy,0);
|
||||
}
|
||||
m_gfxdecode->gfx(3)->prio_transpen(bitmap,cliprect,
|
||||
code,
|
||||
color,
|
||||
flipx,flipy,
|
||||
sx,sy,screen.priority(),primask,0);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t exedexes_state::screen_update_exedexes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
u32 exedexes_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
screen.priority().fill(0, cliprect);
|
||||
if (m_sc2on)
|
||||
{
|
||||
m_bg_tilemap->set_scrollx(0, ((m_bg_scroll[1]) << 8) + m_bg_scroll[0]);
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
|
||||
}
|
||||
else
|
||||
bitmap.fill(0, cliprect);
|
||||
|
||||
draw_sprites(bitmap, cliprect, 1);
|
||||
|
||||
if (m_sc1on)
|
||||
{
|
||||
m_fg_tilemap->set_scrollx(0, ((m_nbg_yscroll[1]) << 8) + m_nbg_yscroll[0]);
|
||||
m_fg_tilemap->set_scrolly(0, ((m_nbg_xscroll[1]) << 8) + m_nbg_xscroll[0]);
|
||||
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
|
||||
}
|
||||
|
||||
draw_sprites(bitmap, cliprect, 0);
|
||||
draw_sprites(screen, bitmap, cliprect);
|
||||
|
||||
if (m_chon)
|
||||
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user