From 631a761abab2a8dbdfc4d4c36187b465d5655004 Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 9 Mar 2025 18:57:21 +0100 Subject: [PATCH] nec/pc88va_sgp.cpp: add RGB565 ROPs nec/pc88va_v.cpp: use DSA in draw_packed_gfx_4bpp, halve pitch for draw_direct_gfx_rgb565 hash/pc88va.xml: update QA, and use saner defaults where applicable --- hash/pc88va.xml | 111 +++++++++++++++++------------------- src/mame/nec/pc88va.h | 2 +- src/mame/nec/pc88va_sgp.cpp | 29 ++++++++-- src/mame/nec/pc88va_v.cpp | 22 ++++--- 4 files changed, 91 insertions(+), 73 deletions(-) diff --git a/hash/pc88va.xml b/hash/pc88va.xml index 817dcb0ef7e..6bca5f5d7a2 100644 --- a/hash/pc88va.xml +++ b/hash/pc88va.xml @@ -90,8 +90,8 @@ Operating Systems 19?? NEC @@ -110,10 +110,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] 19?? NEC @@ -128,10 +125,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] 19?? NEC @@ -150,6 +144,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] + @@ -175,6 +170,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] + @@ -196,8 +192,8 @@ Transition between 3rd and 4th sequences don't look right, [IDP] 1989 Music Network @@ -214,9 +210,13 @@ Has unsupported MIF-201 [MIDI] interface cfr. http://www.pc88.gr.jp/vafaq/view.p NEC + @@ -230,11 +230,10 @@ Untested directory NEC_SAMP (cannot type [keyboard] underscore char) 1988 NEC - + + @@ -290,7 +289,6 @@ Lists dual port 1/2 as a unsupported [DE-9] input method Winning newspaper screen has [OFX/OFY] bug How to exit from attract mode once you enter it? ]]> - @@ -349,7 +347,7 @@ Winning newspaper screen has [OFX/OFY] bug 198? スタークラフト (Starcraft) @@ -383,6 +381,7 @@ Currently conceals/wipes out [GVRAM] display + @@ -418,7 +417,7 @@ Burps on [FDC] access after disk swap with program and player disks, trying to s 1987 ウインキーソフト (Winky Soft) 1987 ウインキーソフト (Winky Soft) @@ -524,9 +520,9 @@ Needs graphic [OFX/OFY] scroll 198? スタークラフト (Starcraft) + @@ -557,11 +553,11 @@ Burps on [FDC] access after disk swap with program and player disks, trying to s システムソフト (System Soft) + @@ -576,7 +572,7 @@ Winning animation is glitchy [OFX/OFY]?, uses [IDP] text transpen with upper bit 日本テレネット (Nihon Telenet) @@ -872,8 +868,7 @@ Has unemulated [MIDI] options 1990 マイクロキャビン (Micro Cabin) @@ -907,10 +902,8 @@ Optionally wants kana lock enabled for entering a name for new game [keyboard] i 1991 マイクロキャビン (Micro Cabin) @@ -947,29 +940,29 @@ Ugly pitch for [OPNA] voice samples on intro - + Abunai Tengu Densetsu 1989 アリスソフト (Alicesoft) - + - + - + - + @@ -986,22 +979,23 @@ Loads N88 BASIC then jumps to lalaland [FDC] 1989 アリスソフト (Alicesoft) + - + - + - + - + @@ -1018,22 +1012,22 @@ Loads N88 BASIC then jumps to lalaland [FDC] 1989 アリスソフト (Alicesoft) - + - + - + - + @@ -1154,22 +1148,23 @@ Loads N88 BASIC then jumps to lalaland [FDC] 1989 アリスソフト (Alicesoft) - + - + - + - + @@ -1248,10 +1243,9 @@ All disks fail initial bootstrap [FDC] 1996 <doujin> @@ -1522,8 +1516,7 @@ https://youtu.be/zxy8lTZ_w_k 2023 Inufuto diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index 3d5bab01733..d8a656d6b57 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -264,7 +264,7 @@ private: void draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u8 pal_base); void draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height); - void draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height); + void draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 fb_width, u16 fb_height); void draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height); void draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height); diff --git a/src/mame/nec/pc88va_sgp.cpp b/src/mame/nec/pc88va_sgp.cpp index 24e155361b2..b70860358a7 100644 --- a/src/mame/nec/pc88va_sgp.cpp +++ b/src/mame/nec/pc88va_sgp.cpp @@ -21,10 +21,10 @@ TODO: #include "emu.h" #include "pc88va_sgp.h" -//#include - #define LOG_COMMAND (1U << 1) +//#include + #define VERBOSE (LOG_GENERAL) //#define LOG_OUTPUT_STREAM std::cout @@ -420,9 +420,12 @@ void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) return; } - if (m_src.pixel_mode == 0 || m_src.pixel_mode == 3 || m_src.pixel_mode != m_dst.pixel_mode) + // TODO: pceva2tb:SKYBD.BAT wants a 1bpp to 4bpp translation + if (m_src.pixel_mode == 0 || m_src.pixel_mode != m_dst.pixel_mode) { - LOG("SGP: Warning BITBLT pixel mode %d x %d\n", m_src.pixel_mode, m_dst.pixel_mode); + static const char *const pixel_mode[] = { "1bpp", "4bpp", "8bpp", "rgb565" }; + + LOG("SGP: Warning BITBLT pixel mode src %s against dst %s\n", pixel_mode[m_src.pixel_mode], pixel_mode[m_dst.pixel_mode]); return; } @@ -472,6 +475,24 @@ void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) break; } + + // RGB565 (ballbrkr title) + case 3: + { + const u32 dst_offset = dst_address + ((xi + m_dst.start_dot) << 1); + + u16 src = m_data->read_word(src_address + (xi << 1)) & 0xffff; + u16 dst = m_data->read_word(dst_offset) & 0xffff; + u16 result = dst; + + if ((this->*tpmod_table[tp_mod])(src, dst)) + { + result = (this->*rop_table[logical_op])(src, dst); + m_data->write_word(dst_offset, result); + } + + break; + } } } } diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index 52c2b7ee878..e45c2745c62 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -4,8 +4,6 @@ #include "emu.h" #include "pc88va.h" -//#include - #define LOG_IDP (1U << 1) // TSP data #define LOG_FB (1U << 2) // framebuffer strips (verbose) @@ -14,6 +12,8 @@ #define LOG_COLOR (1U << 5) // current color mode #define LOG_TEXT (1U << 6) // text strips (verbose) +//#include + #define VERBOSE (LOG_GENERAL | LOG_IDP) //#define LOG_OUTPUT_STREAM std::cout @@ -29,11 +29,11 @@ void pc88va_state::video_start() { const u32 gvram_size = 0x40000; - m_gvram = std::make_unique(gvram_size); + m_gvram = make_unique_clear(gvram_size); std::fill_n(m_gvram.get(), gvram_size, 0); const u32 kanjiram_size = 0x4000; - m_kanji_ram = std::make_unique(kanjiram_size); + m_kanji_ram = make_unique_clear(kanjiram_size); m_gfxdecode->gfx(2)->set_source(m_kanji_ram.get()); m_gfxdecode->gfx(3)->set_source(m_kanji_ram.get()); m_vrtc_irq_line = 432; @@ -55,6 +55,7 @@ void pc88va_state::video_start() save_item(NAME(m_vrtc_irq_line)); } +// TODO: all needs to be verified void pc88va_state::video_reset() { m_gden0 = false; @@ -63,6 +64,7 @@ void pc88va_state::video_reset() m_color_mode = 0; m_pltm = 0; m_pltp = 0; + m_video_pri_reg[0] = m_video_pri_reg[1] = 0; } void pc88va_state::palette_init(palette_device &palette) const @@ -810,7 +812,7 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli draw_packed_gfx_5bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, layer_pal_bank, fbw, fbl); } else - draw_direct_gfx_8bpp(m_graphic_bitmap[which], split_cliprect, fsa, fbw, fbl); + draw_direct_gfx_8bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, fbw, fbl); break; case 3: draw_direct_gfx_rgb565(m_graphic_bitmap[which], split_cliprect, fsa, fbw, fbl); break; default: @@ -902,7 +904,7 @@ void pc88va_state::draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &c } } -void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height) +void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 fb_width, u16 fb_height) { // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); @@ -913,7 +915,7 @@ void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &c for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { - u32 bitmap_offset = line_offset + x; + u32 bitmap_offset = (line_offset + x) & 0x3ffff; uint32_t color = (m_gvram[bitmap_offset] & 0xff); @@ -937,7 +939,8 @@ void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - const u32 line_offset = ((y * fb_width) + fb_start_offset) & 0x3ffff; + // pc88vad requires halved pitch for first screen + const u32 line_offset = ((y * fb_width >> 1) + fb_start_offset) & 0x3ffff; for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { @@ -956,6 +959,7 @@ void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle } } +// famista, probably all inufuto games void pc88va_state::draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height) { // const u16 y_min = std::max(cliprect.min_y, y_start); @@ -968,7 +972,7 @@ void pc88va_state::draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &c for(int x = cliprect.min_x; x <= cliprect.max_x; x += 8) { u16 x_char = (x >> 3); - u32 bitmap_offset = line_offset + x_char; + u32 bitmap_offset = (line_offset + x_char + (display_start_offset >> 2)) & 0x0ffff; for (int xi = 0; xi < 8; xi ++) {