From 3c988c16ca6f577ae94b2752ca0e4f799b99db0d Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 25 Aug 2019 12:28:28 +0200 Subject: [PATCH 1/7] fix MT 7401: salamander flickering sprites (nw) --- src/mame/drivers/nemesis.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp index 211f29ffe61..17641762669 100644 --- a/src/mame/drivers/nemesis.cpp +++ b/src/mame/drivers/nemesis.cpp @@ -1997,7 +1997,6 @@ void nemesis_state::salamand(machine_config &config) /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_AFTER_VBLANK); set_screen_raw_params(config); m_screen->set_screen_update(FUNC(nemesis_state::screen_update_nemesis)); m_screen->set_palette(m_palette); @@ -2044,7 +2043,6 @@ void nemesis_state::blkpnthr(machine_config &config) /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); set_screen_raw_params(config); m_screen->set_screen_update(FUNC(nemesis_state::screen_update_nemesis)); m_screen->set_palette(m_palette); @@ -2086,7 +2084,6 @@ void nemesis_state::citybomb(machine_config &config) /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); set_screen_raw_params(config); m_screen->set_screen_update(FUNC(nemesis_state::screen_update_nemesis)); m_screen->set_palette(m_palette); @@ -2132,7 +2129,6 @@ void nemesis_state::nyanpani(machine_config &config) /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); set_screen_raw_params(config); m_screen->set_screen_update(FUNC(nemesis_state::screen_update_nemesis)); m_screen->set_palette(m_palette); From a3d33da753e10e1cd938a83f4e40d1e263a88373 Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Sat, 31 Aug 2019 10:04:49 +0200 Subject: [PATCH 2/7] -newport: Various changes. [Ryan Holtz] * Reimplemented logging code for external viewer. * Fixed 8bpp overlay bit combination. * Fixed broken blending. * Added bit lane expansion, needed for proper double-buffered accesses. * Simplified default color accesses. --- src/devices/bus/gio64/newport.cpp | 338 ++++++++++++++++++++++-------- src/devices/bus/gio64/newport.h | 22 +- 2 files changed, 270 insertions(+), 90 deletions(-) diff --git a/src/devices/bus/gio64/newport.cpp b/src/devices/bus/gio64/newport.cpp index 2a35437a4b0..e7d7dfdea81 100644 --- a/src/devices/bus/gio64/newport.cpp +++ b/src/devices/bus/gio64/newport.cpp @@ -89,6 +89,28 @@ void xmap9_device::device_reset() memset(m_mode_table, 0, sizeof(uint32_t) * ARRAY_LENGTH(m_mode_table)); } +void xmap9_device::serialize(FILE *file) +{ + fwrite(&m_config, sizeof(uint32_t), 1, file); + fwrite(&m_revision, sizeof(uint32_t), 1, file); + fwrite(&m_fifo_available, sizeof(uint32_t), 1, file); + fwrite(&m_cursor_cmap, sizeof(uint32_t), 1, file); + fwrite(&m_popup_cmap, sizeof(uint32_t), 1, file); + fwrite(&m_mode_table_idx, sizeof(uint32_t), 1, file); + fwrite(m_mode_table, sizeof(uint32_t), 0x20, file); +} + +void xmap9_device::deserialize(FILE *file) +{ + fread(&m_config, sizeof(uint32_t), 1, file); + fread(&m_revision, sizeof(uint32_t), 1, file); + fread(&m_fifo_available, sizeof(uint32_t), 1, file); + fread(&m_cursor_cmap, sizeof(uint32_t), 1, file); + fread(&m_popup_cmap, sizeof(uint32_t), 1, file); + fread(&m_mode_table_idx, sizeof(uint32_t), 1, file); + fread(&m_mode_table, sizeof(uint32_t), 0x20, file); +} + uint32_t xmap9_device::read(uint32_t offset) { switch (offset) @@ -214,6 +236,22 @@ void cmap_device::device_reset() memset(m_palette, 0, sizeof(uint32_t) * ARRAY_LENGTH(m_palette)); } +void cmap_device::serialize(FILE *file) +{ + fwrite(&m_status, sizeof(uint32_t), 1, file); + fwrite(&m_revision, sizeof(uint32_t), 1, file); + fwrite(&m_palette_idx, sizeof(uint16_t), 1, file); + fwrite(m_palette, sizeof(uint32_t), 0x10000, file); +} + +void cmap_device::deserialize(FILE *file) +{ + fread(&m_status, sizeof(uint32_t), 1, file); + fread(&m_revision, sizeof(uint32_t), 1, file); + fread(&m_palette_idx, sizeof(uint16_t), 1, file); + fread(m_palette, sizeof(uint32_t), 0x10000, file); +} + void cmap_device::write(uint32_t offset, uint32_t data) { switch (offset) @@ -340,6 +378,66 @@ void vc2_device::device_reset() m_enable_cursor = false; } +void vc2_device::serialize(FILE *file) +{ + fwrite(&m_vid_entry, sizeof(uint16_t), 1, file); + fwrite(&m_cursor_entry, sizeof(uint16_t), 1, file); + fwrite(&m_cursor_x, sizeof(uint16_t), 1, file); + fwrite(&m_cursor_y, sizeof(uint16_t), 1, file); + fwrite(&m_cur_cursor_x, sizeof(uint16_t), 1, file); + fwrite(&m_did_entry, sizeof(uint16_t), 1, file); + fwrite(&m_scanline_len, sizeof(uint16_t), 1, file); + fwrite(&m_ram_addr, sizeof(uint16_t), 1, file); + fwrite(&m_vt_frame_ptr, sizeof(uint16_t), 1, file); + fwrite(&m_vt_line_ptr, sizeof(uint16_t), 1, file); + fwrite(&m_vt_line_run, sizeof(uint16_t), 1, file); + fwrite(&m_vt_line_count, sizeof(uint16_t), 1, file); + fwrite(&m_cursor_table_ptr, sizeof(uint16_t), 1, file); + fwrite(&m_work_cursor_y, sizeof(uint16_t), 1, file); + fwrite(&m_did_frame_ptr, sizeof(uint16_t), 1, file); + fwrite(&m_did_line_ptr, sizeof(uint16_t), 1, file); + fwrite(&m_display_ctrl, sizeof(uint16_t), 1, file); + fwrite(&m_config, sizeof(uint16_t), 1, file); + fwrite(&m_reg_idx, sizeof(uint8_t), 1, file); + fwrite(&m_ram[0], sizeof(uint16_t), RAM_SIZE, file); + fwrite(&m_vt_table[0], sizeof(uint32_t), 2048 * 2048, file); + fwrite(&m_readout_x0, sizeof(int), 1, file); + fwrite(&m_readout_y0, sizeof(int), 1, file); + fwrite(&m_readout_x1, sizeof(int), 1, file); + fwrite(&m_readout_y1, sizeof(int), 1, file); + fwrite(&m_enable_cursor, sizeof(bool), 1, file); +} + +void vc2_device::deserialize(FILE *file) +{ + fread(&m_vid_entry, sizeof(uint16_t), 1, file); + fread(&m_cursor_entry, sizeof(uint16_t), 1, file); + fread(&m_cursor_x, sizeof(uint16_t), 1, file); + fread(&m_cursor_y, sizeof(uint16_t), 1, file); + fread(&m_cur_cursor_x, sizeof(uint16_t), 1, file); + fread(&m_did_entry, sizeof(uint16_t), 1, file); + fread(&m_scanline_len, sizeof(uint16_t), 1, file); + fread(&m_ram_addr, sizeof(uint16_t), 1, file); + fread(&m_vt_frame_ptr, sizeof(uint16_t), 1, file); + fread(&m_vt_line_ptr, sizeof(uint16_t), 1, file); + fread(&m_vt_line_run, sizeof(uint16_t), 1, file); + fread(&m_vt_line_count, sizeof(uint16_t), 1, file); + fread(&m_cursor_table_ptr, sizeof(uint16_t), 1, file); + fread(&m_work_cursor_y, sizeof(uint16_t), 1, file); + fread(&m_did_frame_ptr, sizeof(uint16_t), 1, file); + fread(&m_did_line_ptr, sizeof(uint16_t), 1, file); + fread(&m_display_ctrl, sizeof(uint16_t), 1, file); + fread(&m_config, sizeof(uint16_t), 1, file); + fread(&m_reg_idx, sizeof(uint8_t), 1, file); + fread(&m_ram[0], sizeof(uint16_t), RAM_SIZE, file); + fread(&m_vt_table[0], sizeof(uint32_t), 2048 * 2048, file); + fread(&m_readout_x0, sizeof(int), 1, file); + fread(&m_readout_y0, sizeof(int), 1, file); + fread(&m_readout_x1, sizeof(int), 1, file); + fread(&m_readout_y1, sizeof(int), 1, file); + fread(&m_enable_cursor, sizeof(bool), 1, file); +} + void vc2_device::write(uint32_t offset, uint32_t data, uint32_t mem_mask) { if (mem_mask == 0x000000ff) @@ -756,8 +854,10 @@ void rb2_device::device_start() save_item(NAME(m_dblsrc)); save_item(NAME(m_plane_enable)); save_item(NAME(m_draw_depth)); + save_item(NAME(m_draw_bpp)); save_item(NAME(m_logicop)); - save_item(NAME(m_store_shift)); + save_item(NAME(m_src_shift)); + save_item(NAME(m_dst_shift)); save_pointer(NAME(&m_rgbci[0]), BUFFER_SIZE); save_pointer(NAME(&m_cidaux[0]), BUFFER_SIZE); @@ -772,13 +872,77 @@ void rb2_device::device_reset() m_dblsrc = false; m_plane_enable = 0; m_draw_depth = 0; + m_draw_bpp = 8; m_logicop = 0; - m_store_shift = 0; + m_src_shift = 0; + m_dst_shift = 0; m_dest_buf = &m_rgbci[0]; m_buf_ptr = &m_rgbci[0]; } +void rb2_device::serialize(FILE *file) +{ + fwrite(&m_global_mask, sizeof(uint32_t), 1, file); + fwrite(&m_write_mask, sizeof(uint32_t), 1, file); + fwrite(&m_blend, sizeof(bool), 1, file); + fwrite(&m_fast_clear, sizeof(bool), 1, file); + fwrite(&m_rgbmode, sizeof(bool), 1, file); + fwrite(&m_dblsrc, sizeof(bool), 1, file); + fwrite(&m_plane_enable, sizeof(uint8_t), 1, file); + fwrite(&m_draw_depth, sizeof(uint8_t), 1, file); + fwrite(&m_logicop, sizeof(uint8_t), 1, file); + fwrite(&m_src_shift, sizeof(uint8_t), 1, file); + fwrite(&m_dst_shift, sizeof(uint8_t), 1, file); +} + +void rb2_device::deserialize(FILE *file) +{ + fread(&m_global_mask, sizeof(uint32_t), 1, file); + fread(&m_write_mask, sizeof(uint32_t), 1, file); + fread(&m_blend, sizeof(bool), 1, file); + fread(&m_fast_clear, sizeof(bool), 1, file); + fread(&m_rgbmode, sizeof(bool), 1, file); + fread(&m_dblsrc, sizeof(bool), 1, file); + fread(&m_plane_enable, sizeof(uint8_t), 1, file); + fread(&m_draw_depth, sizeof(uint8_t), 1, file); + fread(&m_logicop, sizeof(uint8_t), 1, file); + fread(&m_src_shift, sizeof(uint8_t), 1, file); + fread(&m_dst_shift, sizeof(uint8_t), 1, file); +} + +uint32_t rb2_device::expand_to_all_lanes(uint32_t src) +{ + switch (m_draw_depth) { + case 0: + src |= src << 4; + src |= src << 8; + src |= src << 16; + break; + case 1: + src |= src << 8; + src |= src << 16; + break; + case 2: + src |= src << 12; + break; + case 3: + break; + } + switch (m_plane_enable) + { + case 1: // RGB/CI + case 2: // RGBA + case 6: // CID + return src; + case 4: // OLAY + return src << 8; + case 5: // PUP + return src << 2; + } + return src; +} + void rb2_device::set_write_mask(uint32_t data) { m_write_mask = data; @@ -794,6 +958,7 @@ void rb2_device::set_flags(uint16_t data) m_draw_depth = (data & 0x30) >> 4; m_logicop = data & 0xf; + static const uint32_t s_draw_bpp[4] = { 4, 8, 12, 24 }; static const uint32_t s_store_shift[8][4][2] = { { { 0, 0 }, // None, 4bpp, Buffer 0/1 { 0, 0 }, // None, 8bpp, Buffer 0/1 @@ -837,7 +1002,8 @@ void rb2_device::set_flags(uint16_t data) }, }; - m_store_shift = s_store_shift[m_plane_enable][m_draw_depth][m_dblsrc]; + m_src_shift = s_store_shift[m_plane_enable][m_draw_depth][m_dblsrc]; + m_draw_bpp = s_draw_bpp[m_draw_depth]; switch (m_plane_enable) { @@ -860,12 +1026,13 @@ void rb2_device::set_address(uint32_t address) uint32_t rb2_device::read_pixel() { - return *m_buf_ptr >> m_store_shift; + return *m_buf_ptr >> m_src_shift; } void rb2_device::write_pixel(uint32_t data) { - if (m_blend) + data = expand_to_all_lanes(data); + if (m_blend || m_fast_clear) store_pixel(data); else logic_pixel(data); @@ -900,7 +1067,7 @@ void rb2_device::store_pixel(uint32_t value) { const uint32_t write_mask = m_write_mask & m_global_mask; *m_buf_ptr &= ~write_mask; - *m_buf_ptr |= (value << m_store_shift) & write_mask; + *m_buf_ptr |= value & write_mask; } @@ -1087,15 +1254,24 @@ void newport_base_device::start_logging() popmessage("Recording Newport to %s", log_name_buf); - // TODO - //fwrite(&m_vc2, sizeof(vc2_t), 1, m_newview_log); - //fwrite(&m_xmap0, sizeof(xmap_t), 1, m_newview_log); - //fwrite(&m_xmap1, sizeof(xmap_t), 1, m_newview_log); + m_vc2->serialize(m_newview_log); + printf("vc2: %08x\n", (uint32_t)ftell(m_newview_log)); + m_xmap[0]->serialize(m_newview_log); + printf("xmap0: %08x\n", (uint32_t)ftell(m_newview_log)); + m_xmap[1]->serialize(m_newview_log); + printf("xmap1: %08x\n", (uint32_t)ftell(m_newview_log)); fwrite(&m_rex3, sizeof(rex3_t), 1, m_newview_log); - // TODO - //fwrite(&m_cmap0, sizeof(cmap_t), 1, m_newview_log); - //fwrite(&m_rgbci[0], sizeof(uint32_t), (1280+64)*(1024+64), m_newview_log); - //fwrite(&m_cidaux[0], sizeof(uint32_t), (1280+64)*(1024+64), m_newview_log); + printf("rex3: %08x\n", (uint32_t)ftell(m_newview_log)); + m_cmap[0]->serialize(m_newview_log); + printf("cmap0: %08x\n", (uint32_t)ftell(m_newview_log)); + m_cmap[1]->serialize(m_newview_log); + printf("cmap1: %08x\n", (uint32_t)ftell(m_newview_log)); + m_rb2->serialize(m_newview_log); + printf("rb2: %08x\n", (uint32_t)ftell(m_newview_log)); + fwrite(m_rb2->rgbci(0), sizeof(uint32_t), (1280+64)*(1024+64), m_newview_log); + printf("rgbci: %08x\n", (uint32_t)ftell(m_newview_log)); + fwrite(m_rb2->cidaux(0), sizeof(uint32_t), (1280+64)*(1024+64), m_newview_log); + printf("cidaux: %08x\n", (uint32_t)ftell(m_newview_log)); } void newport_base_device::stop_logging() @@ -1237,7 +1413,7 @@ uint32_t newport_base_device::screen_update(screen_device &device, bitmap_rgb32 break; case 2: // 8-Bit Overlay { - const uint32_t pix_in = ((*src_cidaux >> 8) & 0xf) | ((*src_cidaux >> 12) & 0xf0); + const uint32_t pix_in = ((*src_cidaux >> 8) & 0xf) | ((*src_cidaux >> 16) & 0xf0); if (pix_in) { *dest++ = palette[aux_msb | pix_in]; @@ -2003,6 +2179,23 @@ READ64_MEMBER(newport_base_device::rex3_r) do_rex3_command(); } +#if ENABLE_NEWVIEW_LOG + if (m_newview_log != nullptr) + { + uint32_t offset_lo = (uint32_t)offset | 0x40000000; + uint32_t data_hi = (uint32_t)(ret >> 32); + uint32_t data_lo = (uint32_t)ret; + uint32_t mem_mask_hi = (uint32_t)(mem_mask >> 32); + uint32_t mem_mask_lo = (uint32_t)mem_mask; + + fwrite(&offset_lo, sizeof(uint32_t), 1, m_newview_log); + fwrite(&data_hi, sizeof(uint32_t), 1, m_newview_log); + fwrite(&data_lo, sizeof(uint32_t), 1, m_newview_log); + fwrite(&mem_mask_hi, sizeof(uint32_t), 1, m_newview_log); + fwrite(&mem_mask_lo, sizeof(uint32_t), 1, m_newview_log); + } +#endif + return ret; } @@ -2179,7 +2372,10 @@ void newport_base_device::output_pixel(int16_t x, int16_t y, uint32_t color) const uint32_t address = (uint32_t)(y * (1280 + 64) + x); m_set_address(address); - m_write_pixel(color); + if (BIT(m_rex3.m_draw_mode1, 18)) + blend_pixel(color); + else + m_write_pixel(color); } void newport_base_device::blend_pixel(uint32_t src) @@ -2413,18 +2609,7 @@ uint32_t newport_base_device::get_rgb_color(int16_t x, int16_t y) if (!BIT(m_rex3.m_draw_mode1, 15)) // RGB { - switch (m_rex3.m_plane_depth) - { - case 0: // 4bpp - return (m_rex3.m_curr_color_red >> 11) & 0x0000000f; - case 1: // 8bpp - return (m_rex3.m_curr_color_red >> 11) & 0x000000ff; - case 2: // 12bpp - return (m_rex3.m_curr_color_red >> 9) & 0x00000fff; - case 3: // 24bpp - // Not supported - return 0; - } + return get_default_color(m_rex3.m_curr_color_red); } if (BIT(m_rex3.m_draw_mode1, 16)) // Dithering @@ -3074,6 +3259,37 @@ void newport_base_device::iterate_shade() } } +uint32_t newport_base_device::get_default_color(uint32_t src) +{ + uint32_t color = BIT(m_rex3.m_draw_mode1, 17) ? m_rex3.m_color_vram : src; + switch (m_rex3.m_plane_depth) + { + case 0: // 4bpp + color &= 0xf; + color |= color << 4; + color |= color << 8; + color |= color << 16; + break; + case 1: // 8bpp + color &= 0xff; + color |= color << 8; + color |= color << 16; + break; + case 2: // 12bpp + if (BIT(m_rex3.m_draw_mode1, 15)) + color = ((m_rex3.m_color_vram & 0xf00000) >> 12) | ((m_rex3.m_color_vram & 0xf000) >> 8) | ((m_rex3.m_color_vram & 0xf0) >> 4); + else + color &= 0x00000fff; + color |= color << 12; + break; + case 3: // 24bpp + color = m_rex3.m_color_vram & 0xffffff; + break; + } + + return color; +} + void newport_base_device::do_rex3_command() { static const char* const s_opcode_str[4] = { "Noop", "Read", "Draw", "Scr2Scr" }; @@ -3134,35 +3350,7 @@ void newport_base_device::do_rex3_command() LOGMASKED(LOG_COMMANDS, "%04x, %04x to %04x, %04x = %08x\n", start_x, start_y, end_x, end_y, pattern); - uint32_t color = m_rex3.m_color_i; - if (fastclear) - { - if (rgbmode) - { - switch (m_rex3.m_plane_depth) - { - case 0: // 4bpp - color = m_rex3.m_color_vram & 0xf; - color |= color << 4; - break; - case 1: // 8bpp - color = m_rex3.m_color_vram & 0xff; - break; - case 2: // 12bpp - color = ((m_rex3.m_color_vram & 0xf00000) >> 12) | ((m_rex3.m_color_vram & 0xf000) >> 8) | ((m_rex3.m_color_vram & 0xf0) >> 4); - color |= color << 12; - break; - case 3: // 24bpp - color = m_rex3.m_color_vram & 0xffffff; - break; - } - } - else - { - color = m_rex3.m_color_vram; - } - } - + uint32_t color = get_default_color(m_rex3.m_color_i); const bool lr_abort = BIT(mode0, 19) && dx < 0; uint32_t bit = 31; @@ -3232,35 +3420,7 @@ void newport_base_device::do_rex3_command() const bool fastclear = BIT(mode1, 17); const uint32_t pattern = BIT(mode0, 12) ? m_rex3.m_z_pattern : (BIT(mode0, 13) ? m_rex3.m_ls_pattern : 0xffffffff); - uint32_t color = m_rex3.m_color_i; - if (fastclear) - { - if (rgbmode) - { - switch (m_rex3.m_plane_depth) - { - case 0: // 4bpp - color = m_rex3.m_color_vram & 0xf; - color |= color << 4; - break; - case 1: // 8bpp - color = m_rex3.m_color_vram & 0xff; - break; - case 2: // 12bpp - color = ((m_rex3.m_color_vram & 0xf00000) >> 12) | ((m_rex3.m_color_vram & 0xf000) >> 8) | ((m_rex3.m_color_vram & 0xf0) >> 4); - color |= color << 12; - break; - case 3: // 24bpp - color = m_rex3.m_color_vram & 0xffffff; - break; - } - } - else - { - color = m_rex3.m_color_vram; - } - } - + uint32_t color = get_default_color(m_rex3.m_color_i); const bool lr_abort = BIT(mode0, 19) && dx < 0; do @@ -3309,15 +3469,15 @@ void newport_base_device::do_rex3_command() } case 2: // I_Line - do_iline(m_rex3.m_color_i); + do_iline(get_default_color(m_rex3.m_color_i)); break; case 3: // F_Line - do_fline(m_rex3.m_color_i); + do_fline(get_default_color(m_rex3.m_color_i)); break; case 4: // A_Line - do_iline(m_rex3.m_color_i); // FIXME + do_iline(get_default_color(m_rex3.m_color_i)); // FIXME break; default: // Invalid diff --git a/src/devices/bus/gio64/newport.h b/src/devices/bus/gio64/newport.h index 01474391b85..d1166030a3a 100644 --- a/src/devices/bus/gio64/newport.h +++ b/src/devices/bus/gio64/newport.h @@ -45,6 +45,9 @@ public: uint32_t mode_entry(uint32_t entry) const { return m_mode_table[entry]; } bool is_8bpp() const { return BIT(m_config, 2); } + void serialize(FILE *file); + void deserialize(FILE *file); + private: // device_t overrides virtual void device_start() override; @@ -90,6 +93,9 @@ public: // Getters const uint32_t *palette_base() const { return m_palette; } + void serialize(FILE *file); + void deserialize(FILE *file); + private: // device_t overrides virtual void device_start() override; @@ -138,6 +144,9 @@ public: auto vert_int() { return m_vert_int.bind(); } auto screen_timing_changed() { return m_screen_timing_changed.bind(); } // Hack. TODO: Figure out a better way + void serialize(FILE *file); + void deserialize(FILE *file); + private: // device_t overrides virtual void device_start() override; @@ -223,6 +232,7 @@ public: // Getters const uint32_t *rgbci(int y) const { return &m_rgbci[1344 * y]; } const uint32_t *cidaux(int y) const { return &m_cidaux[1344 * y]; } + uint32_t store_shift() { return m_src_shift; } // devcb callbacks void set_write_mask(uint32_t data); @@ -231,6 +241,9 @@ public: uint32_t read_pixel(); void write_pixel(uint32_t data); + void serialize(FILE *file); + void deserialize(FILE *file); + private: // device_t overrides virtual void device_start() override; @@ -238,6 +251,7 @@ private: void logic_pixel(uint32_t src); void store_pixel(uint32_t value); + uint32_t expand_to_all_lanes(uint32_t src); void set_global_mask(uint32_t global_mask) { m_global_mask = global_mask; } @@ -249,8 +263,10 @@ private: bool m_dblsrc; uint8_t m_plane_enable; uint8_t m_draw_depth; + uint32_t m_draw_bpp; uint8_t m_logicop; - uint8_t m_store_shift; + uint8_t m_src_shift; + uint8_t m_dst_shift; uint32_t *m_dest_buf; uint32_t *m_buf_ptr; @@ -293,6 +309,9 @@ public: auto pixel_write() { return m_write_pixel.bind(); } auto pixel_read() { return m_read_pixel.bind(); } + void serialize(FILE *file); + void deserialize(FILE *file); + protected: // device_t overrides virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; @@ -439,6 +458,7 @@ protected: void iterate_shade(); + uint32_t get_default_color(uint32_t src); uint32_t get_host_color(); uint32_t get_rgb_color(int16_t x, int16_t y); From fa04284a8899a7482c35cbc58a1cf9e6aa1a23b1 Mon Sep 17 00:00:00 2001 From: algestam Date: Thu, 29 Aug 2019 19:53:55 +0200 Subject: [PATCH 3/7] hh_sm510: Melody ROM fixes for gnw_mbaway melody --- src/mame/drivers/hh_sm510.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index b6ae3631753..f9c2eb3ed9a 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -3731,7 +3731,7 @@ ROM_START( gnw_mbaway ) ROM_LOAD( "tb-94.program", 0x0000, 0x1000, CRC(11d18a48) SHA1(afccfa19dace7c4fcc15a84ecfcfb9d7ae3861e4) ) ROM_REGION( 0x100, "maincpu:melody", 0 ) - ROM_LOAD( "tb-94.melody", 0x000, 0x100, BAD_DUMP CRC(6179e627) SHA1(e0bc8a7b2a1044f1437b0e06391102e403c11e1f) ) // decap needed for verification + ROM_LOAD( "tb-94.melody", 0x000, 0x100, BAD_DUMP CRC(883931c2) SHA1(9ad22bde42a67c42d117f3ffa81a23c3c9044e66) ) // decap needed for verification ROM_REGION( 514643, "screen", 0) ROM_LOAD( "gnw_mbaway.svg", 0, 514643, CRC(2ec2f18b) SHA1(8e2fd20615d867aac97e443fb977513ff98138b4) ) From 350cd896d891e46a3258a7a93f3b005f205c8a93 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 1 Sep 2019 16:16:18 +1000 Subject: [PATCH 4/7] botched software list titles (nw) --- hash/spectrum_cass.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hash/spectrum_cass.xml b/hash/spectrum_cass.xml index 56b99aeb642..88ad101285f 100644 --- a/hash/spectrum_cass.xml +++ b/hash/spectrum_cass.xml @@ -18320,7 +18320,7 @@ - >Aliens Neoplasma (set 1, v1.2, English) + Aliens Neoplasma (set 1, v1.2, English) 2019 Sanchez crew @@ -18331,7 +18331,7 @@ - >Aliens Neoplasma (set 2, v1.2, English, Turbo Sound) + Aliens Neoplasma (set 2, v1.2, English, Turbo Sound) 2019 Sanchez crew @@ -18342,7 +18342,7 @@ - >Aliens Neoplasma (set 3, v1.2, Spanish) + Aliens Neoplasma (set 3, v1.2, Spanish) 2019 Sanchez crew @@ -18353,7 +18353,7 @@ - >Aliens Neoplasma (set 4, v1.2, Spanish, Turbo Soudn) + Aliens Neoplasma (set 4, v1.2, Spanish, Turbo Soudn) 2019 Sanchez crew @@ -18364,7 +18364,7 @@ - >Aliens Neoplasma (set 5, v1.2, Russian) + Aliens Neoplasma (set 5, v1.2, Russian) 2019 Sanchez crew @@ -18375,7 +18375,7 @@ - >Aliens Neoplasma (set 6, v1.2, Russian, Turbo Sound) + Aliens Neoplasma (set 6, v1.2, Russian, Turbo Sound) 2019 Sanchez crew @@ -90476,7 +90476,7 @@ - Lost In My Spectrum - (set 25, v1.0, Italian, 128k) + Lost In My Spectrum (set 25, v1.0, Italian, 128k) 2012 Alessandro Grussu From 9e880f57f6b1cdce03a4f232ad7d80faf7ee498f Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 2 Sep 2019 02:16:49 +1000 Subject: [PATCH 5/7] srcclean (nw) --- src/devices/bus/gio64/newport.cpp | 80 +++++++++++++++---------------- src/devices/bus/gio64/newport.h | 2 +- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/devices/bus/gio64/newport.cpp b/src/devices/bus/gio64/newport.cpp index e7d7dfdea81..7a9cb985036 100644 --- a/src/devices/bus/gio64/newport.cpp +++ b/src/devices/bus/gio64/newport.cpp @@ -913,34 +913,34 @@ void rb2_device::deserialize(FILE *file) uint32_t rb2_device::expand_to_all_lanes(uint32_t src) { - switch (m_draw_depth) { - case 0: - src |= src << 4; - src |= src << 8; - src |= src << 16; - break; - case 1: - src |= src << 8; - src |= src << 16; - break; - case 2: - src |= src << 12; - break; - case 3: - break; - } - switch (m_plane_enable) - { - case 1: // RGB/CI - case 2: // RGBA - case 6: // CID - return src; - case 4: // OLAY - return src << 8; - case 5: // PUP - return src << 2; - } - return src; + switch (m_draw_depth) { + case 0: + src |= src << 4; + src |= src << 8; + src |= src << 16; + break; + case 1: + src |= src << 8; + src |= src << 16; + break; + case 2: + src |= src << 12; + break; + case 3: + break; + } + switch (m_plane_enable) + { + case 1: // RGB/CI + case 2: // RGBA + case 6: // CID + return src; + case 4: // OLAY + return src << 8; + case 5: // PUP + return src << 2; + } + return src; } void rb2_device::set_write_mask(uint32_t data) @@ -2372,10 +2372,10 @@ void newport_base_device::output_pixel(int16_t x, int16_t y, uint32_t color) const uint32_t address = (uint32_t)(y * (1280 + 64) + x); m_set_address(address); - if (BIT(m_rex3.m_draw_mode1, 18)) - blend_pixel(color); - else - m_write_pixel(color); + if (BIT(m_rex3.m_draw_mode1, 18)) + blend_pixel(color); + else + m_write_pixel(color); } void newport_base_device::blend_pixel(uint32_t src) @@ -3267,27 +3267,27 @@ uint32_t newport_base_device::get_default_color(uint32_t src) case 0: // 4bpp color &= 0xf; color |= color << 4; - color |= color << 8; - color |= color << 16; + color |= color << 8; + color |= color << 16; break; case 1: // 8bpp color &= 0xff; - color |= color << 8; - color |= color << 16; + color |= color << 8; + color |= color << 16; break; case 2: // 12bpp if (BIT(m_rex3.m_draw_mode1, 15)) color = ((m_rex3.m_color_vram & 0xf00000) >> 12) | ((m_rex3.m_color_vram & 0xf000) >> 8) | ((m_rex3.m_color_vram & 0xf0) >> 4); - else - color &= 0x00000fff; - color |= color << 12; + else + color &= 0x00000fff; + color |= color << 12; break; case 3: // 24bpp color = m_rex3.m_color_vram & 0xffffff; break; } - return color; + return color; } void newport_base_device::do_rex3_command() diff --git a/src/devices/bus/gio64/newport.h b/src/devices/bus/gio64/newport.h index d1166030a3a..49e0af4e937 100644 --- a/src/devices/bus/gio64/newport.h +++ b/src/devices/bus/gio64/newport.h @@ -458,7 +458,7 @@ protected: void iterate_shade(); - uint32_t get_default_color(uint32_t src); + uint32_t get_default_color(uint32_t src); uint32_t get_host_color(); uint32_t get_rgb_color(int16_t x, int16_t y); From c7937dbe372d9fbd3c58e31ae65e807991d419e8 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 2 Sep 2019 02:29:22 +1000 Subject: [PATCH 6/7] Revert "Update sdk85.cpp (#5427)" This reverts commit 8e10e88e1b442fa75ca92fc2f6a35c2004253ecf. --- src/mame/drivers/sdk85.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/mame/drivers/sdk85.cpp b/src/mame/drivers/sdk85.cpp index ef21b9bdbf4..2eeff6a9a4e 100644 --- a/src/mame/drivers/sdk85.cpp +++ b/src/mame/drivers/sdk85.cpp @@ -35,15 +35,6 @@ On the right you'll get a "clue", slightly different than on the standard game ( Once you find the number, you'll see it flashing. Press the 2 key and you'll get your score (number of attempts before guessing). Press 0 to restart. -Notes on expansion rom with default content Mastermind. -Original authors: see above (Paolo Forlani and Stefano Bodrato) -Ported to option rom: NASZVADI Peter - -The game can be started from monitor by defining SP as 20FFh and PC as 0800h and starting execution. -When setting register values in monitor, SPH, SPL, PCH and PCL values must be set to 20, FF, 08, 00 respectively before start! -Stefano's bios had been altered in order to use lower ram bank and the option rom slot. -When selecting "Empty" a14, which is basically 2kbytes of zeros, the default option rom will be launched directly. - *************************************************************************************************************************************/ #include "emu.h" @@ -193,11 +184,8 @@ ROM_START( sdk85 ) ROMX_LOAD( "sdk85.a14", 0x0000, 0x0800, CRC(9d5a983f) SHA1(54e218560fbec009ac3de5cfb64b920241ef2eeb), ROM_BIOS(0) ) ROM_SYSTEM_BIOS(1, "mastermind", "Mastermind") ROMX_LOAD( "mastermind.a14", 0x0000, 0x0800, CRC(36b694ae) SHA1(4d8a5ae5d10e8f72a6e349c7eeaf1aa00c4e45e1), ROM_BIOS(1) ) - ROM_SYSTEM_BIOS(2, "empty", "Empty") - ROMX_LOAD( "empty.a14", 0x0000, 0x0800, CRC(f1e8ba9e) SHA1(605db3fdbaff4ba13729371ad0c4fbab3889378e), ROM_BIOS(2) ) ROM_REGION( 0x800, "expromio", ROMREGION_ERASEFF ) - ROM_LOAD_OPTIONAL( "mastermind.a15", 0x0000, 0x0800, CRC(0538e162) SHA1(c351975e2cf515cee29fcaeb04ef47189afe5250) ) ROM_END /* Driver */ From 4ebd9f8337633ca03622c897183efe4b8808a334 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 2 Sep 2019 21:28:18 +1000 Subject: [PATCH 7/7] Remove Aliens: Neoplasma This game is less than a year old, and the developers have released it behind a, "How much would you like to donate?" barrier. The tape versions are playable in a browser as a demonstration, but to download any tape or disk version, you must confirm the donation prompt. The TurboSound versions and disk versions are not even available as a demo without passing the donation confirmation. I'd rather people be encouraged to obtain this game from the official sources. Even if the conversion rate of demo plays to non-zero donations is small, it's the principle of it. The three-year rule should be applied even-handedly. --- hash/spectrum_betadisc_flop.xml | 66 --------------------------------- hash/spectrum_cass.xml | 66 --------------------------------- 2 files changed, 132 deletions(-) diff --git a/hash/spectrum_betadisc_flop.xml b/hash/spectrum_betadisc_flop.xml index ddcfce52fb7..ef23464ef5e 100644 --- a/hash/spectrum_betadisc_flop.xml +++ b/hash/spectrum_betadisc_flop.xml @@ -155,72 +155,6 @@ - - Aliens Neoplasma (set 1, v1.2, English) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 2, v1.2, English, Turbo Sound) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 3, v1.2, Spanish) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 4, v1.2, Spanish, Turbo Sound) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 5, v1.2, Russian) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 6, v1.2, Russian, Turbo Sound) - 2019 - Sanchez crew - - - - - - - Redshift 19?? diff --git a/hash/spectrum_cass.xml b/hash/spectrum_cass.xml index 88ad101285f..703468a696f 100644 --- a/hash/spectrum_cass.xml +++ b/hash/spectrum_cass.xml @@ -18319,72 +18319,6 @@ - - Aliens Neoplasma (set 1, v1.2, English) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 2, v1.2, English, Turbo Sound) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 3, v1.2, Spanish) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 4, v1.2, Spanish, Turbo Soudn) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 5, v1.2, Russian) - 2019 - Sanchez crew - - - - - - - - - Aliens Neoplasma (set 6, v1.2, Russian, Turbo Sound) - 2019 - Sanchez crew - - - - - - - Nominas (Investronica) 1984