mirror of
https://github.com/holub/mame
synced 2025-05-21 05:08:54 +03:00
Added render layout repeating elements and made whitestar pinball use it (no whatsnew)
Comments are welcomed
This commit is contained in:
parent
3902c4f83d
commit
d662684539
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -3827,6 +3827,7 @@ src/mame/layout/videodad.lay svneol=native#text/plain
|
||||
src/mame/layout/videopin.lay svneol=native#text/plain
|
||||
src/mame/layout/videopkr.lay svneol=native#text/plain
|
||||
src/mame/layout/wecleman.lay svneol=native#text/plain
|
||||
src/mame/layout/whitestar.lay svneol=native#text/plain
|
||||
src/mame/layout/wildone.lay svneol=native#text/plain
|
||||
src/mame/machine/3do.c svneol=native#text/plain
|
||||
src/mame/machine/acitya.c svneol=native#text/plain
|
||||
|
@ -1690,8 +1690,19 @@ layout_view::layout_view(running_machine &machine, xml_data_node &viewnode, simp
|
||||
parse_bounds(machine, xml_get_sibling(boundsnode, "bounds"), m_expbounds);
|
||||
|
||||
// load backdrop items
|
||||
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "backdrop"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "backdrop"))
|
||||
m_backdrop_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
|
||||
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "backdrop"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "backdrop")) {
|
||||
int repeatx = xml_get_attribute_int_with_subst(machine, *itemnode, "repeatx", 0);
|
||||
int repeaty = xml_get_attribute_int_with_subst(machine, *itemnode, "repeaty", 0);
|
||||
if (repeatx!=0 && repeaty!=0) {
|
||||
for(int y=0;y<repeaty;y++) {
|
||||
for(int x=0;x<repeatx;x++) {
|
||||
m_backdrop_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist, x, y)));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m_backdrop_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
|
||||
}
|
||||
}
|
||||
|
||||
// load screen items
|
||||
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "screen"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "screen"))
|
||||
@ -1855,16 +1866,24 @@ void layout_view::recompute(render_layer_config layerconfig)
|
||||
// item - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
layout_view::item::item(running_machine &machine, xml_data_node &itemnode, simple_list<layout_element> &elemlist)
|
||||
layout_view::item::item(running_machine &machine, xml_data_node &itemnode, simple_list<layout_element> &elemlist,int rep_x, int rep_y)
|
||||
: m_next(NULL),
|
||||
m_element(NULL),
|
||||
m_input_mask(0),
|
||||
m_screen(NULL),
|
||||
m_orientation(ROT0)
|
||||
{
|
||||
// allocate a copy of the output name
|
||||
m_output_name = xml_get_attribute_string_with_subst(machine, itemnode, "name", "");
|
||||
char buff[256];
|
||||
m_repeatx = xml_get_attribute_int_with_subst(machine, itemnode, "repeatx", 0);
|
||||
m_repeaty = xml_get_attribute_int_with_subst(machine, itemnode, "repeaty", 0);
|
||||
|
||||
// allocate a copy of the output name
|
||||
if (m_repeatx!=0 && m_repeaty!=0) {
|
||||
sprintf(buff, "%s%d",xml_get_attribute_string_with_subst(machine, itemnode, "name", ""),rep_y * m_repeatx + rep_x);
|
||||
m_output_name = buff;
|
||||
} else {
|
||||
m_output_name = xml_get_attribute_string_with_subst(machine, itemnode, "name", "");
|
||||
}
|
||||
// allocate a copy of the input tag
|
||||
m_input_tag = xml_get_attribute_string_with_subst(machine, itemnode, "inputtag", "");
|
||||
|
||||
@ -1890,6 +1909,17 @@ layout_view::item::item(running_machine &machine, xml_data_node &itemnode, simpl
|
||||
if (m_output_name[0] != 0 && m_element != NULL)
|
||||
output_set_value(m_output_name, m_element->default_state());
|
||||
parse_bounds(machine, xml_get_sibling(itemnode.child, "bounds"), m_rawbounds);
|
||||
// recalc bounds
|
||||
if (m_repeatx!=0 && m_repeaty!=0) {
|
||||
float w = m_rawbounds.x1 - m_rawbounds.x0;
|
||||
float h = m_rawbounds.y1 - m_rawbounds.y0;
|
||||
m_rawbounds.x0 = m_rawbounds.x0 + w * rep_x;
|
||||
m_rawbounds.x1 = m_rawbounds.x1 + w * rep_x;
|
||||
|
||||
m_rawbounds.y0 = m_rawbounds.y0 + h * rep_y;
|
||||
m_rawbounds.y1 = m_rawbounds.y1 + h * rep_y;
|
||||
}
|
||||
|
||||
parse_color(machine, xml_get_sibling(itemnode.child, "color"), m_color);
|
||||
parse_orientation(machine, xml_get_sibling(itemnode.child, "orientation"), m_orientation);
|
||||
|
||||
|
@ -202,7 +202,7 @@ public:
|
||||
|
||||
public:
|
||||
// construction/destruction
|
||||
item(running_machine &machine, xml_data_node &itemnode, simple_list<layout_element> &elemlist);
|
||||
item(running_machine &machine, xml_data_node &itemnode, simple_list<layout_element> &elemlist, int rep_x = 0, int rep_y = 0);
|
||||
virtual ~item();
|
||||
|
||||
// getters
|
||||
@ -231,6 +231,8 @@ public:
|
||||
render_bounds m_bounds; // bounds of the item
|
||||
render_bounds m_rawbounds; // raw (original) bounds of the item
|
||||
render_color m_color; // color of the item
|
||||
int m_repeatx; // repeating element on horizontal
|
||||
int m_repeaty; // repeating element on vertical
|
||||
};
|
||||
|
||||
// construction/destruction
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "emu.h"
|
||||
#include "video/mc6845.h"
|
||||
#include "audio/decobsmt.h"
|
||||
#include "whitestar.lh"
|
||||
#include "rendlay.h"
|
||||
|
||||
class whitestar_state : public driver_device
|
||||
@ -198,7 +199,7 @@ MC6845_UPDATE_ROW( whitestar_update_row )
|
||||
val = BITSWAP16(val,15,7,14,6,13,5,12,4,11,3,10,2,9,1,8,0);
|
||||
|
||||
for(xi=0;xi<8;xi++)
|
||||
*BITMAP_ADDR16(bitmap, ra, x*8 + xi) = (val>>(14-xi*2)) & 0x03;
|
||||
output_set_indexed_value("dmd", ra*128 + x*8+xi, (val>>(14-xi*2)) & 0x03);
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,14 +217,6 @@ static const mc6845_interface whitestar_crtc6845_interface =
|
||||
NULL
|
||||
};
|
||||
|
||||
static PALETTE_INIT( whitestar )
|
||||
{
|
||||
palette_set_color(machine, 0, MAKE_RGB(0, 0, 0));
|
||||
palette_set_color(machine, 1, MAKE_RGB(84, 73, 10));
|
||||
palette_set_color(machine, 2, MAKE_RGB(168, 147, 21));
|
||||
palette_set_color(machine, 3, MAKE_RGB(255, 224, 32));
|
||||
}
|
||||
|
||||
bool whitestar_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_mc6845->update(&bitmap, &cliprect);
|
||||
@ -247,18 +240,19 @@ static MACHINE_CONFIG_START( whitestar, whitestar_state )
|
||||
|
||||
MCFG_MC6845_ADD("mc6845", MC6845, 2000000, whitestar_crtc6845_interface)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_DEFAULT_LAYOUT(layout_whitestar)
|
||||
|
||||
/* video hardware */
|
||||
// Just a fake screen so mc6845 would update
|
||||
MCFG_SCREEN_ADD("screen", LCD)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
|
||||
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MCFG_SCREEN_SIZE( 128, 32 )
|
||||
MCFG_SCREEN_VISIBLE_AREA( 0, 128-1, 0, 32-1 )
|
||||
|
||||
MCFG_DEFAULT_LAYOUT( layout_lcd )
|
||||
|
||||
MCFG_PALETTE_LENGTH(4)
|
||||
MCFG_PALETTE_INIT(whitestar)
|
||||
MCFG_PALETTE_LENGTH(2)
|
||||
MCFG_PALETTE_INIT(black_and_white)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
// 8Mbit ROMs are mapped oddly: the first 4Mbit of each of the ROMs goes in order u17, u21, u36, u37
|
||||
|
30
src/mame/layout/whitestar.lay
Normal file
30
src/mame/layout/whitestar.lay
Normal file
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0"?>
|
||||
<mamelayout version="2">
|
||||
<element name="dmdlamp">
|
||||
<disk state="0">
|
||||
<bounds x="0" y="0" width="5" height="5" />
|
||||
<color red="0.07" green="0.07" blue="0.00" />
|
||||
</disk>
|
||||
<disk state="1">
|
||||
<bounds x="0" y="0" width="5" height="5" />
|
||||
<color red="0.33" green="0.28" blue="0.04" />
|
||||
</disk>
|
||||
<disk state="2">
|
||||
<bounds x="0" y="0" width="5" height="5" />
|
||||
<color red="0.66" green="0.57" blue="0.08" />
|
||||
</disk>
|
||||
<disk state="3">
|
||||
<bounds x="0" y="0" width="5" height="5" />
|
||||
<color red="1.00" green="0.88" blue="0.13" />
|
||||
</disk>
|
||||
</element>
|
||||
<view name="DMD Only">
|
||||
<backdrop name="dmd" element="dmdlamp" state="0" repeatx="128" repeaty="32">
|
||||
<bounds x="0" y="0" width="2" height="2"/>
|
||||
</backdrop>
|
||||
<!-- Need fake screen for Motorola 6845 -->
|
||||
<screen index="0">
|
||||
<bounds left="0" top="0" right="4" bottom="3" />
|
||||
</screen>
|
||||
</view>
|
||||
</mamelayout>
|
@ -2125,6 +2125,8 @@ $(DRIVERS)/warpwarp.o: $(LAYOUT)/geebee.lh \
|
||||
$(LAYOUT)/navarone.lh \
|
||||
$(LAYOUT)/sos.lh
|
||||
|
||||
$(DRIVERS)/whitestar.o: $(LAYOUT)/whitestar.lh
|
||||
|
||||
$(DRIVERS)/wecleman.o: $(LAYOUT)/wecleman.lh
|
||||
|
||||
$(DRIVERS)/zac2650.o: $(LAYOUT)/tinv2650.lh
|
||||
|
Loading…
Reference in New Issue
Block a user