cleanup for cherry-picking (nw)

This commit is contained in:
Vas Crabb 2019-04-22 09:22:33 +10:00
parent 95aa67b728
commit 62cb3a78d2
4 changed files with 68 additions and 69 deletions

View File

@ -470,7 +470,6 @@ void cgc7900_state::cgc7900(machine_config &config)
m_maincpu->set_addrmap(AS_PROGRAM, &cgc7900_state::cgc7900_mem);
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &cgc7900_state::cpu_space_map);
i8035_device &kbmcu(I8035(config, I8035_TAG, 1000000));
kbmcu.set_addrmap(AS_PROGRAM, &cgc7900_state::keyboard_mem);
kbmcu.set_disable();

View File

@ -2925,7 +2925,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(lufykzku_state::lufykzku_irq)
else if (scanline == 128)
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_timer0_vector); // Z80
else if ((scanline % 8) == 0)
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_timer1_vector); // Z*) - this needs to be called often or the state of the door is not read at boot (at least 5 times before bb9 is called)
m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_timer1_vector); // Z80 - this needs to be called often or the state of the door is not read at boot (at least 5 times before bb9 is called)
}
void lufykzku_state::lufykzku(machine_config &config)

View File

@ -363,9 +363,9 @@ uint32_t newport_video_device::screen_update(screen_device &device, bitmap_rgb32
{
const uint8_t shift = BIT(table_entry, 0) ? 4 : 0;
const uint8_t pix_in = *src_ci >> shift;
const uint8_t r = 0xff * BIT(pix_in, 3);
const uint8_t g = (0xaa * BIT(pix_in, 2)) | (0x55 * BIT(pix_in, 1));
const uint8_t b = 0xff * BIT(pix_in, 0);
const uint8_t r = 0xff * BIT(pix_in, 3);
const uint8_t g = (0xaa * BIT(pix_in, 2)) | (0x55 * BIT(pix_in, 1));
const uint8_t b = 0xff * BIT(pix_in, 0);
*dest++ = (r << 16) | (g << 8) | b;
break;
}
@ -1469,81 +1469,81 @@ void newport_video_device::write_pixel(int16_t x, int16_t y, uint8_t color)
uint8_t newport_video_device::get_shade_color(int16_t x, int16_t y)
{
static const uint8_t s_bayer[4][4] = { { 0, 12, 3, 15 },{ 8, 4, 11, 7 },{ 2, 14, 1, 13 },{ 10, 6, 9, 5 } };
static const uint8_t s_bayer[4][4] = { { 0, 12, 3, 15 },{ 8, 4, 11, 7 },{ 2, 14, 1, 13 },{ 10, 6, 9, 5 } };
const uint8_t red = (uint8_t)(m_rex3.m_color_red >> 11);
const uint8_t green = (uint8_t)(m_rex3.m_color_green >> 11);
const uint8_t blue = (uint8_t)(m_rex3.m_color_blue >> 11);
const uint8_t red = (uint8_t)(m_rex3.m_color_red >> 11);
const uint8_t green = (uint8_t)(m_rex3.m_color_green >> 11);
const uint8_t blue = (uint8_t)(m_rex3.m_color_blue >> 11);
if (!BIT(m_rex3.m_draw_mode1, 15)) // RGB
{
return red;
}
if (!BIT(m_rex3.m_draw_mode1, 15)) // RGB
{
return red;
}
if (BIT(m_rex3.m_draw_mode1, 16)) // Dithering
{
switch ((m_rex3.m_draw_mode1 >> 3) & 3)
{
case 0: // 4bpp
{
const uint8_t sr = (red >> 3) - (red >> 4);
const uint8_t sg = (green >> 2) - (green >> 4);
const uint8_t sb = (blue >> 3) - (blue >> 4);
if (BIT(m_rex3.m_draw_mode1, 16)) // Dithering
{
switch ((m_rex3.m_draw_mode1 >> 3) & 3)
{
case 0: // 4bpp
{
const uint8_t sr = (red >> 3) - (red >> 4);
const uint8_t sg = (green >> 2) - (green >> 4);
const uint8_t sb = (blue >> 3) - (blue >> 4);
uint8_t dr = BIT(sr, 4);
uint8_t dg = (sg >> 4) & 3;
uint8_t db = BIT(sb, 4);
uint8_t dr = BIT(sr, 4);
uint8_t dg = (sg >> 4) & 3;
uint8_t db = BIT(sb, 4);
if ((sr & 0xf) > s_bayer[x & 3][y & 3]) dr++;
if ((sg & 0xf) > s_bayer[x & 3][y & 3]) dg++;
if ((sb & 0xf) > s_bayer[x & 3][y & 3]) db++;
if ((sr & 0xf) > s_bayer[x & 3][y & 3]) dr++;
if ((sg & 0xf) > s_bayer[x & 3][y & 3]) dg++;
if ((sb & 0xf) > s_bayer[x & 3][y & 3]) db++;
if (dr > 1) dr = 1;
if (dg > 3) dg = 3;
if (db > 1) db = 1;
if (dr > 1) dr = 1;
if (dg > 3) dg = 3;
if (db > 1) db = 1;
return (dr << 3) | (dg << 1) | db;
}
case 1: // 8bpp
{
const uint8_t sr = (red >> 1) - (red >> 4);
const uint8_t sg = (green >> 1) - (green >> 4);
const uint8_t sb = (blue >> 2) - (blue >> 4);
return (dr << 3) | (dg << 1) | db;
}
case 1: // 8bpp
{
const uint8_t sr = (red >> 1) - (red >> 4);
const uint8_t sg = (green >> 1) - (green >> 4);
const uint8_t sb = (blue >> 2) - (blue >> 4);
uint8_t dr = (sr >> 4) & 7;
uint8_t dg = (sg >> 4) & 7;
uint8_t db = (sb >> 4) & 3;
uint8_t dr = (sr >> 4) & 7;
uint8_t dg = (sg >> 4) & 7;
uint8_t db = (sb >> 4) & 3;
if ((sr & 0xf) > s_bayer[x & 3][y & 3]) dr++;
if ((sg & 0xf) > s_bayer[x & 3][y & 3]) dg++;
if ((sb & 0xf) > s_bayer[x & 3][y & 3]) db++;
if ((sr & 0xf) > s_bayer[x & 3][y & 3]) dr++;
if ((sg & 0xf) > s_bayer[x & 3][y & 3]) dg++;
if ((sb & 0xf) > s_bayer[x & 3][y & 3]) db++;
if (dr > 7) dr = 7;
if (dg > 7) dg = 7;
if (db > 3) db = 3;
if (dr > 7) dr = 7;
if (dg > 7) dg = 7;
if (db > 3) db = 3;
return (dr << 5) | (dg << 2) | db;
}
case 2: // 12bpp (not yet supported)
case 3: // 24bpp (not yet supported)
default:
return 0;
}
}
else
{
switch ((m_rex3.m_draw_mode1 >> 3) & 3)
{
case 0: // 4bpp
return (BIT(red, 7) << 3) | ((green & 0xc0) >> 5) | BIT(blue, 7);
case 1: // 8bpp
return (dr << 5) | (dg << 2) | db;
}
case 2: // 12bpp (not yet supported)
case 3: // 24bpp (not yet supported)
default:
return 0;
}
}
else
{
switch ((m_rex3.m_draw_mode1 >> 3) & 3)
{
case 0: // 4bpp
return (BIT(red, 7) << 3) | ((green & 0xc0) >> 5) | BIT(blue, 7);
case 1: // 8bpp
return (red & 0xe0) | ((green & 0xe0) >> 3) | ((blue & 0xc0) >> 6);
case 2: // 12bpp (not yet supported)
case 3: // 24bpp (not yet supported)
default:
return 0;
}
}
case 2: // 12bpp (not yet supported)
case 3: // 24bpp (not yet supported)
default:
return 0;
}
}
}
void newport_video_device::do_v_iline(uint8_t color, bool skip_last, bool shade)

View File

@ -11,7 +11,7 @@
#include "machine/hpc3.h"
#define ENABLE_NEWVIEW_LOG (1)
#define ENABLE_NEWVIEW_LOG (0)
class newport_video_device : public device_t, public device_palette_interface
{