Naoki |
|
|
|
Reged: 11/10/09
|
Posts: 1998
|
Loc: United Kingdom
|
|
Send PM
|
|
|
MAME's Output
#270739 - 12/11/11 11:03 PM
|
|
|
Using MAME Hooker, I've been going through various output-supporting games. One thing which I can never seem to understand is how LED segment displays work in MAME. Are they binary translated into decimal?
|
----
On a quest for Digital 573 and Dancing Stage EuroMix 2
By gods I've found it!
|
|
Naoki |
|
|
|
Reged: 11/10/09
|
Posts: 1998
|
Loc: United Kingdom
|
|
Send PM
|
|
|
Re: MAME's Output
[Re: Naoki]
#270741 - 12/11/11 11:20 PM
|
|
|
Ok, doing a little work on it, I'm assuming my theory was the case. Mainly because:
On the NeoGeo BIOS, I had a number on screen showing "1 22 88". The MAME Hoker output showed 6, 91, 91, 127, 127. I quickly realized this was 7 bit binary and decoded the numbers into: 0000110 1011011 1011011 1111111 1111111
To figure out what this meant in terms of what the display segment showed, I took a guess and assumed it went in a spiral pattern towards the center, so:
Code:
1 __________ | | 32 | | 2 |___64___| | | 16 | | 4 ---------- 8
Using this method I acheived the same display on paper which the NG bios showed.
So, my findings are correct right?
|
----
On a quest for Digital 573 and Dancing Stage EuroMix 2
By gods I've found it!
|
|
|
Re: MAME's Output
[Re: Naoki]
#270742 - 12/12/11 12:08 AM
|
|
|
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
|
|
Naoki |
|
|
|
Reged: 11/10/09
|
Posts: 1998
|
Loc: United Kingdom
|
|
Send PM
|
|
|
|
So, with Beatmania IIDX which uses 16-Seg displays, I'm assuming the process is similar, but not sure on order, but my guess would be:
[ATTACHED IMAGE]
|
----
On a quest for Digital 573 and Dancing Stage EuroMix 2
By gods I've found it!
|
|
Naoki |
|
|
|
Reged: 11/10/09
|
Posts: 1998
|
Loc: United Kingdom
|
|
Send PM
|
|
|
Re: MAME's Output
[Re: Naoki]
#270745 - 12/12/11 01:07 AM
|
|
|
I think I could be wrong with my suggestion since testing it on Beatmania IIDX returns:
Code:
----- | | | | |/ | -----
When powered, but with testing it changes to:
Code:
----- | | | | | | -----
|
----
On a quest for Digital 573 and Dancing Stage EuroMix 2
By gods I've found it!
|
|
|
Re: MAME's Output
[Re: Naoki]
#270749 - 12/12/11 02:04 AM
|
|
|
|
Naoki |
|
|
|
Reged: 11/10/09
|
Posts: 1998
|
Loc: United Kingdom
|
|
Send PM
|
|
|
|
It's alright now. I went through the pain stakingly long manual process of elimination but I finally have usable info. The inner process is just double on the opposite side
EDIT: Actually I think 8192 and 16384 are in the wrong places, but just swap the numbers in each other's place and it's right.
[ATTACHED IMAGE]
Edited by Naoki (12/12/11 02:20 AM)
|
----
On a quest for Digital 573 and Dancing Stage EuroMix 2
By gods I've found it!
|
|
|
Re: MAME's Output
[Re: Naoki]
#271008 - 12/15/11 04:36 PM
|
|
|
I think this thread has potential, I'd be interested to see other outputs explained.
I'd also be interested to see more outputs hooked up.
|
http://www.youtube.com/retrorepair
|
|
|