diff --git a/src/mame/drivers/aquarium.cpp b/src/mame/drivers/aquarium.cpp index 4faa472e881..6c665a195ce 100644 --- a/src/mame/drivers/aquarium.cpp +++ b/src/mame/drivers/aquarium.cpp @@ -26,6 +26,10 @@ Notes: - A bug in the program code causes the OKI to be reset on the very first coin inserted. +// Sound banking + video references +// https://www.youtube.com/watch?v=nyAQPrkt_a4 +// https://www.youtube.com/watch?v=0gn2Kj2M46Q + */ @@ -62,10 +66,6 @@ WRITE16_MEMBER(aquarium_state::aquarium_sound_w) WRITE8_MEMBER(aquarium_state::aquarium_z80_bank_w) { - // banking reference - // https://www.youtube.com/watch?v=nyAQPrkt_a4 - // (video also shows our video priority is incorrect) - // uses bits ---x --xx data = BITSWAP8(data, 7, 6, 5, 2, 3, 1, 4, 0); @@ -402,5 +402,5 @@ ROM_START( aquariumj ) ROM_LOAD( "aquar4", 0x000000, 0x80000, CRC(9a4af531) SHA1(bb201b7a6c9fd5924a0d79090257efffd8d4aba1) ) ROM_END -GAME( 1996, aquarium, 0, aquarium, aquarium, aquarium_state, aquarium, ROT0, "Excellent System", "Aquarium (US)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) -GAME( 1996, aquariumj,aquarium, aquarium, aquarium, aquarium_state, aquarium, ROT0, "Excellent System", "Aquarium (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1996, aquarium, 0, aquarium, aquarium, aquarium_state, aquarium, ROT0, "Excellent System", "Aquarium (US)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) +GAME( 1996, aquariumj,aquarium, aquarium, aquarium, aquarium_state, aquarium, ROT0, "Excellent System", "Aquarium (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) diff --git a/src/mame/includes/aquarium.h b/src/mame/includes/aquarium.h index 8b3bb94e32f..7002312653f 100644 --- a/src/mame/includes/aquarium.h +++ b/src/mame/includes/aquarium.h @@ -17,14 +17,16 @@ public: m_oki(*this, "oki"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), - m_sprgen(*this, "spritegen"){ } + m_sprgen(*this, "spritegen"), + m_screen(*this, "screen") + { } /* memory pointers */ required_shared_ptr m_mid_videoram; required_shared_ptr m_bak_videoram; required_shared_ptr m_txt_videoram; required_shared_ptr m_scroll; - + /* video-related */ tilemap_t *m_txt_tilemap; tilemap_t *m_mid_tilemap; @@ -59,5 +61,8 @@ public: required_device m_gfxdecode; required_device m_palette; required_device m_sprgen; + required_device m_screen; + void mix_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_mask, int priority_value); + bitmap_ind16 m_temp_sprite_bitmap; }; diff --git a/src/mame/video/aquarium.cpp b/src/mame/video/aquarium.cpp index 54a439249fe..a941388269e 100644 --- a/src/mame/video/aquarium.cpp +++ b/src/mame/video/aquarium.cpp @@ -14,6 +14,9 @@ TILE_GET_INFO_MEMBER(aquarium_state::get_aquarium_txt_tile_info) tileno = (m_txt_videoram[tile_index] & 0x0fff); colour = (m_txt_videoram[tile_index] & 0xf000) >> 12; SET_TILE_INFO_MEMBER(2, tileno, colour, 0); + + tileinfo.category = (m_txt_videoram[tile_index] & 0x8000) >> 15; + } WRITE16_MEMBER(aquarium_state::aquarium_txt_videoram_w) @@ -70,6 +73,28 @@ void aquarium_state::video_start() m_txt_tilemap->set_transparent_pen(0); m_mid_tilemap->set_transparent_pen(0); + m_bak_tilemap->set_transparent_pen(0); + + m_screen->register_screen_bitmap(m_temp_sprite_bitmap); +} + +void aquarium_state::mix_sprite_bitmap(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_mask, int priority_value) +{ + for (int y = cliprect.min_y;y <= cliprect.max_y;y++) + { + UINT16* srcline = &m_temp_sprite_bitmap.pix16(y); + UINT16* dstline = &bitmap.pix16(y); + + for (int x = cliprect.min_x;x <= cliprect.max_x;x++) + { + UINT16 pixel = srcline[x]; + + if (pixel & 0xf) + if ((pixel & priority_mask) == priority_value) + dstline[x] = pixel; + + } + } } UINT32 aquarium_state::screen_update_aquarium(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -80,14 +105,22 @@ UINT32 aquarium_state::screen_update_aquarium(screen_device &screen, bitmap_ind1 m_bak_tilemap->set_scrolly(0, m_scroll[3]); m_txt_tilemap->set_scrollx(0, m_scroll[4]); m_txt_tilemap->set_scrolly(0, m_scroll[5]); + + bitmap.fill(0, cliprect); // WDUD logo suggests this + + m_temp_sprite_bitmap.fill(0, cliprect); + m_sprgen->aquarium_draw_sprites(m_temp_sprite_bitmap, cliprect, m_gfxdecode, 16); + m_bak_tilemap->draw(screen, bitmap, cliprect, 0, 0); + mix_sprite_bitmap(screen, bitmap, cliprect, 0x80, 0x80); m_mid_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - m_sprgen->aquarium_draw_sprites(bitmap, cliprect, m_gfxdecode, 16); + m_txt_tilemap->draw(screen, bitmap, cliprect, 1, 0); m_bak_tilemap->draw(screen, bitmap, cliprect, 1, 0); + mix_sprite_bitmap(screen, bitmap, cliprect, 0x80, 0x00); m_mid_tilemap->draw(screen, bitmap, cliprect, 1, 0); m_txt_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; }