MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

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


Artwork based on dipswitch setting?
#385042 - 01/18/20 08:02 PM


This is one of those "I never thought to ask before" questions.

Is it possible in the artwork system today, to change state of artwork, based on a dipswitch setting? And if not today, maybe later?

Example 1: many games have a DS to change the score needed for free man or extended gameplay (e.g. Clowns, Guided Missile, etc.)

Example 2: some games have a DS to change cabinet type (cocktail vs upright), which necessitates choosing a whole different artwork setup (View). (e.g. Breakout, Warlords).

Would be cool if the state of the necessary DS could be captured, to apply the correct artwork, rather than having to manually add a separate view for each setting (at least in the case of the score setting).




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




hap
Reged: 12/01/08
Posts: 296
Send PM


Re: Artwork based on dipswitch setting? new [Re: Mr. Do]
#385043 - 01/18/20 08:38 PM


A dipswitch is an input port. It already was(still is) possible to change an artwork element state based on the value of an input port.

You'll need to add a dummy mask if you don't want the element to act as a clickable 'button'. And if the dipswitch is more than 1bit, you need to use inputraw="1".

See ccmk5 for example, where I use a language selection input port that also changes the the labels in the artwork.



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


Re: Artwork based on dipswitch setting? new [Re: hap]
#385044 - 01/18/20 11:08 PM


> A dipswitch is an input port. It already was(still is) possible to change an artwork
> element state based on the value of an input port.
>
> You'll need to add a dummy mask if you don't want the element to act as a clickable
> 'button'. And if the dipswitch is more than 1bit, you need to use inputraw="1".
>
> See ccmk5 for example, where I use a language selection input port that also changes
> the the labels in the artwork.


Cool! Think I got it... hit one more snag, though.

See attached sample for Guided Missile.

inputmask is set based on values in lines 1522-1525 of mw8080bw.cpp

Except that as currently setup, artwork displays 1300 when expecting 1000, and vice versa. If I flip the inputmask on those two, the artwork displays 1300 for both settings.

I'm guessing this is because two DIPLOCATIONS are involved in this one? What extra step do I need to take here?




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




hap
Reged: 12/01/08
Posts: 296
Send PM


Re: Artwork based on dipswitch setting? new [Re: Mr. Do]
#385045 - 01/18/20 11:32 PM


I don't see any attachment.
Also, I forgot to mention that the value is rightshifted, so state values are 0,1,2,3, and not 0,0x10,0x20,0x30.



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


Re: Artwork based on dipswitch setting? new [Re: hap]
#385046 - 01/18/20 11:38 PM Attachment: gmissile.zip 20 KB (6 downloads)


> I don't see any attachment.
> Also, I forgot to mention that the value is rightshifted, so state values are
> 0,1,2,3, and not 0,0x10,0x20,0x30.

Whoops... let's try that attachment again.




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




hap
Reged: 12/01/08
Posts: 296
Send PM


Re: Artwork based on dipswitch setting? new [Re: Mr. Do]
#385048 - 01/19/20 12:03 PM Attachment: default.lay 2 KB (9 downloads)


Ok, see attachment for changed .lay file



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


Re: Artwork based on dipswitch setting? new [Re: hap]
#385051 - 01/19/20 07:18 PM


> Ok, see attachment for changed .lay file


Ok... got it now...

I was a bit confused, as how things are setup in ccmk5 was a bit different. I was trying to add French language to work also, but after seeing this, now I get the concept.

Thank you!!

And side question... since we're talking about this stuff...

Pretty sure the answer is no... but...

Is there any way to show a single unique image when two inputs are active at the same time, and not show the images that are tied to those single inputs?

i.e. is it possible to show a joystick in the up-left diagonal, without also showing the up and left image?

Edited by Mr. Do (01/19/20 07:23 PM)




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




hap
Reged: 12/01/08
Posts: 296
Send PM


Re: Artwork based on dipswitch setting? new [Re: Mr. Do]
#385054 - 01/19/20 09:01 PM


I don't think there's a SciSys Mark V with French button labels, I would add it to the artwork if it did exist.

8-way joystick in artwork: yes it is possible with inputraw="1" as long as the directional controls are on the same port. And not eg. left on "IN1" and up on "IN2".
Also, make sure to add a dummy mask before it, otherwise it'll be glitchy when a user clicks on it.

Sometimes clicking on a multi-bit mask is wanted though. For example on Atari touchme, you can click on the "1.2.3" slider.



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


Re: Artwork based on dipswitch setting? new [Re: hap]
#385060 - 01/20/20 05:40 AM Attachment: ddragonw.zip 401 KB (5 downloads)


> I don't think there's a SciSys Mark V with French button labels, I would add it to
> the artwork if it did exist.
>
> 8-way joystick in artwork: yes it is possible with inputraw="1" as long as the
> directional controls are on the same port. And not eg. left on "IN1" and up on "IN2".
> Also, make sure to add a dummy mask before it, otherwise it'll be glitchy when a user
> clicks on it.
>
> Sometimes clicking on a multi-bit mask is wanted though. For example on Atari
> touchme, you can click on the "1.2.3" slider.


Apologies... this one's not clicking for me.

-- I've understood assigning one image to one input (PORT_BIT), with a state of 0,1
-- I now know get how to assign multiple images to a dipswitch.
---- I understand how gmissile is setup; in lay terms: the line PORT_DIPNAME is followed by two values; the first (0x30) is what I use for inputmask on the element reference; the second is the default when you start the game (0x10); for the artwork, the states for each image start at 0, going up, based on the values in the PORT_DIPSETTING. (So in this case, 0x00, 0x10, 0x20, 0x30 would be state of 0,1,2,3 respectively).

So back to the 8-way joystick... I don't understand how to combine it all. Each direction is defined by one PORT_BIT.

-- How do I derive the inputmask for that group of 4 PORT_BITs
-- How do I derive the values for the diagonals (up+left, up+right, etc.)

If you can help me "cheat" here, it would be appreciated. Attached again is a sample artwork file for ddragonm, with images for all 9 states of the joystick. There is a base underneath the joystick art, so you can see which direction it is moving. I've left things blank for where I don't understand where to move forward here.

Oh... and on ccmk5, I only mentioned French, because it is currently defined in the driver for the language dipswitch.




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




hap
Reged: 12/01/08
Posts: 296
Send PM


Re: Artwork based on dipswitch setting? new [Re: Mr. Do]
#385067 - 01/20/20 11:25 AM Attachment: default.lay 3 KB (10 downloads)


see attachment, comments included



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


Re: Artwork based on dipswitch setting? new [Re: hap]
#385075 - 01/20/20 05:41 PM


> see attachment, comments included

You...are... awesome!!! Thank you!!

So basically... it's as simple as... I just need to learn how to add and subtract hex numbers.

I was "kind of" thinking it had something to do with that, but that seemed too simple, and I was making it more complicated in my head. That, and I haven't ever applied the concept of adding hex numbers before today.

Thanks again!! You've been beyond helpful this weekend.

Last last question... and I'm not going to attempt it for awhile, but since we're on the subject... is it possible to do the same thing with an analog control? I'm assuming I would need an image each for the min/max value, then do the math of how many rotations I would need in between for it to be smooth?

If it's complicated, then just a yes/no for today would be cool. And I'm assuming something like Afterburner would be more complicated, since it involves two axis?

Below is Outrun.

PORT_START("ADC.0") // steering
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x20,0xe0) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)




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




hap
Reged: 12/01/08
Posts: 296
Send PM


Re: Artwork based on dipswitch setting? new [Re: Mr. Do]
#385076 - 01/20/20 05:56 PM


Yeah, outrun animated steering wheel should be possible, but instead of masking with 0xff, I'd use an inputmask of let's say 0xf8. Then you wouldn't need 200 steering wheel images.

Anything with 2 axes will be difficult to animate as a single element.



Comboman
Can't think of a good title
Reged: 12/30/12
Posts: 431
Loc: Halifax, Canada
Send PM


Re: Artwork based on dipswitch setting? new [Re: Mr. Do]
#385077 - 01/20/20 06:11 PM


You might want to take a look at the tachs in Drag Race for an example of how to do "analog" output. So many little needle pics



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


Re: Artwork based on dipswitch setting? new [Re: Comboman]
#385078 - 01/20/20 06:18 PM


> You might want to take a look at the tachs in Drag Race for an example of how to do
> "analog" output. So many little needle pics

That's what I was thinking of... similar concept, I've got the same thing in the Turbo tachometer.




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




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


Re: Artwork based on dipswitch setting? new [Re: hap]
#385079 - 01/20/20 06:42 PM


> Yeah, outrun animated steering wheel should be possible, but instead of masking with
> 0xff, I'd use an inputmask of let's say 0xf8. Then you wouldn't need 200 steering
> wheel images.

Dang... lost me again.

Was I thinking the wrong way?
-- All the way left would be 0x20
-- All the way right would be 0xe0
-- Center would be around 0x60
-- There would be 96 images left to center, and 96 more center to right.

Guessing this has to do with "I don't understand what the concept of inputmask actually does."




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




hap
Reged: 12/01/08
Posts: 296
Send PM


Re: Artwork based on dipswitch setting? new [Re: Mr. Do]
#385080 - 01/20/20 07:16 PM


Yup, 96+96 is way too many images for a steering wheel animation. If you mask off the lower 3 bits, you'd have (too lazy to calculate) around 25 total.

*edit*
for example, imagine a steering wheel 0x01-0xff
set inputmask to 0xe0
analog value is rightshifted, so 0-7
8 values total, value 4 is center.

Edited by hap (01/20/20 07:21 PM)



Comboman
Can't think of a good title
Reged: 12/30/12
Posts: 431
Loc: Halifax, Canada
Send PM


Re: Artwork based on dipswitch setting? new [Re: hap]
#385089 - 01/21/20 05:23 PM


Please correct me if I'm wrong, but I believe inputmask 0xe0 doesn't actually right-shift the value; it reduces the resolution by zeroing the lower 4 bits. So it's 8 values total (0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70) with 0x40 in the center?



hap
Reged: 12/01/08
Posts: 296
Send PM


Re: Artwork based on dipswitch setting? new [Re: Comboman]
#385090 - 01/21/20 05:35 PM


Yes, it will rightshift. The reason for this is so MAME won't preallocate unused states. This would be a big problem with eg. a mask of 0xc0000000, and MAME allocating for a couple billion possibilities.


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
2 registered and 150 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 557