From a755a99fd34019bd6a317491e00f79988eb75a34 Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 24 Nov 2024 21:52:21 +0100 Subject: [PATCH] quasar: correct bullet size, hook up videochip sound channels, galaxia: correct bullet size, better screen refresh rate --- src/mame/cvs/cvs.cpp | 23 +++++++++++----------- src/mame/cvs/galaxia.cpp | 41 ++++++++++++++++++++++------------------ src/mame/cvs/quasar.cpp | 23 ++++++++++++++-------- 3 files changed, 50 insertions(+), 37 deletions(-) diff --git a/src/mame/cvs/cvs.cpp b/src/mame/cvs/cvs.cpp index ce9c22ebf69..47cdfb218ce 100644 --- a/src/mame/cvs/cvs.cpp +++ b/src/mame/cvs/cvs.cpp @@ -363,7 +363,6 @@ uint32_t cvs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c x, y); } - // Update screen - 8 regions, fixed scrolling area int scroll[8]; @@ -393,22 +392,24 @@ uint32_t cvs_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c { int const bx = 255 - 7 - m_bullet_ram[offs] - ct; - // Bullet/Object Collision - if ((s2636_0_bitmap.pix(offs, bx) != 0) || - (s2636_1_bitmap.pix(offs, bx) != 0) || - (s2636_2_bitmap.pix(offs, bx) != 0)) - m_collision_register |= 0x08; + if (cliprect.contains(bx, offs)) + { + // Bullet/Object Collision + if ((s2636_0_bitmap.pix(offs, bx) != 0) || + (s2636_1_bitmap.pix(offs, bx) != 0) || + (s2636_2_bitmap.pix(offs, bx) != 0)) + m_collision_register |= 0x08; - // Bullet/Background Collision - if (m_palette->pen_indirect(m_scrolled_collision_background.pix(offs, bx))) - m_collision_register |= 0x80; + // Bullet/Background Collision + if (m_palette->pen_indirect(m_scrolled_collision_background.pix(offs, bx))) + m_collision_register |= 0x80; - bitmap.pix(offs, bx) = BULLET_STAR_PEN; + bitmap.pix(offs, bx) = BULLET_STAR_PEN; + } } } } - // mix and copy the S2636 images into the main bitmap, also check for collision for (int y = cliprect.top(); y <= cliprect.bottom(); y++) { diff --git a/src/mame/cvs/galaxia.cpp b/src/mame/cvs/galaxia.cpp index 22ff913eff7..39575bcc9e8 100644 --- a/src/mame/cvs/galaxia.cpp +++ b/src/mame/cvs/galaxia.cpp @@ -65,12 +65,11 @@ real hardware video of Astro Wars can be seen here: youtu.be/eSrQFBMeDlM TODO: - go through everything in the schematics for astrowar / galaxia - video rewrite to: - * support RAW_PARAMS, blanking is much like how laserbat hardware does it - and is needed to correct the speed in all machines - * improve bullets - * provide correct color/star generation, using info from Galaxia technical - manual and schematics - * provide accurate sprite/bg sync in astrowar + * support RAW_PARAMS, blanking is much like how laserbat hardware does it + and is needed to correct the speed in all machines + * provide correct color/star generation, using info from Galaxia technical + manual and schematics + * provide accurate sprite/bg sync in astrowar - what is the PROM for? schematics are too burnt to tell anything - add sound board emulation @@ -172,7 +171,7 @@ void galaxia_state::palette(palette_device &palette) const // stars/bullets palette.set_pen_color(STAR_PEN, pal1bit(1), pal1bit(1), pal1bit(1)); - palette.set_pen_color(BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(0)); + palette.set_pen_color(BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(1)); } void astrowar_state::palette(palette_device &palette) const @@ -192,7 +191,7 @@ void astrowar_state::palette(palette_device &palette) const // stars/bullets palette.set_pen_color(STAR_PEN, pal1bit(1), pal1bit(1), pal1bit(1)); - palette.set_pen_color(BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(0)); + palette.set_pen_color(BULLET_PEN, pal1bit(1), pal1bit(1), pal1bit(1)); } TILE_GET_INFO_MEMBER(galaxia_state::get_bg_tile_info) @@ -259,15 +258,18 @@ uint32_t galaxia_state::screen_update(screen_device &screen, bitmap_ind16 &bitma bool const bullet = m_bullet_ram[y] && x == (m_bullet_ram[y] ^ 0xff); bool const background = (bitmap.pix(y, x) & 3) != 0; - // draw bullets (guesswork) + // draw bullets if (bullet) { // background vs. bullet collision detection if (background) m_collision_register |= 0x80; - // bullet size/color/priority is guessed - bitmap.pix(y, x) = BULLET_PEN; - if (x) bitmap.pix(y, x - 1) = BULLET_PEN; + // draw white 1x4-size bullet + for (int bx = 0; bx < 4; bx++) + { + if (cliprect.contains(x - bx, y)) + bitmap.pix(y, x - bx) = BULLET_PEN; + } } // copy the S2636 images into the main bitmap and check collision @@ -317,7 +319,7 @@ uint32_t astrowar_state::screen_update(screen_device &screen, bitmap_ind16 &bitm for (int y = cliprect.top(); y <= cliprect.bottom(); y++) { - // draw bullets (guesswork) + // draw bullets if (m_bullet_ram[y]) { uint8_t const pos = m_bullet_ram[y] ^ 0xff; @@ -326,9 +328,12 @@ uint32_t astrowar_state::screen_update(screen_device &screen, bitmap_ind16 &bitm if (m_temp_bitmap.pix(y, pos) & 1) m_collision_register |= 0x02; - // bullet size/color/priority is guessed - bitmap.pix(y, pos) = BULLET_PEN; - if (pos) bitmap.pix(y, pos - 1) = BULLET_PEN; + // draw white 1x4-size bullet + for (int bx = 0; bx < 4; bx++) + { + if (cliprect.contains(pos - bx, y)) + bitmap.pix(y, pos - bx) = BULLET_PEN; + } } for (int x = cliprect.left(); x <= cliprect.right(); x++) @@ -584,7 +589,7 @@ void galaxia_state::galaxia(machine_config &config) // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); - m_screen->set_refresh_hz(60); // wrong + m_screen->set_refresh_hz(50); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); m_screen->set_size(256, 256); m_screen->set_visarea(0*8, 30*8-1, 2*8, 32*8-1); @@ -625,7 +630,7 @@ void astrowar_state::astrowar(machine_config &config) // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); - m_screen->set_refresh_hz(60); + m_screen->set_refresh_hz(50); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); m_screen->set_size(256, 256); m_screen->set_visarea(1*8, 31*8-1, 2*8, 32*8-1); diff --git a/src/mame/cvs/quasar.cpp b/src/mame/cvs/quasar.cpp index 3ba18776881..07b2693da71 100644 --- a/src/mame/cvs/quasar.cpp +++ b/src/mame/cvs/quasar.cpp @@ -234,15 +234,19 @@ uint32_t quasar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap { if (m_bullet_ram[offs] != 0) { - for (int ct = 0; ct < 1; ct++) + for (int ct = 0; ct < 4; ct++) { - int const bx = 255 - 9 - m_bullet_ram[offs] - ct; + int const bx = 255 - 8 - m_bullet_ram[offs] - (ct & 1); + int const by = offs - (ct >> 1); - // bullet/object Collision - if (s2636_0_bitmap.pix(offs, bx) != 0) m_collision_register |= 0x04; - if (s2636_2_bitmap.pix(offs, bx) != 0) m_collision_register |= 0x08; + if (cliprect.contains(bx, by)) + { + // bullet/object Collision + if (s2636_0_bitmap.pix(by, bx) != 0) m_collision_register |= 0x04; + if (s2636_2_bitmap.pix(by, bx) != 0) m_collision_register |= 0x08; - bitmap.pix(offs, bx) = 7; + bitmap.pix(by, bx) = 7; + } } } } @@ -542,18 +546,21 @@ void quasar_state::quasar(machine_config &config) S2636(config, m_s2636[0], 0); m_s2636[0]->set_offsets(CVS_S2636_Y_OFFSET - 8, CVS_S2636_X_OFFSET - 9); + m_s2636[0]->add_route(ALL_OUTPUTS, "mono", 0.2); S2636(config, m_s2636[1], 0); m_s2636[1]->set_offsets(CVS_S2636_Y_OFFSET - 8, CVS_S2636_X_OFFSET - 9); + m_s2636[1]->add_route(ALL_OUTPUTS, "mono", 0.2); S2636(config, m_s2636[2], 0); m_s2636[2]->set_offsets(CVS_S2636_Y_OFFSET - 8, CVS_S2636_X_OFFSET - 9); + m_s2636[2]->add_route(ALL_OUTPUTS, "mono", 0.2); // sound hardware GENERIC_LATCH_8(config, m_soundlatch); - SPEAKER(config, "speaker").front_center(); - DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // LM1408 + SPEAKER(config, "mono").front_center(); + DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.2); // LM1408 }