Looking at the source for rendlay.c, you definitely have the order correct. The representation is an 8-bit bitmap where a one indicates an "on" segment. The first seven bits represent the segments you've identified, while the eighth bit is used for a decimal point segment.
Code:
//------------------------------------------------- // draw_led7seg - draw a 7-segment LCD //-------------------------------------------------
void layout_element::component::draw_led7seg(bitmap_t &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 = 250; int bmheight = 400; int segwidth = 40; int skewwidth = 40;
// allocate a temporary bitmap for drawing bitmap_t *tempbitmap = global_alloc(bitmap_t(bmwidth + skewwidth, bmheight, BITMAP_FORMAT_ARGB32)); bitmap_fill(tempbitmap, NULL, MAKE_ARGB(0xff,0x00,0x00,0x00));
// 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);
// middle bar draw_segment_horizontal(*tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight/2, segwidth, (pattern & (1 << 6)) ? onpen : offpen);
// apply skew apply_skew(*tempbitmap, 40);
// decimal point draw_segment_decimal(*tempbitmap, bmwidth + segwidth/2, bmheight - segwidth/2, segwidth, (pattern & (1 << 7)) ? onpen : offpen);
// resample to the target size render_resample_argb_bitmap_hq(dest.base, dest.rowpixels, dest.width, dest.height, tempbitmap, NULL, &m_color);
global_free(tempbitmap); }
GroovyMAME support forum on BYOAC
|