summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar jbu <pullmoll@t-online.de>2014-12-06 21:20:12 +0100
committerGravatarGravatar jbu <pullmoll@t-online.de>2014-12-06 21:20:12 +0100
commitc34386509d1ba5a91426c814ea7c49a3d06fc697 (patch) (github)
treee19b7214b8d8d2bfe85851c2f6b40f6f371c12cb
parentbb7ce2296aef09cbddeb6b6cd07dee77907b5cf7 (diff)
downloadmame-c34386509d1ba5a91426c814ea7c49a3d06fc697.tar.bz2
mame-c34386509d1ba5a91426c814ea7c49a3d06fc697.zip
Add led8seg (Futaba) and use in gts1.lay
-rw-r--r--src/emu/rendlay.c64
-rw-r--r--src/emu/rendlay.h2
-rw-r--r--src/mame/drivers/gts1.c4
-rw-r--r--src/mame/mame.mak1
4 files changed, 69 insertions, 2 deletions
diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c
index 2f9393180e1..107084ced85 100644
--- a/src/emu/rendlay.c
+++ b/src/emu/rendlay.c
@@ -677,6 +677,10 @@ layout_element::component::component(running_machine &machine, xml_data_node &co
else if (strcmp(compnode.name, "led7seg") == 0)
m_type = CTYPE_LED7SEG;
+ // led8seg nodes
+ else if (strcmp(compnode.name, "led8seg") == 0)
+ m_type = CTYPE_LED8SEG;
+
// led14seg nodes
else if (strcmp(compnode.name, "led14seg") == 0)
m_type = CTYPE_LED14SEG;
@@ -749,6 +753,10 @@ void layout_element::component::draw(running_machine &machine, bitmap_argb32 &de
draw_led7seg(dest, bounds, state);
break;
+ case CTYPE_LED8SEG:
+ draw_led8seg(dest, bounds, state);
+ break;
+
case CTYPE_LED14SEG:
draw_led14seg(dest, bounds, state);
break;
@@ -1399,6 +1407,62 @@ void layout_element::component::draw_led7seg(bitmap_argb32 &dest, const rectangl
}
+//------------------------------------------------------
+// draw_led8seg - draw a 8-segment fluorescent (Futaba)
+//------------------------------------------------------
+
+void layout_element::component::draw_led8seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern)
+{
+ const rgb_t onpen = rgb_t(0xff,0xff,0xff,0xff);
+ const rgb_t offpen = rgb_t(0xff,0x20,0x20,0x20);
+ const rgb_t backpen = rgb_t(0xff,0x00,0x00,0x00);
+
+ // sizes for computation
+ int bmwidth = 250;
+ int bmheight = 400;
+ int segwidth = 40;
+ int skewwidth = 40;
+
+ // allocate a temporary bitmap for drawing
+ bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight);
+ tempbitmap.fill(backpen);
+
+ // top bar
+ draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 0)) ? onpen : offpen);
+
+ // top-right bar
+ draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 1)) ? onpen : offpen);
+
+ // bottom-right bar
+ draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 2)) ? onpen : offpen);
+
+ // bottom bar
+ draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, segwidth, (pattern & (1 << 3)) ? onpen : offpen);
+
+ // bottom-left bar
+ draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 4)) ? onpen : offpen);
+
+ // top-left bar
+ draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 5)) ? onpen : offpen);
+
+ // horizontal bars
+ draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, 2*bmwidth/3 - 2*segwidth/3, bmheight/2, segwidth, (pattern & (1 << 6)) ? onpen : offpen);
+ draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3 + bmwidth/2, bmwidth - 2*segwidth/3, bmheight/2, segwidth, (pattern & (1 << 6)) ? onpen : offpen);
+
+ // vertical bars
+ draw_segment_vertical(tempbitmap, 0 + segwidth/3 - 8, bmheight/2 - segwidth/3 + 2, 2*bmwidth/3 - segwidth/2 - 4, segwidth + 8, backpen);
+ draw_segment_vertical(tempbitmap, 0 + segwidth/3, bmheight/2 - segwidth/3, 2*bmwidth/3 - segwidth/2 - 4, segwidth, (pattern & (1 << 7)) ? onpen : offpen);
+
+ draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3 - 2, bmheight - 2*segwidth/3 + 4, 2*bmwidth/3 - segwidth/2 - 4, segwidth + 8, backpen);
+ draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 2*bmwidth/3 - segwidth/2 - 4, segwidth, (pattern & (1 << 7)) ? onpen : offpen);
+
+ // apply skew
+ apply_skew(tempbitmap, 40);
+
+ // resample to the target size
+ render_resample_argb_bitmap_hq(dest, tempbitmap, m_color);
+}
+
//-------------------------------------------------
// draw_led14seg - draw a 14-segment LCD
//-------------------------------------------------
diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h
index acd4b4407ab..d169a860602 100644
--- a/src/emu/rendlay.h
+++ b/src/emu/rendlay.h
@@ -87,6 +87,7 @@ private:
CTYPE_DISK,
CTYPE_TEXT,
CTYPE_LED7SEG,
+ CTYPE_LED8SEG,
CTYPE_LED14SEG,
CTYPE_LED16SEG,
CTYPE_LED14SEGSC,
@@ -109,6 +110,7 @@ private:
void load_bitmap();
void load_reel_bitmap(int number);
void draw_led7seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern);
+ void draw_led8seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern);
void draw_led14seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern);
void draw_led14segsc(bitmap_argb32 &dest, const rectangle &bounds, int pattern);
void draw_led16seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern);
diff --git a/src/mame/drivers/gts1.c b/src/mame/drivers/gts1.c
index ba2e9df0a5c..56f665c95a5 100644
--- a/src/mame/drivers/gts1.c
+++ b/src/mame/drivers/gts1.c
@@ -68,7 +68,7 @@ ToDo:
#include "machine/genpin.h"
#include "cpu/pps4/pps4.h"
-//#include "gts1.lh"
+#include "gts1.lh"
#define VERBOSE 1
@@ -233,7 +233,7 @@ static MACHINE_CONFIG_START( gts1, gts1_state )
//MCFG_NVRAM_ADD_0FILL("nvram")
/* Video */
- //MCFG_DEFAULT_LAYOUT(layout_gts1)
+ MCFG_DEFAULT_LAYOUT(layout_gts1)
/* Sound */
MCFG_FRAGMENT_ADD( genpin_audio )
diff --git a/src/mame/mame.mak b/src/mame/mame.mak
index 8891e690d3c..300a071e9c8 100644
--- a/src/mame/mame.mak
+++ b/src/mame/mame.mak
@@ -2650,6 +2650,7 @@ $(DRIVERS)/goldnpkr.o: $(LAYOUT)/goldnpkr.lh \
$(LAYOUT)/pmpoker.lh \
$(LAYOUT)/upndown.lh
+$(DRIVERS)/gts1.o: $(LAYOUT)/gts1.lh
$(DRIVERS)/gts3.o: $(LAYOUT)/gts3.lh
$(DRIVERS)/gts80.o: $(LAYOUT)/gts80.lh
$(DRIVERS)/gts80a.o: $(LAYOUT)/gts80a.lh