Revert "epic12.cpp : Updates"

This reverts commit 4354945095.

1- Doesn't compile, u32 u32 line 221 of epic12.h can't work
2- the colour_t union is non endian-safe in the first place
This commit is contained in:
Olivier Galibert 2019-06-06 10:15:01 +02:00
parent 0b379d1b22
commit 608ba96f41
5 changed files with 245 additions and 253 deletions

View File

@ -4,17 +4,15 @@
#include "emu.h"
#include "epic12.h"
#include "screen.h"
DEFINE_DEVICE_TYPE(EPIC12, epic12_device, "epic12", "EPIC12 Blitter")
epic12_device::epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
epic12_device::epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, EPIC12, tag, owner, clock)
, device_video_interface(mconfig, *this)
, m_ram16(nullptr), m_gfx_size(0), m_bitmaps(nullptr), m_use_ram(nullptr)
, m_main_ramsize(0), m_main_rammask(0), m_ram16_copy(nullptr), m_work_queue(nullptr)
, m_maincpu(*this, finder_base::DUMMY_TAG)
, m_port_r_cb(*this)
, m_main_ramsize(0), m_main_rammask(0), m_maincpu(nullptr), m_ram16_copy(nullptr), m_work_queue(nullptr)
{
m_is_unsafe = 0;
m_delay_scale = 0;
@ -34,7 +32,7 @@ epic12_device::epic12_device(const machine_config &mconfig, const char *tag, dev
blit_delay = 0;
}
TIMER_CALLBACK_MEMBER(epic12_device::blitter_delay_callback)
TIMER_CALLBACK_MEMBER( epic12_device::blitter_delay_callback )
{
m_blitter_busy = 0;
}
@ -42,21 +40,12 @@ TIMER_CALLBACK_MEMBER(epic12_device::blitter_delay_callback)
void epic12_device::device_start()
{
m_port_r_cb.resolve_safe(0);
m_gfx_size = 0x2000 * 0x1000;
m_bitmaps = std::make_unique<bitmap_rgb32>(0x2000, 0x1000);
m_bitmaps = std::make_unique<bitmap_rgb32>( 0x2000, 0x1000);
m_clip = m_bitmaps->cliprect();
m_clip.set(0, 0x2000 - 1, 0, 0x1000 - 1);
m_clip.set(0, 0x2000-1, 0, 0x1000-1);
#ifdef DEBUG_VRAM_VIEWER
m_debug_vram_view_en = false;
m_prev_screen_width = m_curr_screen_width = screen().width();
m_prev_screen_height = m_curr_screen_height = screen().height();
m_prev_screen_visarea = m_curr_screen_visarea = screen().visible_area();
#endif
m_ram16_copy = std::make_unique<u16[]>(m_main_ramsize / 2);
m_ram16_copy = std::make_unique<uint16_t[]>(m_main_ramsize/2);
m_blitter_delay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(epic12_device::blitter_delay_callback),this));
m_blitter_delay_timer->adjust(attotime::never);
@ -90,21 +79,26 @@ void epic12_device::device_reset()
}
// cache table to avoid divides in blit code, also pre-clamped
for (int y = 0; y < 0x40; y++)
int x,y;
for (y=0;y<0x40;y++)
{
for (int x = 0; x < 0x20; x++)
for (x=0;x<0x20;x++)
{
colrtable[x][y] = std::min((x * y) / 0x1f, 0x1f);
colrtable_rev[x ^ 0x1f][y] = std::min((x * y) / 0x1f, 0x1f);
colrtable[x][y] = (x*y) / 0x1f;
if (colrtable[x][y]>0x1f) colrtable[x][y] = 0x1f;
colrtable_rev[x^0x1f][y] = (x*y) / 0x1f;
if (colrtable_rev[x^0x1f][y]>0x1f) colrtable_rev[x^0x1f][y] = 0x1f;
}
}
// preclamped add table
for (int y = 0; y < 0x20; y++)
for (y=0;y<0x20;y++)
{
for (int x = 0; x < 0x20; x++)
for (x=0;x<0x20;x++)
{
colrtable_add[x][y] = std::min((x + y), 0x1f);
colrtable_add[x][y] = (x+y);
if (colrtable_add[x][y]>0x1f) colrtable_add[x][y] = 0x1f;
}
}
@ -112,15 +106,15 @@ void epic12_device::device_reset()
}
// todo, get these into the device class without ruining performance
u8 epic12_device::colrtable[0x20][0x40];
u8 epic12_device::colrtable_rev[0x20][0x40];
u8 epic12_device::colrtable_add[0x20][0x20];
u64 epic12_device::blit_delay;
uint8_t epic12_device::colrtable[0x20][0x40];
uint8_t epic12_device::colrtable_rev[0x20][0x40];
uint8_t epic12_device::colrtable_add[0x20][0x20];
uint64_t epic12_device::blit_delay;
inline u16 epic12_device::READ_NEXT_WORD(offs_t *addr)
inline uint16_t epic12_device::READ_NEXT_WORD(offs_t *addr)
{
// u16 data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower
const u16 data = m_use_ram[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)];
// uint16_t data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower
uint16_t data = m_use_ram[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)];
*addr += 2;
@ -128,10 +122,10 @@ inline u16 epic12_device::READ_NEXT_WORD(offs_t *addr)
return data;
}
inline u16 epic12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr)
inline uint16_t epic12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr)
{
// u16 data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower
const u16 data = m_ram16[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)];
// uint16_t data = space.read_word(*addr); // going through the memory system is 'more correct' but noticeably slower
uint16_t data = m_ram16[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)];
m_ram16_copy[((*addr & m_main_rammask) >> 1) ^ NATIVE_ENDIAN_VALUE_LE_BE(3, 0)] = data;
*addr += 2;
@ -143,6 +137,7 @@ inline u16 epic12_device::COPY_NEXT_WORD(address_space &space, offs_t *addr)
inline void epic12_device::gfx_upload_shadow_copy(address_space &space, offs_t *addr)
{
uint32_t x,y, dimx,dimy;
COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr);
@ -150,12 +145,12 @@ inline void epic12_device::gfx_upload_shadow_copy(address_space &space, offs_t *
COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr);
const u32 dimx = (COPY_NEXT_WORD(space, addr) & 0x1fff) + 1;
const u32 dimy = (COPY_NEXT_WORD(space, addr) & 0x0fff) + 1;
dimx = (COPY_NEXT_WORD(space, addr) & 0x1fff) + 1;
dimy = (COPY_NEXT_WORD(space, addr) & 0x0fff) + 1;
for (u32 y = 0; y < dimy; y++)
for (y = 0; y < dimy; y++)
{
for (u32 x = 0; x < dimx; x++)
for (x = 0; x < dimx; x++)
{
COPY_NEXT_WORD(space, addr);
}
@ -164,6 +159,9 @@ inline void epic12_device::gfx_upload_shadow_copy(address_space &space, offs_t *
inline void epic12_device::gfx_upload(offs_t *addr)
{
uint32_t x,y, dst_p,dst_x_start,dst_y_start, dimx,dimy;
uint32_t *dst;
// 0x20000000
READ_NEXT_WORD(addr);
READ_NEXT_WORD(addr);
@ -172,30 +170,32 @@ inline void epic12_device::gfx_upload(offs_t *addr)
READ_NEXT_WORD(addr);
READ_NEXT_WORD(addr);
u32 dst_x_start = READ_NEXT_WORD(addr);
u32 dst_y_start = READ_NEXT_WORD(addr);
dst_x_start = READ_NEXT_WORD(addr);
dst_y_start = READ_NEXT_WORD(addr);
u32 dst_p = 0;
dst_p = 0;
dst_x_start &= 0x1fff;
dst_y_start &= 0x0fff;
const u32 dimx = (READ_NEXT_WORD(addr) & 0x1fff) + 1;
const u32 dimy = (READ_NEXT_WORD(addr) & 0x0fff) + 1;
dimx = (READ_NEXT_WORD(addr) & 0x1fff) + 1;
dimy = (READ_NEXT_WORD(addr) & 0x0fff) + 1;
logerror("GFX COPY: DST %02X,%02X,%03X DIM %02X,%03X\n", dst_p,dst_x_start,dst_y_start, dimx,dimy);
for (u32 y = 0; y < dimy; y++)
for (y = 0; y < dimy; y++)
{
u32 *dst = &m_bitmaps->pix(dst_y_start + y, 0);
dst = &m_bitmaps->pix(dst_y_start + y, 0);
dst += dst_x_start;
for (u32 x = 0; x < dimx; x++)
for (x = 0; x < dimx; x++)
{
const u16 pendat = READ_NEXT_WORD(addr);
uint16_t pendat = READ_NEXT_WORD(addr);
// real hw would upload the gfxword directly, but our VRAM is 32-bit, so convert it.
//dst[dst_x_start + x] = pendat;
*dst++ = ((pendat & 0x8000) << 14) | ((pendat & 0x7c00) << 9) | ((pendat & 0x03e0) << 6) | ((pendat & 0x001f) << 3); // --t- ---- rrrr r--- gggg g--- bbbb b--- format
//dst[dst_x_start + x] = ((pendat & 0x8000) << 14) | ((pendat & 0x7c00) << 6) | ((pendat & 0x03e0) << 3) | ((pendat & 0x001f) << 0); // --t- ---- ---r rrrr ---g gggg ---b bbbb format
*dst++ = ((pendat&0x8000)<<14) | ((pendat&0x7c00)<<9) | ((pendat&0x03e0)<<6) | ((pendat&0x001f)<<3); // --t- ---- rrrr r--- gggg g--- bbbb b--- format
//dst[dst_x_start + x] = ((pendat&0x8000)<<14) | ((pendat&0x7c00)<<6) | ((pendat&0x03e0)<<3) | ((pendat&0x001f)<<0); // --t- ---- ---r rrrr ---g gggg ---b bbbb format
}
}
}
@ -203,6 +203,7 @@ inline void epic12_device::gfx_upload(offs_t *addr)
#define draw_params m_bitmaps.get(), &m_clip, &m_bitmaps->pix(0,0),src_x,src_y, x,y, dimx,dimy, flipy, s_alpha, d_alpha, &tint_clr
const epic12_device::blitfunction epic12_device::f0_ti1_tr1_blit_funcs[64] =
{
epic12_device::draw_sprite_f0_ti1_tr1_s0_d0, epic12_device::draw_sprite_f0_ti1_tr1_s1_d0, epic12_device::draw_sprite_f0_ti1_tr1_s2_d0, epic12_device::draw_sprite_f0_ti1_tr1_s3_d0, epic12_device::draw_sprite_f0_ti1_tr1_s4_d0, epic12_device::draw_sprite_f0_ti1_tr1_s5_d0, epic12_device::draw_sprite_f0_ti1_tr1_s6_d0, epic12_device::draw_sprite_f0_ti1_tr1_s7_d0,
@ -252,6 +253,7 @@ const epic12_device::blitfunction epic12_device::f1_ti1_tr0_blit_funcs[64] =
};
const epic12_device::blitfunction epic12_device::f0_ti0_tr1_blit_funcs[64] =
{
epic12_device::draw_sprite_f0_ti0_tr1_s0_d0, epic12_device::draw_sprite_f0_ti0_tr1_s1_d0, epic12_device::draw_sprite_f0_ti0_tr1_s2_d0, epic12_device::draw_sprite_f0_ti0_tr1_s3_d0, epic12_device::draw_sprite_f0_ti0_tr1_s4_d0, epic12_device::draw_sprite_f0_ti0_tr1_s5_d0, epic12_device::draw_sprite_f0_ti0_tr1_s6_d0, epic12_device::draw_sprite_f0_ti0_tr1_s7_d0,
@ -301,39 +303,46 @@ const epic12_device::blitfunction epic12_device::f1_ti0_tr0_blit_funcs[64] =
};
inline void epic12_device::gfx_draw_shadow_copy(address_space &space, offs_t *addr)
{
COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr); // const u16 dst_x_start = COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr); // const u16 dst_y_start = COPY_NEXT_WORD(space, addr);
const u16 w = COPY_NEXT_WORD(space, addr);
const u16 h = COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr); // uint16_t dst_x_start = COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr); // uint16_t dst_y_start = COPY_NEXT_WORD(space, addr);
uint16_t w = COPY_NEXT_WORD(space, addr);
uint16_t h = COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr);
COPY_NEXT_WORD(space, addr);
// todo, calcualte clipping.
blit_delay += w * h;
blit_delay += w*h;
}
inline void epic12_device::gfx_draw(offs_t *addr)
{
int x,y, dimx,dimy, flipx,flipy;//, src_p;
int trans,blend, s_mode, d_mode;
clr_t tint_clr;
bool tinted = false;
int tinted = 0;
const u16 attr = READ_NEXT_WORD(addr);
const u16 alpha = READ_NEXT_WORD(addr);
u16 src_x = READ_NEXT_WORD(addr);
u16 src_y = READ_NEXT_WORD(addr);
const u16 dst_x_start = READ_NEXT_WORD(addr);
const u16 dst_y_start = READ_NEXT_WORD(addr);
const u16 w = READ_NEXT_WORD(addr);
const u16 h = READ_NEXT_WORD(addr);
const u16 tint_r = READ_NEXT_WORD(addr);
const u16 tint_gb = READ_NEXT_WORD(addr);
uint16_t attr = READ_NEXT_WORD(addr);
uint16_t alpha = READ_NEXT_WORD(addr);
uint16_t src_x = READ_NEXT_WORD(addr);
uint16_t src_y = READ_NEXT_WORD(addr);
uint16_t dst_x_start = READ_NEXT_WORD(addr);
uint16_t dst_y_start = READ_NEXT_WORD(addr);
uint16_t w = READ_NEXT_WORD(addr);
uint16_t h = READ_NEXT_WORD(addr);
uint16_t tint_r = READ_NEXT_WORD(addr);
uint16_t tint_gb = READ_NEXT_WORD(addr);
// 0: +alpha
// 1: +source
@ -344,47 +353,49 @@ inline void epic12_device::gfx_draw(offs_t *addr)
// 6: -dest
// 7: *
const u8 d_mode = attr & 0x0007;
const u8 s_mode = (attr & 0x0070) >> 4;
d_mode = attr & 0x0007;
s_mode = (attr & 0x0070) >> 4;
const bool trans = attr & 0x0100;
bool blend = attr & 0x0200;
trans = attr & 0x0100;
blend = attr & 0x0200;
const bool flipy = attr & 0x0400;
const bool flipx = attr & 0x0800;
flipy = attr & 0x0400;
flipx = attr & 0x0800;
const u8 d_alpha = ((alpha & 0x00ff) ) >> 3;
const u8 s_alpha = ((alpha & 0xff00) >> 8) >> 3;
const uint8_t d_alpha = ((alpha & 0x00ff) )>>3;
const uint8_t s_alpha = ((alpha & 0xff00) >> 8 )>>3;
// int src_p = 0;
src_x = src_x & 0x1fff;
src_y = src_y & 0x0fff;
// src_p = 0;
src_x = src_x & 0x1fff;
src_y = src_y & 0x0fff;
const int x = (dst_x_start & 0x7fff) - (dst_x_start & 0x8000);
const int y = (dst_y_start & 0x7fff) - (dst_y_start & 0x8000);
x = (dst_x_start & 0x7fff) - (dst_x_start & 0x8000);
y = (dst_y_start & 0x7fff) - (dst_y_start & 0x8000);
const int dimx = (w & 0x1fff) + 1;
const int dimy = (h & 0x0fff) + 1;
dimx = (w & 0x1fff) + 1;
dimy = (h & 0x0fff) + 1;
// convert parameters to clr
tint_to_clr(tint_r & 0x00ff, (tint_gb >> 8) & 0xff, tint_gb & 0xff, &tint_clr);
tint_to_clr(tint_r & 0x00ff, (tint_gb >> 8) & 0xff, tint_gb & 0xff, &tint_clr);
/* interestingly this gets set to 0x20 for 'normal' not 0x1f */
if (tint_clr.r != 0x20)
tinted = true;
if (tint_clr.r!=0x20)
tinted = 1;
if (tint_clr.g != 0x20)
tinted = true;
if (tint_clr.g!=0x20)
tinted = 1;
if (tint_clr.b!=0x20)
tinted = 1;
if (tint_clr.b != 0x20)
tinted = true;
// surprisingly frequent, need to verify if it produces a worthwhile speedup tho.
if ((s_mode == 0 && s_alpha == 0x1f) && (d_mode == 4 && d_alpha == 0x1f))
blend = false;
if ((s_mode==0 && s_alpha==0x1f) && (d_mode==4 && d_alpha==0x1f))
blend = 0;
if (tinted)
{
@ -398,7 +409,7 @@ inline void epic12_device::gfx_draw(offs_t *addr)
}
else
{
f0_ti1_tr1_blit_funcs[s_mode | (d_mode << 3)](draw_params);
f0_ti1_tr1_blit_funcs[s_mode | (d_mode<<3)](draw_params);
}
}
else
@ -409,7 +420,7 @@ inline void epic12_device::gfx_draw(offs_t *addr)
}
else
{
f0_ti1_tr0_blit_funcs[s_mode | (d_mode << 3)](draw_params);
f0_ti1_tr0_blit_funcs[s_mode | (d_mode<<3)](draw_params);
}
}
}
@ -423,7 +434,7 @@ inline void epic12_device::gfx_draw(offs_t *addr)
}
else
{
f1_ti1_tr1_blit_funcs[s_mode | (d_mode << 3)](draw_params);
f1_ti1_tr1_blit_funcs[s_mode | (d_mode<<3)](draw_params);
}
}
else
@ -434,14 +445,14 @@ inline void epic12_device::gfx_draw(offs_t *addr)
}
else
{
f1_ti1_tr0_blit_funcs[s_mode | (d_mode << 3)](draw_params);
f1_ti1_tr0_blit_funcs[s_mode | (d_mode<<3)](draw_params);
}
}
}
}
else
{
if (blend == 0 && tinted == 0)
if (blend==0 && tinted==0)
{
if (!flipx)
{
@ -470,6 +481,8 @@ inline void epic12_device::gfx_draw(offs_t *addr)
return;
}
//printf("smode %d dmode %d\n", s_mode, d_mode);
if (!flipx)
@ -482,7 +495,7 @@ inline void epic12_device::gfx_draw(offs_t *addr)
}
else
{
f0_ti0_tr1_blit_funcs[s_mode | (d_mode << 3)](draw_params);
f0_ti0_tr1_blit_funcs[s_mode | (d_mode<<3)](draw_params);
}
}
else
@ -493,7 +506,7 @@ inline void epic12_device::gfx_draw(offs_t *addr)
}
else
{
f0_ti0_tr0_blit_funcs[s_mode | (d_mode << 3)](draw_params);
f0_ti0_tr0_blit_funcs[s_mode | (d_mode<<3)](draw_params);
}
}
}
@ -507,7 +520,7 @@ inline void epic12_device::gfx_draw(offs_t *addr)
}
else
{
f1_ti0_tr1_blit_funcs[s_mode | (d_mode << 3)](draw_params);
f1_ti0_tr1_blit_funcs[s_mode | (d_mode<<3)](draw_params);
}
}
else
@ -518,12 +531,14 @@ inline void epic12_device::gfx_draw(offs_t *addr)
}
else
{
f1_ti0_tr0_blit_funcs[s_mode | (d_mode << 3)](draw_params);
f1_ti0_tr0_blit_funcs[s_mode | (d_mode<<3)](draw_params);
}
}
}
}
}
@ -534,9 +549,9 @@ void epic12_device::gfx_create_shadow_copy(address_space &space)
while (1)
{
const u16 data = COPY_NEXT_WORD(space, &addr);
uint16_t data = COPY_NEXT_WORD(space, &addr);
switch (data & 0xf000)
switch( data & 0xf000 )
{
case 0x0000:
case 0xf000:
@ -544,9 +559,9 @@ void epic12_device::gfx_create_shadow_copy(address_space &space)
case 0xc000:
if (COPY_NEXT_WORD(space, &addr)) // cliptype
m_clip.set(m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_x_shadowcopy + 320 - 1, m_gfx_scroll_1_y_shadowcopy, m_gfx_scroll_1_y_shadowcopy + 240 - 1);
m_clip.set(m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_x_shadowcopy + 320-1, m_gfx_scroll_1_y_shadowcopy, m_gfx_scroll_1_y_shadowcopy + 240-1);
else
m_clip.set(0, 0x2000 - 1, 0, 0x1000 - 1);
m_clip.set(0, 0x2000-1, 0, 0x1000-1);
break;
case 0x2000:
@ -570,15 +585,15 @@ void epic12_device::gfx_create_shadow_copy(address_space &space)
void epic12_device::gfx_exec(void)
{
offs_t addr = m_gfx_addr_shadowcopy & 0x1fffffff;
m_clip.set(m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_x_shadowcopy + 320 - 1, m_gfx_scroll_1_y_shadowcopy, m_gfx_scroll_1_y_shadowcopy + 240 - 1);
m_clip.set(m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_x_shadowcopy + 320-1, m_gfx_scroll_1_y_shadowcopy, m_gfx_scroll_1_y_shadowcopy + 240-1);
// logerror("GFX EXEC: %08X\n", addr);
while (1)
{
const u16 data = READ_NEXT_WORD(&addr);
uint16_t data = READ_NEXT_WORD(&addr);
switch (data & 0xf000)
switch( data & 0xf000 )
{
case 0x0000:
case 0xf000:
@ -586,9 +601,9 @@ void epic12_device::gfx_exec(void)
case 0xc000:
if (READ_NEXT_WORD(&addr)) // cliptype
m_clip.set(m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_x_shadowcopy + 320 - 1, m_gfx_scroll_1_y_shadowcopy, m_gfx_scroll_1_y_shadowcopy + 240 - 1);
m_clip.set(m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_x_shadowcopy + 320-1, m_gfx_scroll_1_y_shadowcopy, m_gfx_scroll_1_y_shadowcopy + 240-1);
else
m_clip.set(0, 0x2000 - 1, 0, 0x1000 - 1);
m_clip.set(0, 0x2000-1, 0, 0x1000-1);
break;
case 0x2000:
@ -612,15 +627,15 @@ void epic12_device::gfx_exec(void)
void epic12_device::gfx_exec_unsafe(void)
{
offs_t addr = m_gfx_addr & 0x1fffffff;
m_clip.set(m_gfx_scroll_1_x, m_gfx_scroll_1_x + 320 - 1, m_gfx_scroll_1_y, m_gfx_scroll_1_y + 240 - 1);
m_clip.set(m_gfx_scroll_1_x, m_gfx_scroll_1_x + 320-1, m_gfx_scroll_1_y, m_gfx_scroll_1_y + 240-1);
// logerror("GFX EXEC: %08X\n", addr);
while (1)
{
const u16 data = READ_NEXT_WORD(&addr);
uint16_t data = READ_NEXT_WORD(&addr);
switch (data & 0xf000)
switch( data & 0xf000 )
{
case 0x0000:
case 0xf000:
@ -628,9 +643,9 @@ void epic12_device::gfx_exec_unsafe(void)
case 0xc000:
if (READ_NEXT_WORD(&addr)) // cliptype
m_clip.set(m_gfx_scroll_1_x, m_gfx_scroll_1_x + 320 - 1, m_gfx_scroll_1_y, m_gfx_scroll_1_y + 240 - 1);
m_clip.set(m_gfx_scroll_1_x, m_gfx_scroll_1_x + 320-1, m_gfx_scroll_1_y, m_gfx_scroll_1_y + 240-1);
else
m_clip.set(0, 0x2000 - 1, 0, 0x1000 - 1);
m_clip.set(0, 0x2000-1, 0, 0x1000-1);
break;
case 0x2000:
@ -651,6 +666,7 @@ void epic12_device::gfx_exec_unsafe(void)
}
void *epic12_device::blit_request_callback(void *param, int threadid)
{
epic12_device *object = reinterpret_cast<epic12_device *>(param);
@ -660,6 +676,7 @@ void *epic12_device::blit_request_callback(void *param, int threadid)
}
void *epic12_device::blit_request_callback_unsafe(void *param, int threadid)
{
epic12_device *object = reinterpret_cast<epic12_device *>(param);
@ -670,12 +687,12 @@ void *epic12_device::blit_request_callback_unsafe(void *param, int threadid)
}
u32 epic12_device::gfx_ready_r()
READ32_MEMBER( epic12_device::gfx_ready_r )
{
return 0x00000010;
}
u32 epic12_device::gfx_ready_r_unsafe()
READ32_MEMBER( epic12_device::gfx_ready_r_unsafe )
{
if (m_blitter_busy)
{
@ -686,9 +703,9 @@ u32 epic12_device::gfx_ready_r_unsafe()
return 0x00000010;
}
WRITE32_MEMBER(epic12_device::gfx_exec_w)
WRITE32_MEMBER( epic12_device::gfx_exec_w )
{
if (ACCESSING_BITS_0_7)
if ( ACCESSING_BITS_0_7 )
{
if (data & 1)
{
@ -700,7 +717,7 @@ WRITE32_MEMBER(epic12_device::gfx_exec_w)
do
{
result = osd_work_item_wait(m_blitter_request, 1000);
} while (result == 0);
} while (result==0);
osd_work_item_release(m_blitter_request);
}
@ -725,9 +742,9 @@ WRITE32_MEMBER(epic12_device::gfx_exec_w)
}
void epic12_device::gfx_exec_w_unsafe(offs_t offset, u32 data, u32 mem_mask)
WRITE32_MEMBER( epic12_device::gfx_exec_w_unsafe )
{
if (ACCESSING_BITS_0_7)
if ( ACCESSING_BITS_0_7 )
{
if (data & 1)
{
@ -739,7 +756,7 @@ void epic12_device::gfx_exec_w_unsafe(offs_t offset, u32 data, u32 mem_mask)
do
{
result = osd_work_item_wait(m_blitter_request, 1000);
} while (result == 0);
} while (result==0);
osd_work_item_release(m_blitter_request);
}
@ -762,7 +779,7 @@ void epic12_device::gfx_exec_w_unsafe(offs_t offset, u32 data, u32 mem_mask)
}
void epic12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void epic12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
if (!m_is_unsafe)
{
@ -772,7 +789,7 @@ void epic12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect)
do
{
result = osd_work_item_wait(m_blitter_request, 1000);
} while (result == 0);
} while (result==0);
osd_work_item_release(m_blitter_request);
}
}
@ -782,26 +799,6 @@ void epic12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect)
bitmap.fill(0, cliprect);
#ifdef DEBUG_VRAM_VIEWER
int curr_width = m_curr_screen_width;
int curr_height = m_curr_screen_height;
rectangle curr_visarea = m_curr_screen_visarea;
if (machine().input().code_pressed_once(KEYCODE_T)) m_debug_vram_view_en = !m_debug_vram_view_en;
if (m_debug_vram_view_en)
{
curr_width = 8192;
curr_height = 4096;
curr_visarea.set(0, curr_width - 1, 0, curr_height - 1);
}
if ((m_prev_screen_height != curr_height) || (m_prev_screen_width != curr_width))
{
screen().configure(curr_width, curr_height, curr_visarea, screen().refresh_attoseconds());
m_prev_screen_height = curr_height;
m_prev_screen_width = curr_width;
}
#endif
scroll_0_x = -m_gfx_scroll_0_x;
scroll_0_y = -m_gfx_scroll_0_y;
// scroll_1_x = -m_gfx_scroll_1_x;
@ -809,21 +806,20 @@ void epic12_device::draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect)
//printf("SCREEN UPDATE\n %d %d %d %d\n", scroll_0_x, scroll_0_y, scroll_1_x, scroll_1_y);
#ifdef DEBUG_VRAM_VIEWER
if (m_debug_vram_view_en)
copybitmap(bitmap, *m_bitmaps, 0, 0, 0, 0, cliprect);
else
#endif
copyscrollbitmap(bitmap, *m_bitmaps, 1, &scroll_0_x, 1, &scroll_0_y, cliprect);
copyscrollbitmap(bitmap, *m_bitmaps, 1,&scroll_0_x, 1,&scroll_0_y, cliprect);
}
READ32_MEMBER(epic12_device::blitter_r)
READ32_MEMBER( epic12_device::blitter_r )
{
switch (offset * 4)
switch (offset*4)
{
case 0x10:
return gfx_ready_r();
return gfx_ready_r(space, offset, mem_mask);
case 0x24:
return 0xffffffff;
@ -832,7 +828,7 @@ READ32_MEMBER(epic12_device::blitter_r)
return 0xffffffff;
case 0x50:
return m_port_r_cb();
return machine().root_device().ioport(":DSW")->read();
default:
logerror("unknownblitter_r %08x %08x\n", offset*4, mem_mask);
@ -842,12 +838,12 @@ READ32_MEMBER(epic12_device::blitter_r)
return 0;
}
READ32_MEMBER(epic12_device::blitter_r_unsafe)
READ32_MEMBER( epic12_device::blitter_r_unsafe )
{
switch (offset * 4)
switch (offset*4)
{
case 0x10:
return gfx_ready_r_unsafe();
return gfx_ready_r_unsafe(space, offset, mem_mask);
case 0x24:
return 0xffffffff;
@ -856,7 +852,7 @@ READ32_MEMBER(epic12_device::blitter_r_unsafe)
return 0xffffffff;
case 0x50:
return m_port_r_cb();
return machine().root_device().ioport(":DSW")->read();
default:
logerror("unknownblitter_r %08x %08x\n", offset*4, mem_mask);
@ -867,12 +863,12 @@ READ32_MEMBER(epic12_device::blitter_r_unsafe)
}
WRITE32_MEMBER(epic12_device::blitter_w)
WRITE32_MEMBER( epic12_device::blitter_w )
{
switch (offset * 4)
switch (offset*4)
{
case 0x04:
gfx_exec_w(space, offset, data, mem_mask);
gfx_exec_w(space,offset,data,mem_mask);
break;
case 0x08:
@ -898,12 +894,12 @@ WRITE32_MEMBER(epic12_device::blitter_w)
}
}
WRITE32_MEMBER(epic12_device::blitter_w_unsafe)
WRITE32_MEMBER( epic12_device::blitter_w_unsafe )
{
switch (offset * 4)
switch (offset*4)
{
case 0x04:
gfx_exec_w_unsafe(offset, data, mem_mask);
gfx_exec_w_unsafe(space,offset,data,mem_mask);
break;
case 0x08:
@ -951,13 +947,13 @@ void epic12_device::install_handlers(int addr1, int addr2)
space.install_readwrite_handler(addr1, addr2, read , write, 0xffffffffffffffffU);
}
u64 epic12_device::fpga_r()
READ64_MEMBER( epic12_device::fpga_r )
{
return 0xff;
}
// todo, store what's written here and checksum it, different microcode probably leads to slightly different blitter timings
void epic12_device::fpga_w(offs_t offset, u64 data, u64 mem_mask)
WRITE64_MEMBER( epic12_device::fpga_w )
{
if (ACCESSING_BITS_24_31)
{

View File

@ -6,74 +6,73 @@
#pragma once
#define DEBUG_VRAM_VIEWER 0 // VRAM viewer for debug
class epic12_device : public device_t, public device_video_interface
{
public:
epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
epic12_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <typename T> void set_cpu(T &&maintag) { m_maincpu.set_tag(std::forward<T>(maintag)); }
auto port_r_callback() { return m_port_r_cb.bind(); }
void set_rambase(u16* rambase) { m_ram16 = rambase; }
void set_rambase(uint16_t* rambase) { m_ram16 = rambase; }
void set_delay_scale(int delay_scale) { m_delay_scale = delay_scale; }
void set_is_unsafe(int is_unsafe) { m_is_unsafe = is_unsafe; }
void set_cpu_device(cpu_device* maincpu) { m_maincpu = maincpu; }
inline u16 READ_NEXT_WORD(offs_t *addr);
inline uint16_t READ_NEXT_WORD(offs_t *addr);
void set_mainramsize(size_t ramsize)
void set_mainramsize(int ramsize)
{
m_main_ramsize = ramsize;
m_main_rammask = ramsize - 1;
m_main_rammask = ramsize-1;
}
static void *blit_request_callback(void *param, int threadid);
u64 fpga_r();
void fpga_w(offs_t offset, u64 data, u64 mem_mask = ~0);
DECLARE_READ64_MEMBER( fpga_r );
DECLARE_WRITE64_MEMBER( fpga_w );
void draw_screen(bitmap_rgb32 &bitmap, const rectangle &cliprect);
u16* m_ram16;
u32 m_gfx_addr;
u32 m_gfx_scroll_0_x, m_gfx_scroll_0_y;
u32 m_gfx_scroll_1_x, m_gfx_scroll_1_y;
uint16_t* m_ram16;
uint32_t m_gfx_addr;
uint32_t m_gfx_scroll_0_x, m_gfx_scroll_0_y;
uint32_t m_gfx_scroll_1_x, m_gfx_scroll_1_y;
int m_gfx_size;
std::unique_ptr<bitmap_rgb32> m_bitmaps;
rectangle m_clip;
u16* m_use_ram;
size_t m_main_ramsize; // type D has double the main ram
size_t m_main_rammask;
uint16_t* m_use_ram;
int m_main_ramsize; // type D has double the main ram
int m_main_rammask;
int m_is_unsafe;
int m_delay_scale;
cpu_device* m_maincpu;
void install_handlers(int addr1, int addr2);
// thread safe mode, with no delays & shadow ram copy
DECLARE_READ32_MEMBER(blitter_r);
DECLARE_WRITE32_MEMBER(blitter_w);
u32 m_gfx_addr_shadowcopy;
u32 m_gfx_scroll_0_x_shadowcopy, m_gfx_scroll_0_y_shadowcopy;
u32 m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_y_shadowcopy;
std::unique_ptr<u16[]> m_ram16_copy;
uint32_t m_gfx_addr_shadowcopy;
uint32_t m_gfx_scroll_0_x_shadowcopy, m_gfx_scroll_0_y_shadowcopy;
uint32_t m_gfx_scroll_1_x_shadowcopy, m_gfx_scroll_1_y_shadowcopy;
std::unique_ptr<uint16_t[]> m_ram16_copy;
inline void gfx_upload_shadow_copy(address_space &space, offs_t *addr);
inline void gfx_create_shadow_copy(address_space &space);
inline u16 COPY_NEXT_WORD(address_space &space, offs_t *addr);
inline uint16_t COPY_NEXT_WORD(address_space &space, offs_t *addr);
inline void gfx_draw_shadow_copy(address_space &space, offs_t *addr);
inline void gfx_upload(offs_t *addr);
inline void gfx_draw(offs_t *addr);
void gfx_exec(void);
u32 gfx_ready_r();
DECLARE_WRITE32_MEMBER(gfx_exec_w);
DECLARE_READ32_MEMBER( gfx_ready_r );
DECLARE_WRITE32_MEMBER( gfx_exec_w );
// for thread unsafe mode with blitter delays, no shadow copy of RAM
DECLARE_READ32_MEMBER(blitter_r_unsafe);
DECLARE_WRITE32_MEMBER(blitter_w_unsafe);
u32 gfx_ready_r_unsafe();
void gfx_exec_w_unsafe(offs_t offset, u32 data, u32 mem_mask = ~0);
READ32_MEMBER( gfx_ready_r_unsafe );
WRITE32_MEMBER( gfx_exec_w_unsafe );
void gfx_exec_unsafe(void);
static void *blit_request_callback_unsafe(void *param, int threadid);
@ -81,7 +80,7 @@ protected:
struct clr_t
{
// clr_t to r5g5b5
u32 to_pen() const
uint32_t to_pen() const
{
// --t- ---- rrrr r--- gggg g--- bbbb b--- format
return (r << (16 + 3)) | (g << (8 + 3)) | (b << 3);
@ -91,7 +90,7 @@ protected:
}
void add_with_clr_mul_fixed(const clr_t &clr0, u8 mulfixed_val, const clr_t &mulfixed_clr0)
void add_with_clr_mul_fixed(const clr_t &clr0, uint8_t mulfixed_val, const clr_t &mulfixed_clr0)
{
r = colrtable_add[clr0.r][colrtable[mulfixed_clr0.r][mulfixed_val]];
g = colrtable_add[clr0.g][colrtable[mulfixed_clr0.g][mulfixed_val]];
@ -112,7 +111,7 @@ protected:
b = colrtable_add[clr0.r][colrtable[clr1.b][clr1.b]];
}
void add_with_clr_mul_fixed_rev(const clr_t &clr0, u8 val, const clr_t &clr1)
void add_with_clr_mul_fixed_rev(const clr_t &clr0, uint8_t val, const clr_t &clr1)
{
r = colrtable_add[clr0.r][colrtable_rev[val][clr1.r]];
g = colrtable_add[clr0.g][colrtable_rev[val][clr1.g]];
@ -190,14 +189,14 @@ protected:
b = colrtable_rev[clr2.b][clr1.b];
}
void mul_fixed(u8 val, const clr_t &clr0)
void mul_fixed(uint8_t val, const clr_t &clr0)
{
r = colrtable[val][clr0.r];
g = colrtable[val][clr0.g];
b = colrtable[val][clr0.b];
}
void mul_fixed_rev(u8 val, const clr_t &clr0)
void mul_fixed_rev(uint8_t val, const clr_t &clr0)
{
r = colrtable_rev[val][clr0.r];
g = colrtable_rev[val][clr0.g];
@ -212,34 +211,34 @@ protected:
}
u8 b, g, r, t;
uint8_t b, g, r, t;
};
union colour_t
{
clr_t trgb;
u32 u32;
uint32_t u32;
};
typedef void (*blitfunction)(
bitmap_rgb32 *,
const rectangle *,
u32 *gfx,
uint32_t *gfx,
int src_x,
int src_y,
const int dst_x_start,
const int dst_y_start,
int dimx,
int dimy,
const bool flipy,
const u8 s_alpha,
const u8 d_alpha,
const int flipy,
const uint8_t s_alpha,
const uint8_t d_alpha,
//int tint,
const clr_t *);
#define BLIT_FUNCTION static void
#define BLIT_PARAMS bitmap_rgb32 *bitmap, const rectangle *clip, u32 *gfx, int src_x, int src_y, const int dst_x_start, const int dst_y_start, int dimx, int dimy, const bool flipy, const u8 s_alpha, const u8 d_alpha, const clr_t *tint_clr
#define BLIT_PARAMS bitmap_rgb32 *bitmap, const rectangle *clip, uint32_t *gfx, int src_x, int src_y, const int dst_x_start, const int dst_y_start, int dimx, int dimy, const int flipy, const uint8_t s_alpha, const uint8_t d_alpha, const clr_t *tint_clr
BLIT_FUNCTION draw_sprite_f0_ti0_plain(BLIT_PARAMS);
BLIT_FUNCTION draw_sprite_f0_ti0_tr1_s0_d0(BLIT_PARAMS);
@ -774,7 +773,9 @@ protected:
BLIT_FUNCTION draw_sprite_f1_ti0_tr1_simple(BLIT_PARAMS);
BLIT_FUNCTION draw_sprite_f1_ti0_tr0_simple(BLIT_PARAMS);
static inline void pen_to_clr(u32 pen, clr_t *clr)
static inline void pen_to_clr(uint32_t pen, clr_t *clr)
{
// --t- ---- rrrr r--- gggg g--- bbbb b--- format
clr->r = (pen >> (16+3));// & 0x1f;
@ -788,14 +789,17 @@ protected:
};
// convert separate r,g,b biases (0..80..ff) to clr_t (-1f..0..1f)
void tint_to_clr(u8 r, u8 g, u8 b, clr_t *clr)
void tint_to_clr(uint8_t r, uint8_t g, uint8_t b, clr_t *clr)
{
clr->r = r>>2;
clr->g = g>>2;
clr->b = b>>2;
};
// (1|s|d) * s_factor * s + (1|s|d) * d_factor * d
// 0: +alpha
// 1: +source
@ -806,10 +810,11 @@ protected:
// 6: -dest
// 7: *
virtual void device_start() override;
virtual void device_reset() override;
TIMER_CALLBACK_MEMBER(blitter_delay_callback);
TIMER_CALLBACK_MEMBER( blitter_delay_callback );
osd_work_queue *m_work_queue;
osd_work_item *m_blitter_request;
@ -818,21 +823,10 @@ protected:
emu_timer *m_blitter_delay_timer;
int m_blitter_busy;
// debug vram viewer
#ifdef DEBUG_VRAM_VIEWER
bool m_debug_vram_view_en;
int m_prev_screen_width;
int m_prev_screen_height;
rectangle m_prev_screen_visarea;
int m_curr_screen_width;
int m_curr_screen_height;
rectangle m_curr_screen_visarea;
#endif
static u8 colrtable[0x20][0x40];
static u8 colrtable_rev[0x20][0x40];
static u8 colrtable_add[0x20][0x20];
static u64 blit_delay;
static uint8_t colrtable[0x20][0x40];
static uint8_t colrtable_rev[0x20][0x40];
static uint8_t colrtable_add[0x20][0x20];
static uint64_t blit_delay;
static const blitfunction f0_ti1_tr1_blit_funcs[64];
static const blitfunction f0_ti1_tr0_blit_funcs[64];
@ -842,10 +836,6 @@ protected:
static const blitfunction f0_ti0_tr0_blit_funcs[64];
static const blitfunction f1_ti0_tr1_blit_funcs[64];
static const blitfunction f1_ti0_tr0_blit_funcs[64];
// internal states
required_device<cpu_device> m_maincpu;
devcb_read32 m_port_r_cb;
};

View File

@ -4,7 +4,8 @@
void epic12_device::FUNCNAME(BLIT_PARAMS)
{
int yf;
uint32_t* gfx2;
int y, yf;
#if REALLY_SIMPLE == 0
colour_t s_clr;
@ -29,26 +30,27 @@ void epic12_device::FUNCNAME(BLIT_PARAMS)
colour_t clr0;
#endif
#endif
#if REALLY_SIMPLE == 1
#if TRANSPARENT == 1
u32 pen;
uint32_t pen;
#endif
#else
u32 pen;
uint32_t pen;
#endif
u32 *bmp;
uint32_t *bmp;
#if FLIPX == 1
src_x += (dimx-1);
#endif
if (flipy) { yf = -1; src_y += (dimy-1); }
else { yf = +1; }
if (flipy) { yf = -1; src_y += (dimy-1); }
else { yf = +1; }
int starty = 0;
const int dst_y_end = dst_y_start + dimy;
const int dst_y_end = dst_y_start+dimy;
if (dst_y_start < clip->min_y)
starty = clip->min_y - dst_y_start;
@ -59,13 +61,13 @@ void epic12_device::FUNCNAME(BLIT_PARAMS)
// check things are safe to draw (note, if the source would wrap round an edge of the 0x2000*0x1000 vram we don't draw.. not sure what the hw does anyway)
// ddpdfk triggers this on boss explosions so it needs fixing
#if FLIPX == 1
if ((src_x & 0x1fff) < ((src_x-(dimx-1)) & 0x1fff))
if ((src_x &0x1fff) < ((src_x-(dimx-1))&0x1fff))
{
// popmessage("sprite gets clipped off src_x %04x dimx %04x\n", src_x, dimx);
return;
}
#else
if ((src_x & 0x1fff) > ((src_x+(dimx-1)) & 0x1fff))
if ((src_x &0x1fff) > ((src_x+(dimx-1))&0x1fff))
{
// popmessage("sprite gets clipped off src_x %04x dimx %04x\n", src_x, dimx);
return;
@ -73,7 +75,7 @@ void epic12_device::FUNCNAME(BLIT_PARAMS)
#endif
int startx = 0;
const int dst_x_end = dst_x_start + dimx;
const int dst_x_end = dst_x_start+dimx;
if (dst_x_start < clip->min_x)
startx = clip->min_x - dst_x_start;
@ -84,7 +86,7 @@ void epic12_device::FUNCNAME(BLIT_PARAMS)
// wrong/unsafe slowdown sim
if (dimy > starty && dimx > startx)
{
blit_delay += (dimy - starty) * (dimx - startx);
blit_delay += (dimy - starty)*(dimx - startx);
//printf("delay is now %d\n", blit_delay);
}
@ -92,45 +94,48 @@ void epic12_device::FUNCNAME(BLIT_PARAMS)
#if BLENDED == 1
#if _SMODE == 0
#if _DMODE == 0
const u8* salpha_table = colrtable[s_alpha];
const u8* dalpha_table = colrtable[d_alpha];
const uint8_t* salpha_table = colrtable[s_alpha];
const uint8_t* dalpha_table = colrtable[d_alpha];
#endif
#if _DMODE == 5
const u8* salpha_table = colrtable[s_alpha];
const uint8_t* salpha_table = colrtable[s_alpha];
#endif
#if _DMODE == 1
const u8* salpha_table = colrtable[s_alpha];
const uint8_t* salpha_table = colrtable[s_alpha];
#endif
#endif
#if _SMODE == 2
#if _DMODE == 0
const u8* dalpha_table = colrtable[d_alpha];
const uint8_t* dalpha_table = colrtable[d_alpha];
#endif
#endif
#endif
for (int y = starty; y < dimy; y++)
for (y = starty; y < dimy; y++)
{
bmp = &bitmap->pix(dst_y_start + y, dst_x_start+startx);
const int ysrc_index = ((src_y + yf * y) & 0x0fff) * 0x2000;
u32* gfx2 = gfx + ysrc_index;
const int ysrc_index = ((src_y + yf * y) & 0x0fff) * 0x2000;
gfx2 = gfx + ysrc_index;
#if FLIPX == 1
gfx2 += (src_x - startx);
gfx2 += (src_x-startx);
#else
gfx2 += (src_x + startx);
gfx2 += (src_x+startx);
#endif
#if 1
const u32* end = bmp + (dimx - startx);
const uint32_t* end = bmp+(dimx-startx);
#else
// maybe we can do some SSE type optimizations on larger blocks? right now this just results in more code and slower compiling tho.
const int width = dimx-startx;
const u32* end = bmp+(width);
const uint32_t* end = bmp+(width);
if (width<0) return;
@ -150,7 +155,7 @@ void epic12_device::FUNCNAME(BLIT_PARAMS)
bigblocks--;
}
#endif
while (bmp < end)
while (bmp<end)
{
#include "epic12pixel.hxx"
}

View File

@ -53,6 +53,7 @@
#if _SMODE == 0
//g_profiler.start(PROFILER_USER7);
#if _DMODE == 0
//g_profiler.start(PROFILER_USER1);
// this is used extensively in the games (ingame, futari title screens etc.)
@ -179,11 +180,12 @@
#endif
#endif
#endif
// write result
*bmp = s_clr.trgb.to_pen() | (pen & 0x20000000);
//*bmp = (s_clr.u32 << 3)|(pen & 0x20000000); // using the union is actually significantly slower than our to_pen function!
*bmp = s_clr.trgb.to_pen()|(pen&0x20000000);
//*bmp = (s_clr.u32<<3)|(pen&0x20000000); // using the union is actually significantly slower than our to_pen function!
#endif // END NOT REALLY SIMPLE

View File

@ -451,6 +451,7 @@ INPUT_PORTS_END
void cv1k_state::machine_reset()
{
m_blitter->set_rambase (reinterpret_cast<uint16_t *>(m_ram.target()));
m_blitter->set_cpu_device (m_maincpu);
m_blitter->set_is_unsafe(machine().root_device().ioport(":BLITCFG")->read());
m_blitter->install_handlers( 0x18000000, 0x18000057 );
m_blitter->reset();
@ -491,8 +492,6 @@ void cv1k_state::cv1k(machine_config &config)
YMZ770(config, "ymz770", 16.384_MHz_XTAL).add_route(1, "mono", 1.0); // only Right output used, Left is not connected
EPIC12(config, m_blitter, 0);
m_blitter->set_cpu(m_maincpu);
m_blitter->port_r_callback().set_ioport("DSW");
m_blitter->set_mainramsize(0x800000);
}