Revert some changes committed by accident. No WN.

This commit is contained in:
Couriersud 2012-05-26 11:15:14 +00:00
parent 8f37cc10ce
commit 35bed5a154
7 changed files with 24 additions and 1372 deletions

View File

@ -112,7 +112,7 @@ inline void adsp21xx_device::update_mstat()
inline UINT32 adsp21xx_device::pc_stack_top()
{
if (EXPECTED(m_pc_sp > 0))
if (m_pc_sp > 0)
return m_pc_stack[m_pc_sp - 1];
else
return m_pc_stack[0];
@ -120,7 +120,7 @@ inline UINT32 adsp21xx_device::pc_stack_top()
inline void adsp21xx_device::set_pc_stack_top(UINT32 top)
{
if (EXPECTED(m_pc_sp > 0))
if (m_pc_sp > 0)
m_pc_stack[m_pc_sp - 1] = top;
else
m_pc_stack[0] = top;
@ -128,7 +128,7 @@ inline void adsp21xx_device::set_pc_stack_top(UINT32 top)
inline void adsp21xx_device::pc_stack_push()
{
if (EXPECTED(m_pc_sp < PC_STACK_DEPTH))
if (m_pc_sp < PC_STACK_DEPTH)
{
m_pc_stack[m_pc_sp] = m_pc;
m_pc_sp++;
@ -140,7 +140,7 @@ inline void adsp21xx_device::pc_stack_push()
inline void adsp21xx_device::pc_stack_push_val(UINT32 val)
{
if (EXPECTED(m_pc_sp < PC_STACK_DEPTH))
if (m_pc_sp < PC_STACK_DEPTH)
{
m_pc_stack[m_pc_sp] = val;
m_pc_sp++;
@ -152,10 +152,10 @@ inline void adsp21xx_device::pc_stack_push_val(UINT32 val)
inline void adsp21xx_device::pc_stack_pop()
{
if (EXPECTED(m_pc_sp > 0))
if (m_pc_sp > 0)
{
m_pc_sp--;
if (UNEXPECTED(m_pc_sp == 0))
if (m_pc_sp == 0)
m_sstat |= PC_EMPTY;
}
m_pc = m_pc_stack[m_pc_sp];
@ -163,7 +163,7 @@ inline void adsp21xx_device::pc_stack_pop()
inline UINT32 adsp21xx_device::pc_stack_pop_val()
{
if (EXPECTED(m_pc_sp > 0))
if (m_pc_sp > 0)
{
m_pc_sp--;
if (m_pc_sp == 0)
@ -179,7 +179,7 @@ inline UINT32 adsp21xx_device::pc_stack_pop_val()
inline UINT32 adsp21xx_device::cntr_stack_top()
{
if (EXPECTED(m_cntr_sp > 0))
if (m_cntr_sp > 0)
return m_cntr_stack[m_cntr_sp - 1];
else
return m_cntr_stack[0];
@ -187,7 +187,7 @@ inline UINT32 adsp21xx_device::cntr_stack_top()
inline void adsp21xx_device::cntr_stack_push()
{
if (EXPECTED(m_cntr_sp < CNTR_STACK_DEPTH))
if (m_cntr_sp < CNTR_STACK_DEPTH)
{
m_cntr_stack[m_cntr_sp] = m_cntr;
m_cntr_sp++;
@ -199,7 +199,7 @@ inline void adsp21xx_device::cntr_stack_push()
inline void adsp21xx_device::cntr_stack_pop()
{
if (EXPECTED(m_cntr_sp > 0))
if (m_cntr_sp > 0)
{
m_cntr_sp--;
if (m_cntr_sp == 0)
@ -215,7 +215,7 @@ inline void adsp21xx_device::cntr_stack_pop()
inline UINT32 adsp21xx_device::loop_stack_top()
{
if (EXPECTED(m_loop_sp > 0))
if (m_loop_sp > 0)
return m_loop_stack[m_loop_sp - 1];
else
return m_loop_stack[0];
@ -223,7 +223,7 @@ inline UINT32 adsp21xx_device::loop_stack_top()
inline void adsp21xx_device::loop_stack_push(UINT32 value)
{
if (EXPECTED(m_loop_sp < LOOP_STACK_DEPTH))
if (m_loop_sp < LOOP_STACK_DEPTH)
{
m_loop_stack[m_loop_sp] = value;
m_loop_sp++;
@ -237,10 +237,10 @@ inline void adsp21xx_device::loop_stack_push(UINT32 value)
inline void adsp21xx_device::loop_stack_pop()
{
if (EXPECTED(m_loop_sp > 0))
if (m_loop_sp > 0)
{
m_loop_sp--;
if (UNEXPECTED(m_loop_sp == 0))
if (m_loop_sp == 0)
{
m_loop = 0xffff;
m_loop_condition = 0;
@ -261,7 +261,7 @@ inline void adsp21xx_device::loop_stack_pop()
inline void adsp21xx_device::stat_stack_push()
{
if (EXPECTED(m_stat_sp < STAT_STACK_DEPTH))
if (m_stat_sp < STAT_STACK_DEPTH)
{
m_stat_stack[m_stat_sp][0] = m_mstat;
m_stat_stack[m_stat_sp][1] = m_imask;
@ -275,7 +275,7 @@ inline void adsp21xx_device::stat_stack_push()
inline void adsp21xx_device::stat_stack_pop()
{
if (EXPECTED(m_stat_sp > 0))
if (m_stat_sp > 0)
{
m_stat_sp--;
if (m_stat_sp == 0)

View File

@ -495,7 +495,6 @@ void drawgfx_transpen(bitmap_ind16 &dest, const rectangle &cliprect, const gfx_e
// special case invalid pens to opaque
if (transpen > 0xff)
return drawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty);
// int palbase;
// use pen usage to optimize
code %= gfx->total_elements;
@ -527,11 +526,6 @@ void drawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_e
// use pen usage to optimize
code %= gfx->total_elements;
color %= gfx->total_colors;
int palbase = gfx->color_base + gfx->color_granularity * color;
const pen_t *paldata = &gfx->machine().pens[palbase];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
{
// fully transparent; do nothing
@ -544,14 +538,10 @@ void drawgfx_transpen(bitmap_rgb32 &dest, const rectangle &cliprect, const gfx_e
return drawgfx_opaque(dest, cliprect, gfx, code, color, flipx, flipy, destx, desty);
}
/* render based on dest bitmap depth */
// render
const pen_t *paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
DECLARE_NO_PRIORITY;
if (dest.format() == BITMAP_FORMAT_IND16)
DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_TRANSPEN_IND16, NO_PRIORITY);
else if (dest.bpp() == 16)
DRAWGFX_CORE(UINT16, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY);
else
DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY);
DRAWGFX_CORE(UINT32, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY);
}

View File

@ -139,15 +139,6 @@ do \
} \
while (0) \
#define PIXEL_OP_REMAP_TRANSPEN_IND16(DEST, PRIORITY, SOURCE) \
do \
{ \
UINT32 srcdata = (SOURCE); \
if (srcdata != transpen) \
(DEST) = srcdata + palbase; \
} \
while (0) \
#define PIXEL_OP_REMAP_TRANSPEN_PRIORITY(DEST, PRIORITY, SOURCE) \
do \
{ \

View File

@ -434,7 +434,7 @@ void render_texture::release()
void render_texture::set_bitmap(bitmap_t &bitmap, const rectangle &sbounds, texture_format format)
{
//assert(bitmap.cliprect().contains(sbounds));
assert(bitmap.cliprect().contains(sbounds));
// ensure we have a valid palette for palettized modes
if (format == TEXFORMAT_PALETTE16 || format == TEXFORMAT_PALETTEA16)
@ -1377,10 +1377,7 @@ render_primitive_list &render_target::get_primitives()
// if there is no associated element, it must be a screen element
if (curitem->screen() != NULL)
{
add_container_primitives(list, item_xform, curitem->screen()->container(), blendmode);
curitem->screen()->set_render_size((int) item_xform.xscale, (int) item_xform.yscale);
}
else
add_element_primitives(list, item_xform, *curitem->element(), curitem->state(), blendmode);
}
@ -1743,6 +1740,7 @@ void render_target::add_container_primitives(render_primitive_list &list, const
prim->bounds.x1 = render_round_nearest(container_xform.xoffs + bounds.x1 * container_xform.xscale);
prim->bounds.y1 = render_round_nearest(container_xform.yoffs + bounds.y1 * container_xform.yscale);
}
// compute the color of the primitive
prim->color.r = container_xform.color.r * curitem->color().r;
prim->color.g = container_xform.color.g * curitem->color().g;

File diff suppressed because it is too large Load Diff

View File

@ -156,104 +156,6 @@ typedef device_delegate<UINT32 (screen_device &, bitmap_rgb32 &, const rectangle
typedef device_delegate<void (screen_device &, bool)> screen_vblank_delegate;
// ======================> monitor_device
class crt_monitor
{
public:
typedef enum
{
PASSTHROUGHX = 0, // PASSTHROUGH somewhere defined in win32 environment
SHADOW_MASK = 1,
CROMA_CLEAR = 2,
// APERTURE_GRILLE,
} crt_monitor_type;
typedef struct
{
crt_monitor_type m_type;
INT16 r_off;
INT16 g_off;
INT16 b_off;
UINT16 r_gain;
UINT16 b_gain;
UINT16 g_gain;
UINT16 focus;
UINT16 decay;
UINT16 bandwidth;
UINT8 source_cie;
} crt_monitor_param;
crt_monitor(void);
~crt_monitor(void);
void resize(int new_width, int new_height);
bitmap_t &final_bitmap(int cur_bm) { return m_phos_bm[cur_bm]; }
void get_param(crt_monitor_param &param) { param = m_param; }
void set_param(crt_monitor_param &param);
crt_monitor_type type(void) const { return m_param.m_type; }
//void set_type(crt_monitor_type new_type) { m_type = new_type; }
//void set_horz_pixel(int num) { m_horz_pixel = num; }
void process(running_machine &machine, screen_bitmap &src_bm, int cur_bm, rectangle &clip);
const rectangle &get_visible() const { return m_visible; }
int get_cie_count(void);
const char * get_cie_name(void);
int get_type_count(void) { return 3; }
const char * get_type_name(void)
{
switch (m_param.m_type)
{
case PASSTHROUGHX:
return "Passthrough";
case CROMA_CLEAR:
return "Croma Clear";
case SHADOW_MASK:
return "Shadow Mask";
}
return "";
}
private:
INT16 * m_amplifier_r;
INT16 * m_amplifier_g;
INT16 * m_amplifier_b;
bitmap_rgb32 m_mask_bm;
bitmap_rgb32 m_phos_bm[2];
crt_monitor_param m_param;
rectangle m_visible;
//rectangle m_src_visible;
int m_vert_pixel;
int m_horz_pixel;
int m_width;
int m_height;
void free_bitmaps(void);
void scale_and_bandwith(running_machine &machine, bitmap_t &bm_src, const rectangle &cliprect);
void copyonly(bitmap_rgb32 &bm_dst, rectangle &clip);
void copy_shadow_mask(bitmap_rgb32 &bm_dst, const rectangle &clip);
void copy_chroma(bitmap_rgb32 &bm_dst, const rectangle &clip);
void phosphor(bitmap_rgb32 &bm_dst, bitmap_rgb32 &bm_phos, bitmap_rgb32 &bm_src, const rectangle &cliprect);
rgb_t base_red[768];
rgb_t base_green[768];
rgb_t base_blue[768];
int m_exp[256];
};
// ======================> screen_device
class screen_device : public device_t
@ -269,7 +171,7 @@ public:
screen_type_enum screen_type() const { return m_type; }
int width() const { return m_width; }
int height() const { return m_height; }
const rectangle &visible_area() const;// { return m_visarea; }
const rectangle &visible_area() const { return m_visarea; }
const rectangle &cliprect() const { return m_bitmap[0].cliprect(); }
bool oldstyle_vblank_supplied() const { return m_oldstyle_vblank_supplied; }
attoseconds_t refresh_attoseconds() const { return m_refresh; }
@ -322,8 +224,6 @@ public:
void update_now();
void reset_partial_updates();
void set_render_size(int width, int height);
// additional helpers
void register_vblank_callback(vblank_state_delegate vblank_callback);
void register_screen_bitmap(bitmap_t &bitmap);
@ -333,10 +233,6 @@ public:
bool update_quads();
void update_burnin();
// access to crt
crt_monitor &crt(void) { return m_crt; }
// globally accessible constants
static const int DEFAULT_FRAME_RATE = 60;
static const attotime DEFAULT_FRAME_PERIOD;
@ -410,10 +306,6 @@ private:
UINT64 m_frame_number; // the current frame number
UINT32 m_partial_updates_this_frame;// partial update counter this frame
// render size
INT32 m_render_width;
INT32 m_render_height;
// VBLANK callbacks
class callback_item
{
@ -441,10 +333,6 @@ private:
bitmap_t & m_bitmap;
};
simple_list<auto_bitmap_item> m_auto_bitmap_list; // list of registered bitmaps
// monitor emulation
crt_monitor m_crt;
};
// device type definition

View File

@ -160,20 +160,6 @@ static INT32 slider_overyoffset(running_machine &machine, void *arg, astring *st
static INT32 slider_flicker(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_beam(running_machine &machine, void *arg, astring *string, INT32 newval);
static char *slider_get_screen_desc(screen_device &screen);
static INT32 slider_crt_red_off(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_green_off(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_blue_off(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_red_gain(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_green_gain(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_blue_gain(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_decay(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_bandwidth(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_focus(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_cie(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crt_type(running_machine &machine, void *arg, astring *string, INT32 newval);
#ifdef MAME_DEBUG
static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval);
static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
@ -1783,54 +1769,6 @@ static slider_state *slider_init(running_machine &machine)
break;
}
screen_device_iterator iter(machine.root_device());
for (screen_device *screen = iter.first(); screen != NULL; screen = iter.next())
if (screen->screen_type() != SCREEN_TYPE_VECTOR)
{
void *param = (void *)screen;
string.printf("%s Red Offset", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, -256, 0, 256, 5, slider_crt_red_off, param);
tailptr = &(*tailptr)->next;
string.printf("%s Green Offset", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, -256, 0, 256, 5, slider_crt_green_off, param);
tailptr = &(*tailptr)->next;
string.printf("%s Blue Offset", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, -256, 0, 256, 5, slider_crt_blue_off, param);
tailptr = &(*tailptr)->next;
string.printf("%s Red Gain", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 0, 256, 767, 5, slider_crt_red_gain, param);
tailptr = &(*tailptr)->next;
string.printf("%s Green Gain", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 0, 256, 767, 5, slider_crt_green_gain, param);
tailptr = &(*tailptr)->next;
string.printf("%s Blue Gain", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 0, 256, 767, 5, slider_crt_blue_gain, param);
tailptr = &(*tailptr)->next;
string.printf("%s Phosphor decay", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 0, 0, 256, 5, slider_crt_decay, param);
tailptr = &(*tailptr)->next;
string.printf("%s Bandwidth", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 0, 0, 256, 5, slider_crt_bandwidth, param);
tailptr = &(*tailptr)->next;
string.printf("%s Focus", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 0, 256, 256, 5, slider_crt_focus, param);
tailptr = &(*tailptr)->next;
string.printf("%s CIE", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 0, 0, screen->crt().get_cie_count()-1, 1, slider_crt_cie, param);
tailptr = &(*tailptr)->next;
string.printf("%s Monitor type", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, 0, 0, screen->crt().get_type_count()-1, 1, slider_crt_type, param);
tailptr = &(*tailptr)->next;
}
#ifdef MAME_DEBUG
/* add crosshair adjusters */
for (port = machine.ioport().first_port(); port != NULL; port = port->next())
@ -1850,185 +1788,6 @@ static slider_state *slider_init(running_machine &machine)
return listhead;
}
/*-------------------------------------------------
slider_crt_* - CRT Monitor sliders
-------------------------------------------------*/
static INT32 slider_crt_red_off(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.r_off = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%.2f", (double) param.r_off / 256.0f);
return param.r_off;
}
static INT32 slider_crt_green_off(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.g_off = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%.2f", (double) param.g_off / 256.0f);
return param.g_off;
}
static INT32 slider_crt_blue_off(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.b_off = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%.2f", (double) param.b_off / 256.0f);
return param.b_off;
}
static INT32 slider_crt_red_gain(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.r_gain = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%.2f", (double) param.r_gain / 256.0f);
return param.r_gain;
}
static INT32 slider_crt_green_gain(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.g_gain = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%.2f", (double) param.g_gain / 256.0f);
return param.g_gain;
}
static INT32 slider_crt_blue_gain(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.b_gain = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%.2f", (double) param.b_gain / 256.0f);
return param.b_gain;
}
static INT32 slider_crt_decay(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.decay = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%.2f", (double) param.decay / 256.0f);
return param.decay;
}
static INT32 slider_crt_bandwidth(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.bandwidth = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%.2f", (double) param.bandwidth / 256.0f);
return param.bandwidth;
}
static INT32 slider_crt_focus(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.focus = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%.2f", (double) param.focus / 256.0f);
return param.focus;
}
static INT32 slider_crt_cie(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.source_cie = newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%s", screen->crt().get_cie_name());
return param.source_cie;
}
static INT32 slider_crt_type(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
crt_monitor::crt_monitor_param param;
screen->crt().get_param(param);
if (newval != SLIDER_NOCHANGE)
{
param.m_type = (crt_monitor::crt_monitor_type) newval;
screen->crt().set_param(param);
}
if (string != NULL)
string->printf("%s", screen->crt().get_type_name());
return param.m_type;
}
/*-------------------------------------------------
slider_volume - global volume slider callback