diff options
author | David Haywood <28625134+DavidHaywood@users.noreply.github.com> | 2020-10-06 16:36:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-06 11:36:39 -0400 |
commit | e9d9d518f25113c2a5cf236bd35161d655994e71 (patch) | |
tree | 665e9d408fe6b2e56b2627d026af9f8a8f9690f3 /src/devices/video | |
parent | 0cf5ca4ebaedbaa1a0dda513433c2e7fc5624408 (diff) |
Plug and Play work (new sets) (#7321)
new WORKING machines
----------------------------
101 Games in 1 (Senario) [David Haywood, Sean Riddle, Kev (FBN), Kamaal Brown]
Vs Maxx TX-2 50-in-1 [David Haywood, Sean Riddle, Kev (FBN), Kamaal Brown]
Vs Maxx Wireless 77-in-1 [David Haywood, Sean Riddle, Kev (FBN), Kamaal Brown]
Vs Maxx Video Extreme 50-in-1 (with Speed Racer and Snood) [David Haywood, Sean Riddle, Kev (FBN), Kamaal Brown]
VG Pocket Caplet Fast Acting 35-in-1 [David Haywood, Sean Riddle, Kev (FBN), Kamaal Brown]
new NOT WORKING machines
---------------------------------
Beijue 16 Bit Handheld Games (Game Boy style case) [David Haywood, Sean Riddle, Kev (FBN), Kamaal Brown]
Space Invaders (Tiny Arcade) [Rik]
Vs Maxx 25-in-1 [David Haywood, Sean Riddle, Kev (FBN), Kamaal Brown]
Vs Maxx 15-in-1 [David Haywood, Sean Riddle, Kev (FBN), Kamaal Brown]
Zippity (US) [David Haywood, Sean Riddle, Kev (FBN), Kamaal Brown]
Diffstat (limited to 'src/devices/video')
-rw-r--r-- | src/devices/video/ppu2c0x.cpp | 15 | ||||
-rw-r--r-- | src/devices/video/ppu2c0x_sh6578.cpp | 36 | ||||
-rw-r--r-- | src/devices/video/ppu2c0x_vt.cpp | 13 |
3 files changed, 43 insertions, 21 deletions
diff --git a/src/devices/video/ppu2c0x.cpp b/src/devices/video/ppu2c0x.cpp index 82036c4c8c0..d769ff54162 100644 --- a/src/devices/video/ppu2c0x.cpp +++ b/src/devices/video/ppu2c0x.cpp @@ -622,11 +622,6 @@ void ppu2c0x_device::draw_background(uint8_t* line_priority) { bitmap_rgb32& bitmap = *m_bitmap; - uint16_t palval = m_back_color; - - /* cache the background pen */ - uint32_t back_pen = palval; - /* determine where in the nametable to start drawing from */ /* based on the current scanline and scroll regs */ uint8_t scroll_x_coarse = m_refresh_data & 0x001f; @@ -680,7 +675,7 @@ void ppu2c0x_device::draw_background(uint8_t* line_priority) // plus something that accounts for y address += scroll_y_fine; - draw_tile(line_priority, color_byte, color_bits, address, start_x, back_pen, dest); + draw_tile(line_priority, color_byte, color_bits, address, start_x, m_back_color, dest); start_x += 8; @@ -701,7 +696,7 @@ void ppu2c0x_device::draw_background(uint8_t* line_priority) dest = &bitmap.pix(m_scanline); for (int i = 0; i < 8; i++) { - draw_back_pen(dest, back_pen); + draw_back_pen(dest, m_back_color); dest++; line_priority[i] ^= 0x02; @@ -720,14 +715,10 @@ void ppu2c0x_device::draw_background_pen() /* setup the color mask and colortable to use */ uint8_t color_mask = (m_regs[PPU_CONTROL1] & PPU_CONTROL1_DISPLAY_MONO) ? 0x30 : 0x3f; - uint16_t palval = m_back_color & color_mask; - - /* cache the background pen */ - uint32_t back_pen = palval; // Fill this scanline with the background pen. for (int i = 0; i < bitmap.width(); i++) - draw_back_pen(&bitmap.pix(m_scanline, i), back_pen); + draw_back_pen(&bitmap.pix(m_scanline, i), m_back_color & color_mask); } void ppu2c0x_device::read_sprite_plane_data(int address) diff --git a/src/devices/video/ppu2c0x_sh6578.cpp b/src/devices/video/ppu2c0x_sh6578.cpp index dac397f5778..a63fa2a5162 100644 --- a/src/devices/video/ppu2c0x_sh6578.cpp +++ b/src/devices/video/ppu2c0x_sh6578.cpp @@ -99,15 +99,25 @@ void ppu_sh6578_device::read_tile_plane_data(int address, int color) m_planebuf[0] = readbyte(address); m_planebuf[1] = readbyte(address + 8); - m_extplanebuf[0] = readbyte(address + 16); - m_extplanebuf[1] = readbyte(address + 24); + if (m_colsel_pntstart & 0x80) + { + m_extplanebuf[0] = readbyte(address + 16); + m_extplanebuf[1] = readbyte(address + 24); + } } void ppu_sh6578_device::draw_tile(uint8_t* line_priority, int color_byte, int color_bits, int address, int start_x, uint32_t back_pen, uint32_t*& dest) { int color = color_byte; - color &= 0xc; + if (m_colsel_pntstart & 0x80) + { + color &= 0xc; + } + else + { + color &= 0xf; + } read_tile_plane_data(address, color); @@ -118,19 +128,29 @@ void ppu_sh6578_device::draw_tile(uint8_t* line_priority, int color_byte, int co pix = ((m_planebuf[0] & 0x80) >> 7); pix |= ((m_planebuf[1] & 0x80) >> 6); - pix |= ((m_extplanebuf[0] & 0x80) >> 5); - pix |= ((m_extplanebuf[1] & 0x80) >> 4); + + if (m_colsel_pntstart & 0x80) + { + pix |= ((m_extplanebuf[0] & 0x80) >> 5); + pix |= ((m_extplanebuf[1] & 0x80) >> 4); + } m_planebuf[0] <<= 1; m_planebuf[1] <<= 1; - m_extplanebuf[0] <<= 1; - m_extplanebuf[1] <<= 1; + + if (m_colsel_pntstart & 0x80) + { + m_extplanebuf[0] <<= 1; + m_extplanebuf[1] <<= 1; + } if ((start_x + i) >= 0 && (start_x + i) < VISIBLE_SCREEN_WIDTH) { pen_t pen; - uint8_t palval = m_palette_ram[(pix | color << 2)] & 0x3f; + uint8_t palval; + + palval = m_palette_ram[(pix | color << 2)] & 0x3f; bool trans = false; if ((palval & 0x1f) == 0x1f) diff --git a/src/devices/video/ppu2c0x_vt.cpp b/src/devices/video/ppu2c0x_vt.cpp index ad1439a90e1..2b8b9b6e3dd 100644 --- a/src/devices/video/ppu2c0x_vt.cpp +++ b/src/devices/video/ppu2c0x_vt.cpp @@ -435,7 +435,18 @@ void ppu_vt03_device::shift_tile_plane_data(uint8_t& pix) void ppu_vt03_device::draw_back_pen(uint32_t* dst, int back_pen) { - draw_tile_pixel_inner(back_pen, dst); + if (m_201x_regs[0] & 0x80) + { + // is the back_pen always just pen 0 in VT modes? (using last data written to a transparent pen as per NES logic doesn't work as writes are split across 2 bytes) + draw_tile_pixel_inner(0, dst); + } + else + { + // in normal modes we still have the data from the palette writes as the 'backpen' so treat it as before + uint32_t pix; + pix = m_nespens[back_pen & 0x1ff]; + *dst = pix; + } } |