jalmah.cpp: rewrote video by using Mega System 1 tilemap devices [Angelo Salese]

jalmah.cpp: fixed Urashima Mahjong video priority during gameplay (score display and calls) [Angelo Salese]
This commit is contained in:
angelosa 2018-06-15 01:22:29 +02:00
parent 7e2f2b8039
commit 99a4d63f83
3 changed files with 380 additions and 650 deletions

File diff suppressed because it is too large Load Diff

View File

@ -137,6 +137,8 @@ void megasys1_tilemap_device::device_reset()
// TODO: might be something else (smaller VRAM size?)
for(int i=0;i<m_scrollram.bytes()/2;i++)
m_scrollram[i] = 0xffff;
m_tile_bank = 0;
}
void megasys1_tilemap_device::device_post_load()
@ -225,13 +227,17 @@ TILEMAP_MAPPER_MEMBER(megasys1_tilemap_device::scan_16x16)
TILE_GET_INFO_MEMBER(megasys1_tilemap_device::get_scroll_tile_info_8x8)
{
uint16_t code = m_scrollram[tile_index];
SET_TILE_INFO_MEMBER(0, (code & 0xfff) * m_8x8_scroll_factor, code >> (16 - m_bits_per_color_code), 0);
uint16_t tile = ((code & 0xfff) + m_tile_bank) * m_8x8_scroll_factor;
SET_TILE_INFO_MEMBER(0, tile, code >> (16 - m_bits_per_color_code), 0);
}
TILE_GET_INFO_MEMBER(megasys1_tilemap_device::get_scroll_tile_info_16x16)
{
uint16_t code = m_scrollram[tile_index/4];
SET_TILE_INFO_MEMBER(0, (code & 0xfff) * m_16x16_scroll_factor + (tile_index & 3), code >> (16 - m_bits_per_color_code), 0);
uint16_t tile = ((code & 0xfff) + m_tile_bank) * m_16x16_scroll_factor;
tile+= tile_index & 3;
SET_TILE_INFO_MEMBER(0, tile, code >> (16 - m_bits_per_color_code), 0);
}
READ16_MEMBER(megasys1_tilemap_device::scroll_r)
@ -302,3 +308,9 @@ void megasys1_tilemap_device::set_flip(uint32_t attributes)
{
m_tmap->set_flip(attributes);
}
void megasys1_tilemap_device::set_tilebank(uint8_t bank)
{
m_tile_bank = bank << 12;
m_tmap->mark_all_dirty();
}

View File

@ -62,6 +62,7 @@ public:
void draw(screen_device &screen, bitmap_ind16 &dest, const rectangle &cliprect, uint32_t flags, uint8_t priority = 0, uint8_t priority_mask = 0xff);
void enable(bool enable);
void set_flip(uint32_t attributes);
void set_tilebank(uint8_t bank);
protected:
// device-level overrides
@ -86,6 +87,7 @@ private:
uint16_t m_scrollx;
uint16_t m_scrolly;
uint16_t m_scroll_flag;
uint16_t m_tile_bank;
tilemap_t *m_tmap;
tilemap_t *m_tilemap[2][4];