MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

Parduz
Reged: 01/08/08
Posts: 30
Loc: Bologna, ITALY
Send PM


Understanding Clickable LAYout elements
#393545 - 03/21/22 02:47 AM


I'm trying to make a clickable layout for the ensoniq SQ1 (esq5505.cpp and esq2by16.lay) using the psr60 as example.

I'm pretty sure i'm missing something but i can't understand what. Whatever i do, my buttons are not working, i'm not even sure they get the "Click" event.

This is part of my current LAYout file (edited 'cause the forum code doesn't allow the XML tags):


Code:


-element ref="button-sml" inputtag="KEY1" inputmask="0x1000" >-bounds x="85" y="40" width="9" height="3" />-/element>-!-- PORT_NAME("ENTER") // 172=ENTER -->



and this is the relevant part of the esq5505.cpp file:

Code:


PORT_START("KEY1")
...
PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 172) PORT_NAME("ENTER") // 172=ENTER



The keyboard keys are working, but my clickable buttons don't.

What am i doing wrong?
What it is that i don't understand?



Mr. DoAdministrator
MAME Art Editor
Reged: 09/21/03
Posts: 4870
Loc: California
Send PM


Re: Understanding Clickable LAYout elements new [Re: Parduz]
#393551 - 03/21/22 06:18 PM


> I'm trying to make a clickable layout for the ensoniq SQ1 (esq5505.cpp and
> esq2by16.lay) using the psr60 as example.
>
> I'm pretty sure i'm missing something but i can't understand what. Whatever i do, my
> buttons are not working, i'm not even sure they get the "Click" event.
>
> This is part of my current LAYout file (edited 'cause the forum code doesn't allow
> the XML tags):
>
>

<element ref="button-sml" inputtag="KEY1" inputmask="0x1000">
<bounds x="85" y="40" width="9" height="3"/>
</element>-!-- PORT_NAME("ENTER") // 172=ENTER -->

>
>
> and this is the relevant part of the esq5505.cpp file:
>
> PORT_START("KEY1")
> ...
> PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER)
> PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 172) PORT_NAME("ENTER")
> // 172=ENTER
>
>
> The keyboard keys are working, but my clickable buttons don't.
>
> What am i doing wrong?
> What it is that i don't understand?


Tip 1... you can enter code, if you change the "Make Post" dropdown to "without UBBCode/HTML"

Assuming you have the element named earlier in the LAY file? For example:

<element name="button-sml" defstate="0"></element>

If no... that's gotta be in there also. If yes... PM me the actual file if you can, and I can look at it tonight, see what I can figure out.




RELAX and just have fun. Remember, it's all about the games.




Parduz
Reged: 01/08/08
Posts: 30
Loc: Bologna, ITALY
Send PM


Re: Understanding Clickable LAYout elements new [Re: Mr. Do]
#393552 - 03/22/22 12:31 AM


Yup, i think it is defined.

PM with link to the files sent.

Thanks a lot.



Mr. DoAdministrator
MAME Art Editor
Reged: 09/21/03
Posts: 4870
Loc: California
Send PM


Re: Understanding Clickable LAYout elements new [Re: Parduz]
#393553 - 03/22/22 02:09 AM


> Yup, i think it is defined.
>
> PM with link to the files sent.
>
> Thanks a lot.

Okay... I think I see the first part.

The name of the LAY file you have... esq2by16.lay... is just the name for the internal source for the LAY file for MAME.

I'm going to assume you are testing this as external artwork for now, to see that everything works? (Before you submit a source change?)

To use this as external artwork:
-- rename it to "default.lay"
-- add it to zip file named "sq1.zip", and put that in the \artwork folder of your MAME directory (assuming defaults).

I'm playing with it right now, and all of the buttons "do stuff." I don't know all about how this keyboard works yet, but all of the LEDs do something different for each button I click.

Also, make sure you are in Windowed mode, to use the mouse arrow to click buttons.

To answer your other questions... I think it is because the driver is incomplete (marked "MACHINE NOT WORKING").

Side note... just noticed... the button for "ROM/INT SELECT -" is hiding under the fifth row of LEDs, the way the layout is currently structured.




RELAX and just have fun. Remember, it's all about the games.




Parduz
Reged: 01/08/08
Posts: 30
Loc: Bologna, ITALY
Send PM


Re: Understanding Clickable LAYout elements new [Re: Mr. Do]
#393556 - 03/22/22 11:39 AM



Quote:


The name of the LAY file you have... esq2by16.lay... is just the name for the internal source for the LAY file for MAME.

To use this as external artwork:
-- rename it to "default.lay"
-- add it to zip file named "sq1.zip", and put that in the \artwork folder of your MAME directory (assuming defaults).




Wait .... so i don't have to make MAME again each time i modify the LAY file???



Quote:


I'm going to assume you are testing this as external artwork for now, to see that everything works? (Before you submit a source change?)



The plan is to make the "interface" of the synth workable: right now MAME use the PC keyboard to press the synth buttons: by using the mouse to click on buttons i can free the PC keys to play the synth keys.

Right now i just compile MAME again (just for the 5505 driver) each time i want to try the layout.



Quote:


Side note... just noticed... the button for "ROM/INT SELECT -" is hiding under the fifth row of LEDs, the way the layout is currently structured.



That's because i'm still trying to guess what the LCD should do. The 4 "16x2" LCD represents each one memory "page", and i'm struggling to get what some 2-bytes-command-codes sent to the display are supposed to do.
Once i'm done with it i'll draw a layout a bit nicer.



Quote:


I'm playing with it right now, and all of the buttons "do stuff." I don't know all about how this keyboard works yet, but all of the LEDs do something different for each button I click.




That's weird.... on my PC it does'nt work at all.


Quote:


To answer your other questions... I think it is because the driver is incomplete (marked "MACHINE NOT WORKING").




Understanding MAME is hard... i thought that the I/O ports were known (so, where the keys are), but not emulated or managed if not with hacks.

Thanks for your help



Robbbert
Sir
Reged: 08/21/04
Posts: 3194
Loc: A long way from you
Send PM


Re: Understanding Clickable LAYout elements new [Re: Parduz]
#393561 - 03/22/22 01:13 PM


> Wait .... so i don't have to make MAME again each time i modify the LAY file???

If you're modifying a lay file that lives in src/mame/layout, then you need to make MAME. Otherwise, no, it will just start working (or doing something), as long as the layout is in a folder specified in artpath.


Pages: 1

MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 15 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 429