diff --git a/.gitattributes b/.gitattributes index df94cabe4bd..475ff1d0476 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c index 773589969c0..8402efdcd7b 100644 --- a/src/emu/rendlay.c +++ b/src/emu/rendlay.c @@ -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;ynext, "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 &elemlist) +layout_view::item::item(running_machine &machine, xml_data_node &itemnode, simple_list &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); diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h index a52ca46205f..a780b5a9d6c 100644 --- a/src/emu/rendlay.h +++ b/src/emu/rendlay.h @@ -202,7 +202,7 @@ public: public: // construction/destruction - item(running_machine &machine, xml_data_node &itemnode, simple_list &elemlist); + item(running_machine &machine, xml_data_node &itemnode, simple_list &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 diff --git a/src/mame/drivers/whitestar.c b/src/mame/drivers/whitestar.c index 572e01f890e..63ada3de363 100644 --- a/src/mame/drivers/whitestar.c +++ b/src/mame/drivers/whitestar.c @@ -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 diff --git a/src/mame/layout/whitestar.lay b/src/mame/layout/whitestar.lay new file mode 100644 index 00000000000..9706a4bff9a --- /dev/null +++ b/src/mame/layout/whitestar.lay @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.mak b/src/mame/mame.mak index 6ce9f684890..a3c0f227a71 100644 --- a/src/mame/mame.mak +++ b/src/mame/mame.mak @@ -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