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

Pages: 1

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


Need Help... NBA Jam joysticks 2/4
#388352 - 10/30/20 04:27 PM Attachment: nbajamte.zip 30990 KB (1 downloads)


Can't figure out what I'm doing wrong here... I'm guessing something is wrong with my math?

Joysticks 1/3 work in the attached artwork file... joysticks 2/4 don't.

Can someone help with this one... I bet it's something simple I'm not noticing (almost always is with me).


Quote:



static INPUT_PORTS_START( nbajamte )
PORT_START("IN0")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Shoot / Block") PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Pass / Steal") PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Turbo") PORT_PLAYER(1)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Shoot / Block") PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Pass / Steal") PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Turbo") PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )







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




Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4464
Loc: Melbourne, Australia
Send PM


Re: Need Help... NBA Jam joysticks 2/4 new [Re: Mr. Do]
#388371 - 10/31/20 04:03 AM


State gets right-aligned for you automatically. You only want one element per joystick colour. Instantiate the blue one for players 1 and 2 and the red one for players 3 and 4.

edit: Also, using a single space text component like that is an anti-pattern. A fully transparent rectangle is better way to force an element to include a certain area in its bounds.

Edited by Vas Crabb (10/31/20 04:05 AM)



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


Re: Need Help... NBA Jam joysticks 2/4 new [Re: Vas Crabb]
#388372 - 10/31/20 05:08 AM


> State gets right-aligned for you automatically. You only want one element per
> joystick colour. Instantiate the blue one for players 1 and 2 and the red one for
> players 3 and 4.
>
> edit: Also, using a single space text component like that is an anti-pattern. A fully
> transparent rectangle is better way to force an element to include a certain area in
> its bounds.

Got it "almost" working. Looks great, until both P1 and P2 are active at the same time, then both disappear. Because these are both part of the same Input Port, right? So I need to account for the combination of 9x9 positions for the combined inputs? (e.g. up for both is 0xe0e, so I include the _u.png image in both elements with that state, and so on)?

Is there an easier / more professional / better code way of doing what I'm thinking of here, than having 81 different state/image combinations in the element?

(And on the empty element... makes sense... that will be corrected in files).




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




Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4464
Loc: Melbourne, Australia
Send PM


Re: Need Help... NBA Jam joysticks 2/4 new [Re: Mr. Do]
#388373 - 10/31/20 11:31 AM


> Got it "almost" working. Looks great, until both P1 and P2 are active at the same
> time, then both disappear. Because these are both part of the same Input Port, right?
> So I need to account for the combination of 9x9 positions for the combined inputs?
> (e.g. up for both is 0xe0e, so I include the _u.png image in both elements with that
> state, and so on)?

No, read what I said again, and think about it.

State fields are right-aligned for you automatically.

You want one blue joystick element that you instantiate twice for players one and two. You want one red joystick element that you instantiate twice for players three and four.

You have one element per button colour. You don’t have one element with every possible combination of buttons.

> Is there an easier / more professional / better code way of doing what I'm thinking
> of here, than having 81 different state/image combinations in the element?

Yes, there is. I didn’t suggest having 81 states in an element. I want you to think about this logically.

> (And on the empty element... makes sense... that will be corrected in files).

Also you should think about a better way of indicating the position of a joystick than just shifting the position of the ball. There isn’t enough of a clear reference for the neutral position, especially with the shadow obscuring whatever’s under it. At a glance, it isn’t clear what position it’s in.

The effect on the buttons is very subtle, too, particularly on the blue button.

For a game like this, the focus is always on the screen. In real life, you don’t look at the control panel at all. The control panel will be in the player’s peripheral vision while they focus on the screen. If you want the effect to be noticed at all, you’re going to need to be decidedly unsubtle.

The button images look decidedly flattened on the side in particular. I went to a fair bit of trouble last month to address the issues causing round things to look flat on the sides and/or bottom in internal artwork. It seems a shame to make external artwork that has flat-sided circles baked in to the images.



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


Re: Need Help... NBA Jam joysticks 2/4 new [Re: Vas Crabb]
#388375 - 10/31/20 01:01 PM


> No, read what I said again, and think about it.
>
> State fields are right-aligned for you automatically.
>
> You want one blue joystick element that you instantiate twice for players one and
> two. You want one red joystick element that you instantiate twice for players three
> and four.
>
> You have one element per button colour. You don’t have one element with every
> possible combination of buttons.

Okay... had to sit and think about it for a bit... but I got it now. A note: the word "instantiate" was not in my vocabulary before today. And even when I looked up different ways to use it, it still wasn't making sense at first... but now I got it. And about the state fields being right-aligned, that wasn't clicking either at first. IANAP, just a guy that "figures stuff out."

And (0-f) being similar to (0-15) also just clicked, so I don't need a "Hex Calculator Website" to calculate the states for each position anymore.


> Also you should think about a better way of indicating the position of a joystick
> than just shifting the position of the ball. There isn’t enough of a clear reference
> for the neutral position, especially with the shadow obscuring whatever’s under it.
> At a glance, it isn’t clear what position it’s in.
>
> The effect on the buttons is very subtle, too, particularly on the blue button.
>
> For a game like this, the focus is always on the screen. In real life, you don’t look
> at the control panel at all. The control panel will be in the player’s peripheral
> vision while they focus on the screen. If you want the effect to be noticed at all,
> you’re going to need to be decidedly unsubtle.
>
> The button images look decidedly flattened on the side in particular. I went to a
> fair bit of trouble last month to address the issues causing round things to look
> flat on the sides and/or bottom in internal artwork. It seems a shame to make
> external artwork that has flat-sided circles baked in to the images.

The "joysticks" and buttons in this are all I have right now. This particular file is one of a bunch of "proof of concepts" that I wanted to make sure I added this release, knowing that I'm going to come back later and hopefully improve on the joysticks and buttons.

Thank you for the assist, and not just "doing it for me." I learn better that way.




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



Pages: 1

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

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