mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
Revert changes committed by accident.
This commit is contained in:
parent
38c122f4aa
commit
6a06d7604f
@ -147,15 +147,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) \
|
||||
|
||||
/*-------------------------------------------------
|
||||
PIXEL_OP_REBASE_TRANSPEN - render all pixels
|
||||
except those matching 'transpen', adding
|
||||
|
@ -574,16 +574,6 @@ void memory_entry::report_unfreed()
|
||||
fprintf(stderr, "--- memory leak warning ---\n");
|
||||
total += entry->m_size;
|
||||
fprintf(stderr, "#%06d, nofree %d bytes (%s:%d)\n", (UINT32)entry->m_id, static_cast<UINT32>(entry->m_size), entry->m_file, (int)entry->m_line);
|
||||
char * p = static_cast<char *>(entry->m_base);
|
||||
for (int i = 0; i< entry->m_size; i++)
|
||||
{
|
||||
char c = p[i];
|
||||
if (c>=32 && c<127)
|
||||
fprintf(stderr, "%c", c);
|
||||
else
|
||||
fprintf(stderr, ".");
|
||||
}
|
||||
fprintf(stderr,"\n");
|
||||
}
|
||||
|
||||
release_lock();
|
||||
|
@ -401,7 +401,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)
|
||||
@ -1338,10 +1338,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);
|
||||
}
|
||||
@ -1704,6 +1701,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;
|
||||
|
985
src/emu/screen.c
985
src/emu/screen.c
File diff suppressed because it is too large
Load Diff
114
src/emu/screen.h
114
src/emu/screen.h
@ -127,104 +127,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 ¶m) { param = m_param; }
|
||||
void set_param(crt_monitor_param ¶m);
|
||||
|
||||
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
|
||||
@ -240,7 +142,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; }
|
||||
@ -295,8 +197,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);
|
||||
@ -306,10 +206,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;
|
||||
@ -385,10 +281,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
|
||||
{
|
||||
@ -420,10 +312,6 @@ private:
|
||||
// static data
|
||||
static UINT32 m_id_counter; // incremented for each constructed screen_device,
|
||||
// used as a unique identifier during runtime
|
||||
|
||||
// monitor emulation
|
||||
|
||||
crt_monitor m_crt;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
|
242
src/emu/ui/ui.c
242
src/emu/ui/ui.c
@ -123,20 +123,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);
|
||||
@ -1919,54 +1905,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())
|
||||
@ -1986,186 +1924,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
|
||||
|
Loading…
Reference in New Issue
Block a user