From 928a8a45860babe87803d652fbf1242bcaea62d6 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Sun, 13 May 2012 01:27:25 +0000 Subject: [PATCH] This is phase 2 of the DMD changes, creating a new '5 dot' element to make it more like the actual DM01 (which uses 5 by 7 blocks, but wires them up row wise to a buffer, giving an unusual '65 dot row') [James Wallace]. --- src/emu/rendlay.c | 28 +- src/emu/rendlay.h | 3 +- src/mame/layout/awpdmd.lay | 2035 ++++++++++++++++++++++-------------- src/mame/video/bfm_dm01.c | 52 +- 4 files changed, 1322 insertions(+), 796 deletions(-) diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c index 005383a0b3b..2b21b9adccd 100644 --- a/src/emu/rendlay.c +++ b/src/emu/rendlay.c @@ -482,6 +482,8 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode m_maxstate = 262143; if (newcomp.m_type == component::CTYPE_DOTMATRIX) m_maxstate = 255; + if (newcomp.m_type == component::CTYPE_DOTMATRIX5DOT) + m_maxstate = 31; if (newcomp.m_type == component::CTYPE_SIMPLECOUNTER) { m_maxstate = xml_get_attribute_int_with_subst(machine, *compnode, "maxstate", 999); @@ -644,8 +646,13 @@ layout_element::component::component(running_machine &machine, xml_data_node &co // dotmatrix nodes else if (strcmp(compnode.name, "dotmatrix") == 0) + { m_type = CTYPE_DOTMATRIX; - + } + else if (strcmp(compnode.name, "dotmatrix5dot") == 0) + { + m_type = CTYPE_DOTMATRIX5DOT; + } // simplecounter nodes else if (strcmp(compnode.name, "simplecounter") == 0) { @@ -798,7 +805,11 @@ void layout_element::component::draw(running_machine &machine, bitmap_argb32 &de break; case CTYPE_DOTMATRIX: - draw_dotmatrix(dest, bounds, state); + draw_dotmatrix(8, dest, bounds, state); + break; + + case CTYPE_DOTMATRIX5DOT: + draw_dotmatrix(5, dest, bounds, state); break; case CTYPE_SIMPLECOUNTER: @@ -1720,25 +1731,24 @@ void layout_element::component::draw_led16segsc(bitmap_argb32 &dest, const recta //------------------------------------------------- -// draw_dotmatrix - draw a row of 8 dots for a +// draw_dotmatrix - draw a row of dots for a // dotmatrix //------------------------------------------------- -void layout_element::component::draw_dotmatrix(bitmap_argb32 &dest, const rectangle &bounds, int pattern) +void layout_element::component::draw_dotmatrix(int dots, bitmap_argb32 &dest, const rectangle &bounds, int pattern) { const rgb_t onpen = MAKE_ARGB(0xff, 0xff, 0xff, 0xff); const rgb_t offpen = MAKE_ARGB(0xff, 0x20, 0x20, 0x20); // sizes for computation - int bmwidth = 2000; int bmheight = 300; int dotwidth = 250; // allocate a temporary bitmap for drawing - bitmap_argb32 tempbitmap(bmwidth, bmheight); + bitmap_argb32 tempbitmap(dotwidth*dots, bmheight); tempbitmap.fill(MAKE_ARGB(0xff, 0x00, 0x00, 0x00)); - for (int i = 0; i < 8; i++) + for (int i = 0; i < dots; i++) draw_segment_decimal(tempbitmap, ((dotwidth/2 )+ (i * dotwidth)), bmheight/2, dotwidth, (pattern & (1 << i))?onpen:offpen); // resample to the target size @@ -1814,7 +1824,7 @@ void layout_element::component::draw_segment_vertical(bitmap_argb32 &dest, int m //------------------------------------------------- // draw_segment_diagonal_1 - draw a diagonal -// LED segment that looks like this: / +// LED segment that looks like a backslash //------------------------------------------------- void layout_element::component::draw_segment_diagonal_1(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color) @@ -1839,7 +1849,7 @@ void layout_element::component::draw_segment_diagonal_1(bitmap_argb32 &dest, int //------------------------------------------------- // draw_segment_diagonal_2 - draw a diagonal -// LED segment that looks like this: +// LED segment that looks like a forward slash //------------------------------------------------- void layout_element::component::draw_segment_diagonal_2(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color) diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h index 366e44fe2cb..a4716d5a918 100644 --- a/src/emu/rendlay.h +++ b/src/emu/rendlay.h @@ -121,6 +121,7 @@ private: CTYPE_LED14SEGSC, CTYPE_LED16SEGSC, CTYPE_DOTMATRIX, + CTYPE_DOTMATRIX5DOT, CTYPE_SIMPLECOUNTER, CTYPE_REEL, CTYPE_MAX @@ -139,7 +140,7 @@ private: void draw_led14segsc(bitmap_argb32 &dest, const rectangle &bounds, int pattern); void draw_led16seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern); void draw_led16segsc(bitmap_argb32 &dest, const rectangle &bounds, int pattern); - void draw_dotmatrix(bitmap_argb32 &dest, const rectangle &bounds, int pattern); + void draw_dotmatrix(int dots,bitmap_argb32 &dest, const rectangle &bounds, int pattern); void draw_segment_horizontal_caps(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, int caps, rgb_t color); void draw_segment_horizontal(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, rgb_t color); void draw_segment_vertical_caps(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, int caps, rgb_t color); diff --git a/src/mame/layout/awpdmd.lay b/src/mame/layout/awpdmd.lay index db41557678b..795ccae38fe 100644 --- a/src/mame/layout/awpdmd.lay +++ b/src/mame/layout/awpdmd.lay @@ -14,10 +14,10 @@ - - + + - + @@ -27,574 +27,825 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -1095,7 +1346,7 @@ - + @@ -1143,7 +1394,7 @@ - + @@ -1191,7 +1442,7 @@ - + @@ -1239,7 +1490,7 @@ - + @@ -1287,7 +1538,7 @@ - + @@ -1335,7 +1586,7 @@ - + @@ -1385,572 +1636,824 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/video/bfm_dm01.c b/src/mame/video/bfm_dm01.c index ef8f8da24f6..8b27ca2e573 100644 --- a/src/mame/video/bfm_dm01.c +++ b/src/mame/video/bfm_dm01.c @@ -59,11 +59,12 @@ typedef struct _dm01 { const bfmdm01_interface *intf; int data_avail, - control, /* motor phase */ + control, xcounter, busy; UINT8 scanline[DM_BYTESPERROW], + segbuffer[72], comdata; } bfmdm01; @@ -148,8 +149,8 @@ static WRITE8_HANDLER( mux_w ) dm01.scanline[8] &= 0x80;//filter all other bits if ( (row >= 0) && (row < DM_MAXLINES) ) { - int p,dots; - + int p,pos,dots; + pos =0; p = 0; dots = 0; @@ -157,25 +158,36 @@ static WRITE8_HANDLER( mux_w ) { UINT8 d = dm01.scanline[p]; - if (d & 0x80) dots |= 0x01; - else dots &=~0x01; - if (d & 0x40) dots |= 0x02; - else dots &=~0x02; - if (d & 0x20) dots |= 0x04; - else dots &=~0x04; - if (d & 0x10) dots |= 0x08; - else dots &=~0x08; - if (d & 0x08) dots |= 0x10; - else dots &=~0x10; - if (d & 0x04) dots |= 0x20; - else dots &=~0x20; - if (d & 0x02) dots |= 0x40; - else dots &=~0x40; - if (d & 0x01) dots |= 0x80; - else dots &=~0x80; - output_set_indexed_value("dotmatrix", p +(9*row), dots); + + for (int bitpos=0; bitpos <8; bitpos++) + { + if (d & 1<<(7-bitpos)) dm01.segbuffer[(p*8)+bitpos]=1; + else dm01.segbuffer[(p*8)+bitpos]=0; + } + p++; } + + while ( pos < 13 ) + { + int element =0; + for (int dotpos=0; dotpos <5; dotpos++) + { + if (dm01.segbuffer[(pos*5)+dotpos]) + { + element |= (1<<(dotpos)); + } + else + { + element &= ~(1<<(dotpos)); + } + + } + output_set_indexed_value("dotmatrix", pos +(13*row), element); + pos++; + } + + } } }