mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
realbrk.cpp : Fix sprite priority, Add notes, Reduce runtime tag lookups (#3748)
* realbrk.cpp : Fix sprite priority, Add notes, Reduce runtime tag lookups * realbrk.cpp : Fix rotation bits, Add notes
This commit is contained in:
parent
73d05332ab
commit
2ee7a8991d
@ -56,15 +56,15 @@ To Do:
|
||||
READ16_MEMBER(realbrk_state::realbrk_dsw_r)
|
||||
{
|
||||
uint16_t sel = ~m_dsw_select[0];
|
||||
if (sel & 0x01) return (ioport("SW1")->read() & 0x00ff) << 8; // DSW1 low bits
|
||||
if (sel & 0x02) return (ioport("SW2")->read() & 0x00ff) << 8; // DSW2 low bits
|
||||
if (sel & 0x04) return (ioport("SW3")->read() & 0x00ff) << 8; // DSW3 low bits
|
||||
if (sel & 0x08) return (ioport("SW4")->read() & 0x00ff) << 8; // DSW4 low bits
|
||||
if (sel & 0x01) return (m_dsw_io[0]->read() & 0x00ff) << 8; // DSW1 low bits
|
||||
if (sel & 0x02) return (m_dsw_io[1]->read() & 0x00ff) << 8; // DSW2 low bits
|
||||
if (sel & 0x04) return (m_dsw_io[2]->read() & 0x00ff) << 8; // DSW3 low bits
|
||||
if (sel & 0x08) return (m_dsw_io[3]->read() & 0x00ff) << 8; // DSW4 low bits
|
||||
|
||||
if (sel & 0x10) return ((ioport("SW1")->read() & 0x0300) << 0) | // DSWs high 2 bits
|
||||
((ioport("SW2")->read() & 0x0300) << 2) |
|
||||
((ioport("SW3")->read() & 0x0300) << 4) |
|
||||
((ioport("SW4")->read() & 0x0300) << 6) ;
|
||||
if (sel & 0x10) return ((m_dsw_io[0]->read() & 0x0300) << 0) | // DSWs high 2 bits
|
||||
((m_dsw_io[1]->read() & 0x0300) << 2) |
|
||||
((m_dsw_io[2]->read() & 0x0300) << 4) |
|
||||
((m_dsw_io[3]->read() & 0x0300) << 6) ;
|
||||
|
||||
logerror("CPU #0 PC %06X: read with unknown dsw_select = %02x\n",m_maincpu->pc(),m_dsw_select[0]);
|
||||
return 0xffff;
|
||||
@ -76,14 +76,14 @@ READ16_MEMBER(realbrk_state::pkgnsh_input_r)
|
||||
{
|
||||
case 0x00/2: return 0xffff;
|
||||
case 0x02/2: return 0xffff;
|
||||
case 0x04/2: return ioport("IN0")->read(); /*Service buttons*/
|
||||
case 0x06/2: return ioport("SW1")->read(); /*DIP 2*/
|
||||
case 0x08/2: return ioport("SW2")->read(); /*DIP 1*/
|
||||
case 0x0a/2: return ioport("SW3")->read(); /*DIP 1+2 Hi-Bits*/
|
||||
case 0x0c/2: return ioport("PADDLE1")->read(); /*Handle 1p*/
|
||||
case 0x0e/2: return ioport("P1")->read(); /*Buttons 1p*/
|
||||
case 0x10/2: return ioport("PADDLE2")->read(); /*Handle 2p*/
|
||||
case 0x12/2: return ioport("P2")->read(); /*Buttons 2p*/
|
||||
case 0x04/2: return m_in_io[0]->read(); /*Service buttons*/
|
||||
case 0x06/2: return m_dsw_io[0]->read(); /*DIP 2*/
|
||||
case 0x08/2: return m_dsw_io[1]->read(); /*DIP 1*/
|
||||
case 0x0a/2: return m_dsw_io[2]->read(); /*DIP 1+2 Hi-Bits*/
|
||||
case 0x0c/2: return m_paddle_io[0]->read(); /*Handle 1p*/
|
||||
case 0x0e/2: return m_player_io[0]->read(); /*Buttons 1p*/
|
||||
case 0x10/2: return m_paddle_io[1]->read(); /*Handle 2p*/
|
||||
case 0x12/2: return m_player_io[1]->read(); /*Buttons 2p*/
|
||||
}
|
||||
return 0xffff;
|
||||
}
|
||||
@ -95,22 +95,22 @@ READ16_MEMBER(realbrk_state::pkgnshdx_input_r)
|
||||
switch(offset)
|
||||
{
|
||||
case 0x00/2: return 0xffff;
|
||||
case 0x02/2: return ioport("IN0")->read(); /*Service buttons*/
|
||||
case 0x02/2: return m_in_io[0]->read(); /*Service buttons*/
|
||||
/*DSW,same handling as realbrk*/
|
||||
case 0x04/2:
|
||||
if (sel & 0x01) return (ioport("SW1")->read() & 0x00ff) << 8; // DSW1 low bits
|
||||
if (sel & 0x02) return (ioport("SW2")->read() & 0x00ff) << 8; // DSW2 low bits
|
||||
if (sel & 0x04) return (ioport("SW3")->read() & 0x00ff) << 8; // DSW3 low bits
|
||||
if (sel & 0x08) return (ioport("SW4")->read() & 0x00ff) << 8; // DSW4 low bits
|
||||
if (sel & 0x01) return (m_dsw_io[0]->read() & 0x00ff) << 8; // DSW1 low bits
|
||||
if (sel & 0x02) return (m_dsw_io[1]->read() & 0x00ff) << 8; // DSW2 low bits
|
||||
if (sel & 0x04) return (m_dsw_io[2]->read() & 0x00ff) << 8; // DSW3 low bits
|
||||
if (sel & 0x08) return (m_dsw_io[3]->read() & 0x00ff) << 8; // DSW4 low bits
|
||||
|
||||
if (sel & 0x10) return ((ioport("SW1")->read() & 0x0300) << 0) | // DSWs high 2 bits
|
||||
((ioport("SW2")->read() & 0x0300) << 2) |
|
||||
((ioport("SW3")->read() & 0x0300) << 4) |
|
||||
((ioport("SW4")->read() & 0x0300) << 6) ;
|
||||
if (sel & 0x10) return ((m_dsw_io[0]->read() & 0x0300) << 0) | // DSWs high 2 bits
|
||||
((m_dsw_io[1]->read() & 0x0300) << 2) |
|
||||
((m_dsw_io[2]->read() & 0x0300) << 4) |
|
||||
((m_dsw_io[3]->read() & 0x0300) << 6) ;
|
||||
|
||||
return 0xffff;
|
||||
case 0x06/2: return ioport("P2")->read();/*Buttons+Handle 2p*/
|
||||
case 0x08/2: return ioport("P1")->read();/*Buttons+Handle 1p*/
|
||||
case 0x06/2: return m_player_io[1]->read();/*Buttons+Handle 2p*/
|
||||
case 0x08/2: return m_player_io[0]->read();/*Buttons+Handle 1p*/
|
||||
case 0x0a/2: return 0xffff;
|
||||
case 0x0c/2: return 0xffff;
|
||||
case 0x0e/2: return 0xffff;
|
||||
@ -148,6 +148,13 @@ WRITE16_MEMBER(realbrk_state::backup_ram_w)
|
||||
COMBINE_DATA(&m_backup_ram[offset]);
|
||||
}
|
||||
|
||||
template<int Layer>
|
||||
WRITE16_MEMBER(realbrk_state::vram_w)
|
||||
{
|
||||
COMBINE_DATA(&m_vram[Layer][offset]);
|
||||
m_tilemap[Layer]->mark_tile_dirty(offset/2);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Memory Maps
|
||||
@ -160,8 +167,8 @@ void realbrk_state::base_mem(address_map &map)
|
||||
map(0x000000, 0x0fffff).rom(); // ROM
|
||||
map(0x200000, 0x203fff).ram().share("spriteram"); // Sprites
|
||||
map(0x400000, 0x40ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0x600000, 0x601fff).ram().w(FUNC(realbrk_state::vram_0_w)).share("vram_0"); // Background (0)
|
||||
map(0x602000, 0x603fff).ram().w(FUNC(realbrk_state::vram_1_w)).share("vram_1"); // Background (1)
|
||||
map(0x600000, 0x601fff).ram().w(FUNC(realbrk_state::vram_w<0>)).share("vram_0"); // Background (0)
|
||||
map(0x602000, 0x603fff).ram().w(FUNC(realbrk_state::vram_w<1>)).share("vram_1"); // Background (1)
|
||||
map(0x604000, 0x604fff).ram().w(FUNC(realbrk_state::vram_2_w)).share("vram_2"); // Text (2)
|
||||
map(0x605000, 0x61ffff).ram(); //
|
||||
map(0x606000, 0x60600f).ram().w(FUNC(realbrk_state::vregs_w)).share("vregs"); // Scroll + Video Regs
|
||||
|
@ -7,22 +7,24 @@
|
||||
class realbrk_state : public driver_device
|
||||
{
|
||||
public:
|
||||
realbrk_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
realbrk_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_tmp68301(*this, "tmp68301"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_screen(*this, "screen"),
|
||||
m_palette(*this, "palette"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_vram_0(*this, "vram_0"),
|
||||
m_vram_1(*this, "vram_1"),
|
||||
m_vram_2(*this, "vram_2"),
|
||||
m_vram(*this, "vram_%u", 0U),
|
||||
m_vregs(*this, "vregs"),
|
||||
m_dsw_select(*this, "dsw_select"),
|
||||
m_backup_ram(*this, "backup_ram"),
|
||||
m_vram_0ras(*this, "vram_0ras"),
|
||||
m_vram_1ras(*this, "vram_1ras") { }
|
||||
m_vram_ras(*this, "vram_%uras", 0U),
|
||||
m_in_io(*this, "IN%u", 0U),
|
||||
m_dsw_io(*this, "SW%u", 1U),
|
||||
m_paddle_io(*this, "PADDLE%u", 1U),
|
||||
m_player_io(*this, "P%u", 1U)
|
||||
{ }
|
||||
|
||||
void pkgnsh(machine_config &config);
|
||||
void dai2kaku(machine_config &config);
|
||||
@ -37,25 +39,24 @@ private:
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
required_shared_ptr<uint16_t> m_spriteram;
|
||||
required_shared_ptr<uint16_t> m_vram_0;
|
||||
required_shared_ptr<uint16_t> m_vram_1;
|
||||
required_shared_ptr<uint16_t> m_vram_2;
|
||||
required_shared_ptr_array<uint16_t, 3> m_vram;
|
||||
required_shared_ptr<uint16_t> m_vregs;
|
||||
optional_shared_ptr<uint16_t> m_dsw_select;
|
||||
optional_shared_ptr<uint16_t> m_backup_ram;
|
||||
optional_shared_ptr<uint16_t> m_vram_0ras;
|
||||
optional_shared_ptr<uint16_t> m_vram_1ras;
|
||||
optional_shared_ptr_array<uint16_t, 2> m_vram_ras;
|
||||
|
||||
optional_ioport_array<2> m_in_io;
|
||||
optional_ioport_array<4> m_dsw_io;
|
||||
optional_ioport_array<2> m_paddle_io;
|
||||
optional_ioport_array<2> m_player_io;
|
||||
|
||||
std::unique_ptr<bitmap_ind16> m_tmpbitmap0;
|
||||
std::unique_ptr<bitmap_ind16> m_tmpbitmap1;
|
||||
int m_disable_video;
|
||||
tilemap_t *m_tilemap_0;
|
||||
tilemap_t *m_tilemap_1;
|
||||
tilemap_t *m_tilemap_2;
|
||||
tilemap_t *m_tilemap[3];
|
||||
|
||||
// common
|
||||
DECLARE_WRITE16_MEMBER(vram_0_w);
|
||||
DECLARE_WRITE16_MEMBER(vram_1_w);
|
||||
template<int Layer> DECLARE_WRITE16_MEMBER(vram_w);
|
||||
DECLARE_WRITE16_MEMBER(vram_2_w);
|
||||
DECLARE_WRITE16_MEMBER(vregs_w);
|
||||
|
||||
@ -71,15 +72,14 @@ private:
|
||||
DECLARE_READ16_MEMBER(backup_ram_dx_r);
|
||||
DECLARE_WRITE16_MEMBER(backup_ram_w);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_0);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_1);
|
||||
template<int Layer> TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_2);
|
||||
|
||||
virtual void video_start() override;
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_dai2kaku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int layer);
|
||||
void dai2kaku_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int layer);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(vblank_irq);
|
||||
|
@ -70,38 +70,17 @@ WRITE16_MEMBER(realbrk_state::dai2kaku_flipscreen_w)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
TILE_GET_INFO_MEMBER(realbrk_state::get_tile_info_0)
|
||||
template<int Layer>
|
||||
TILE_GET_INFO_MEMBER(realbrk_state::get_tile_info)
|
||||
{
|
||||
uint16_t attr = m_vram_0[tile_index * 2 + 0];
|
||||
uint16_t code = m_vram_0[tile_index * 2 + 1];
|
||||
uint16_t attr = m_vram[Layer][tile_index * 2 + 0];
|
||||
uint16_t code = m_vram[Layer][tile_index * 2 + 1];
|
||||
SET_TILE_INFO_MEMBER(0,
|
||||
code,
|
||||
attr & 0x7f,
|
||||
TILE_FLIPYX( attr >> 14 ));
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(realbrk_state::get_tile_info_1)
|
||||
{
|
||||
uint16_t attr = m_vram_1[tile_index * 2 + 0];
|
||||
uint16_t code = m_vram_1[tile_index * 2 + 1];
|
||||
SET_TILE_INFO_MEMBER(0,
|
||||
code,
|
||||
attr & 0x7f,
|
||||
TILE_FLIPYX( attr >> 14 ));
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(realbrk_state::vram_0_w)
|
||||
{
|
||||
COMBINE_DATA(&m_vram_0[offset]);
|
||||
m_tilemap_0->mark_tile_dirty(offset/2);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(realbrk_state::vram_1_w)
|
||||
{
|
||||
COMBINE_DATA(&m_vram_1[offset]);
|
||||
m_tilemap_1->mark_tile_dirty(offset/2);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Text Tilemap
|
||||
@ -118,7 +97,7 @@ WRITE16_MEMBER(realbrk_state::vram_1_w)
|
||||
|
||||
TILE_GET_INFO_MEMBER(realbrk_state::get_tile_info_2)
|
||||
{
|
||||
uint16_t code = m_vram_2[tile_index];
|
||||
uint16_t code = m_vram[2][tile_index];
|
||||
SET_TILE_INFO_MEMBER(1,
|
||||
code & 0x0fff,
|
||||
((code & 0xf000) >> 12) | ((m_vregs[0xa/2] & 0x7f) << 4),
|
||||
@ -127,12 +106,10 @@ TILE_GET_INFO_MEMBER(realbrk_state::get_tile_info_2)
|
||||
|
||||
WRITE16_MEMBER(realbrk_state::vram_2_w)
|
||||
{
|
||||
COMBINE_DATA(&m_vram_2[offset]);
|
||||
m_tilemap_2->mark_tile_dirty(offset);
|
||||
COMBINE_DATA(&m_vram[2][offset]);
|
||||
m_tilemap[2]->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
|
||||
@ -144,15 +121,15 @@ WRITE16_MEMBER(realbrk_state::vram_2_w)
|
||||
void realbrk_state::video_start()
|
||||
{
|
||||
/* Backgrounds */
|
||||
m_tilemap_0 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_0),this), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x20);
|
||||
m_tilemap_1 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_1),this), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x20);
|
||||
m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info<0>),this), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x20);
|
||||
m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info<1>),this), TILEMAP_SCAN_ROWS, 16, 16, 0x40, 0x20);
|
||||
|
||||
/* Text */
|
||||
m_tilemap_2 = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_2),this), TILEMAP_SCAN_ROWS, 8, 8, 0x40, 0x20);
|
||||
m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(realbrk_state::get_tile_info_2),this), TILEMAP_SCAN_ROWS, 8, 8, 0x40, 0x20);
|
||||
|
||||
m_tilemap_0->set_transparent_pen(0);
|
||||
m_tilemap_1->set_transparent_pen(0);
|
||||
m_tilemap_2->set_transparent_pen(0);
|
||||
m_tilemap[0]->set_transparent_pen(0);
|
||||
m_tilemap[1]->set_transparent_pen(0);
|
||||
m_tilemap[2]->set_transparent_pen(0);
|
||||
|
||||
m_tmpbitmap0 = std::make_unique<bitmap_ind16>(32,32);
|
||||
m_tmpbitmap1 = std::make_unique<bitmap_ind16>(32,32);
|
||||
@ -190,8 +167,10 @@ void realbrk_state::video_start()
|
||||
8.w fe-- ---- ---- ----
|
||||
--d- ---- ---- ---- Flip Y
|
||||
---c ---- ---- ---- Flip X
|
||||
---- ba98 76-- ----
|
||||
---- ---- --54 ---- Rotation
|
||||
---- ba98 76-- 3210 Priority?
|
||||
---- ---- ---- 32--
|
||||
---- ---- ---- --10 Priority
|
||||
|
||||
A.w fedc b--- ---- ----
|
||||
---- -a98 7654 3210 Color
|
||||
@ -205,7 +184,7 @@ void realbrk_state::video_start()
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int layer)
|
||||
{
|
||||
int offs;
|
||||
|
||||
@ -216,16 +195,15 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
|
||||
for ( offs = 0x3000/2; offs < 0x3600/2; offs += 2/2 )
|
||||
{
|
||||
int sx, sy, dim, zoom, flip, color, attr, code, flipx, flipy, gfx, rot;
|
||||
int sx, sy, dim, zoom, flip, color, attr, code, flipx, flipy, gfx, rot, pri;
|
||||
|
||||
int x, xdim, xnum, xstart, xend, xinc;
|
||||
int y, ydim, ynum, ystart, yend, yinc;
|
||||
|
||||
uint16_t *s;
|
||||
if (m_spriteram[offs] & 0x8000)
|
||||
continue;
|
||||
|
||||
if (m_spriteram[offs] & 0x8000) continue;
|
||||
|
||||
s = &m_spriteram[(m_spriteram[offs] & 0x3ff) * 16/2];
|
||||
uint16_t const *const s = &m_spriteram[(m_spriteram[offs] & 0x3ff) * 16/2];
|
||||
|
||||
sy = s[ 0 ];
|
||||
sx = s[ 1 ];
|
||||
@ -236,12 +214,17 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
attr = s[ 6 ];
|
||||
code = s[ 7 ];
|
||||
|
||||
pri = flip & 0x03;
|
||||
|
||||
if(pri != layer)
|
||||
continue;
|
||||
|
||||
xnum = ((dim >> 0) & 0x1f) + 1;
|
||||
ynum = ((dim >> 8) & 0x1f) + 1;
|
||||
|
||||
flipx = flip & 0x0100;
|
||||
flipy = flip & 0x0200;
|
||||
rot = flip & 0x0030;
|
||||
rot = (flip & 0x0030) >> 4;
|
||||
|
||||
gfx = (attr & 0x0001) + 2;
|
||||
|
||||
@ -301,7 +284,7 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
|
||||
switch( rot )
|
||||
{
|
||||
case 0x10: // rot 90
|
||||
case 0x1: // rot 90
|
||||
copyrozbitmap_trans( *m_tmpbitmap1, m_tmpbitmap1->cliprect(), *m_tmpbitmap0,
|
||||
(uint32_t)0<<16,
|
||||
(uint32_t)16<<16,
|
||||
@ -317,7 +300,7 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
copybitmap_trans( bitmap,*m_tmpbitmap1, 0,0, currx,curry, cliprect, 0 );
|
||||
break;
|
||||
|
||||
case 0x20: // rot 180
|
||||
case 0x2: // rot 180
|
||||
copyrozbitmap_trans( *m_tmpbitmap1, m_tmpbitmap1->cliprect(), *m_tmpbitmap0,
|
||||
(uint32_t)16<<16,
|
||||
(uint32_t)16<<16,
|
||||
@ -333,7 +316,7 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
|
||||
copybitmap_trans( bitmap,*m_tmpbitmap1, 0,0, currx,curry, cliprect, 0 );
|
||||
break;
|
||||
|
||||
case 0x30: // rot 270
|
||||
case 0x3: // rot 270
|
||||
copyrozbitmap_trans( *m_tmpbitmap1, m_tmpbitmap1->cliprect(), *m_tmpbitmap0,
|
||||
(uint32_t)16<<16,
|
||||
(uint32_t)0<<16,
|
||||
@ -476,7 +459,7 @@ WRITE16_MEMBER(realbrk_state::vregs_w)
|
||||
if (new_data != old_data)
|
||||
{
|
||||
if (offset == 0xa/2)
|
||||
m_tilemap_0->mark_all_dirty();
|
||||
m_tilemap[0]->mark_all_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
@ -484,11 +467,11 @@ uint32_t realbrk_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
|
||||
{
|
||||
int layers_ctrl = -1;
|
||||
|
||||
m_tilemap_0->set_scrolly(0, m_vregs[0x0/2]);
|
||||
m_tilemap_0->set_scrollx(0, m_vregs[0x2/2]);
|
||||
m_tilemap[0]->set_scrolly(0, m_vregs[0x0/2]);
|
||||
m_tilemap[0]->set_scrollx(0, m_vregs[0x2/2]);
|
||||
|
||||
m_tilemap_1->set_scrolly(0, m_vregs[0x4/2]);
|
||||
m_tilemap_1->set_scrollx(0, m_vregs[0x6/2]);
|
||||
m_tilemap[1]->set_scrolly(0, m_vregs[0x4/2]);
|
||||
m_tilemap[1]->set_scrollx(0, m_vregs[0x6/2]);
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if ( machine().input().code_pressed(KEYCODE_Z) )
|
||||
@ -510,12 +493,18 @@ if ( machine().input().code_pressed(KEYCODE_Z) )
|
||||
else
|
||||
bitmap.fill(m_vregs[0xc/2] & 0x7fff, cliprect);
|
||||
|
||||
if (layers_ctrl & 2) m_tilemap_1->draw(screen, bitmap, cliprect, 0,0);
|
||||
if (layers_ctrl & 1) m_tilemap_0->draw(screen, bitmap, cliprect, 0,0);
|
||||
if (layers_ctrl & 8) draw_sprites(bitmap,cliprect,3); // Unknown
|
||||
if (layers_ctrl & 8) draw_sprites(bitmap,cliprect,2); // Under m_tilemap[1], Under m_tilemap[0]
|
||||
|
||||
if (layers_ctrl & 8) draw_sprites(bitmap,cliprect);
|
||||
if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, 0,0);
|
||||
|
||||
if (layers_ctrl & 4) m_tilemap_2->draw(screen, bitmap, cliprect, 0,0);
|
||||
if (layers_ctrl & 8) draw_sprites(bitmap,cliprect,1); // Over m_tilemap[1], Under m_tilemap[0]
|
||||
|
||||
if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0,0);
|
||||
|
||||
if (layers_ctrl & 8) draw_sprites(bitmap,cliprect,0); // Over m_tilemap[1], Over m_tilemap[0]
|
||||
|
||||
if (layers_ctrl & 4) m_tilemap[2]->draw(screen, bitmap, cliprect, 0,0);
|
||||
|
||||
// popmessage("%04x",m_vregs[0x8/2]);
|
||||
return 0;
|
||||
@ -525,40 +514,36 @@ if ( machine().input().code_pressed(KEYCODE_Z) )
|
||||
uint32_t realbrk_state::screen_update_dai2kaku(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int layers_ctrl = -1;
|
||||
int offs, bgx0, bgy0, bgx1, bgy1;
|
||||
int offs;
|
||||
|
||||
bgy0 = m_vregs[0x0/2];
|
||||
bgx0 = m_vregs[0x2/2];
|
||||
bgy1 = m_vregs[0x4/2];
|
||||
bgx1 = m_vregs[0x6/2];
|
||||
int const bgy0 = m_vregs[0x0/2];
|
||||
int const bgx0 = m_vregs[0x2/2];
|
||||
int const bgy1 = m_vregs[0x4/2];
|
||||
int const bgx1 = m_vregs[0x6/2];
|
||||
|
||||
// bg0
|
||||
m_tilemap_0->set_scroll_rows(512);
|
||||
m_tilemap_0->set_scroll_cols(1);
|
||||
if( m_vregs[8/2] & (0x0100)){
|
||||
m_tilemap[0]->set_scroll_rows(512);
|
||||
for(offs=0; offs<(512); offs++) {
|
||||
m_tilemap_0->set_scrollx(offs, bgx0 - (m_vram_1ras[offs]&0x3ff) );
|
||||
m_tilemap[0]->set_scrollx(offs, bgx0 - (m_vram_ras[1][offs]&0x3ff) );
|
||||
}
|
||||
} else {
|
||||
for(offs=0; offs<(512); offs++) {
|
||||
m_tilemap_0->set_scrollx(offs, bgx0 );
|
||||
}
|
||||
m_tilemap[0]->set_scroll_rows(1);
|
||||
m_tilemap[0]->set_scrollx(0, bgx0 );
|
||||
}
|
||||
m_tilemap_0->set_scrolly(0, bgy0 );
|
||||
m_tilemap[0]->set_scrolly(0, bgy0 );
|
||||
|
||||
// bg1
|
||||
m_tilemap_1->set_scroll_rows(512);
|
||||
m_tilemap_1->set_scroll_cols(1);
|
||||
if( m_vregs[8/2] & (0x0001)){
|
||||
m_tilemap[1]->set_scroll_rows(512);
|
||||
for(offs=0; offs<(512); offs++) {
|
||||
m_tilemap_1->set_scrollx(offs, bgx1 - (m_vram_1ras[offs]&0x3ff) );
|
||||
m_tilemap[1]->set_scrollx(offs, bgx1 - (m_vram_ras[1][offs]&0x3ff) );
|
||||
}
|
||||
} else {
|
||||
for(offs=0; offs<(512); offs++) {
|
||||
m_tilemap_1->set_scrollx(offs, bgx1 );
|
||||
}
|
||||
m_tilemap[1]->set_scroll_rows(1);
|
||||
m_tilemap[1]->set_scrollx(0, bgx1 );
|
||||
}
|
||||
m_tilemap_1->set_scrolly(0, bgy1 );
|
||||
m_tilemap[1]->set_scrolly(0, bgy1 );
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
if ( machine().input().code_pressed(KEYCODE_Z) )
|
||||
@ -587,9 +572,9 @@ if ( machine().input().code_pressed(KEYCODE_Z) )
|
||||
|
||||
// bglow
|
||||
if( m_vregs[8/2] & (0x8000)){
|
||||
if (layers_ctrl & 1) m_tilemap_0->draw(screen, bitmap, cliprect, 0,0);
|
||||
if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0,0);
|
||||
} else {
|
||||
if (layers_ctrl & 2) m_tilemap_1->draw(screen, bitmap, cliprect, 0,0);
|
||||
if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, 0,0);
|
||||
}
|
||||
|
||||
// spr 1
|
||||
@ -597,16 +582,16 @@ if ( machine().input().code_pressed(KEYCODE_Z) )
|
||||
|
||||
// bghigh
|
||||
if( m_vregs[8/2] & (0x8000)){
|
||||
if (layers_ctrl & 2) m_tilemap_1->draw(screen, bitmap, cliprect, 0,0);
|
||||
if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, 0,0);
|
||||
} else {
|
||||
if (layers_ctrl & 1) m_tilemap_0->draw(screen, bitmap, cliprect, 0,0);
|
||||
if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0,0);
|
||||
}
|
||||
|
||||
// spr 2
|
||||
if (layers_ctrl & 8) dai2kaku_draw_sprites(bitmap,cliprect,0);
|
||||
|
||||
// fix
|
||||
if (layers_ctrl & 4) m_tilemap_2->draw(screen, bitmap, cliprect, 0,0);
|
||||
if (layers_ctrl & 4) m_tilemap[2]->draw(screen, bitmap, cliprect, 0,0);
|
||||
|
||||
// usrintf_showmessage("%04x",m_vregs[0x8/2]);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user