MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

SteelTigers
STRAT Fan
Reged: 12/23/17
Posts: 106
Send PM


asteroid.cpp question...
#373382 - 01/25/18 12:08 AM Attachment: asteroids.gif 129 KB (0 downloads)


With asteroids, is there output for the blinking lights for player 1 and player 2 start buttons?


Example, on the coin-op, when dropping quarters into the coin mech., the player 1 & 2 start button(s) blink waiting for input. I would like to animate like in the attached gif.

Thanks in advance...

[ATTACHED IMAGE]

Attachment



StilettoAdministrator
They're always after me Lucky ROMS!
Reged: 03/07/04
Posts: 6472
Send PM


Re: asteroid.cpp question... new [Re: SteelTigers]
#373392 - 01/25/18 05:12 AM


> With asteroids, is there output for the blinking lights for player 1 and player 2
> start buttons?
>
>
> Example, on the coin-op, when dropping quarters into the coin mech., the player 1 & 2
> start button(s) blink waiting for input. I would like to animate like in the attached
> gif.
>
> Thanks in advance...

I took a look in the driver quick.
https://github.com/mamedev/mame/blob/master/src/mame/drivers/asteroid.cpp

If it were computer controlled, then we'd probably see it in the memory map like Lunar Lander. But it's not listed.

Perhaps it's not and instead much simpler, like upon signal from coin mech, start 555 timer to begin LED flashing. Would have to check schematics.

Mind you, I'm no expert on Asteroids hardware.

[EDIT] I just found the LEDs in the driver tho for Asteroids Deluxe.

Code:

MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(asteroid_state, start1_led_w))
MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(asteroid_state, start2_led_w))



- Stiletto

Edited by Stiletto (01/25/18 05:31 AM)



SteelTigers
STRAT Fan
Reged: 12/23/17
Posts: 106
Send PM


Re: asteroid.cpp question... new [Re: Stiletto]
#373394 - 01/25/18 06:14 AM


> I took a look in the driver quick.
> https://github.com/mamedev/mame/blob/master/src/mame/drivers/asteroid.cpp
>
> If it were computer controlled, then we'd probably see it in the memory map like
> Lunar Lander. But it's not listed.
>
> Perhaps it's not and instead much simpler, like upon signal from coin mech, start 555
> timer to begin LED flashing. Would have to check schematics.
>
> Mind you, I'm no expert on Asteroids hardware.
>
> [EDIT] I just found the LEDs in the driver tho for Asteroids Deluxe.
> MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(asteroid_state, start1_led_w))
> MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(asteroid_state, start2_led_w))
>
> - Stiletto

Thank you for looking. I spent about half hour looking at it before I posted and didn't see anything. But then again, I haven't wrote code in 15 years so I figured I would ask around and see if I missed something.

Thanks again.

[Edit] This has been resolved thanks to Mr.Do! Thank you guys for the help...

Edited by SteelTigers (01/25/18 11:08 AM)



StilettoAdministrator
They're always after me Lucky ROMS!
Reged: 03/07/04
Posts: 6472
Send PM


Re: asteroid.cpp question... new [Re: SteelTigers]
#373408 - 01/25/18 04:06 PM


> Thank you for looking. I spent about half hour looking at it before I posted and
> didn't see anything. But then again, I haven't wrote code in 15 years so I figured I
> would ask around and see if I missed something.
>
> Thanks again.
>
> [Edit] This has been resolved thanks to Mr.Do! Thank you guys for the help...

Oh, I'm an idiot.

Missed line 120 here: https://github.com/mamedev/mame/blob/master/src/mame/machine/asteroid.cpp#L120

Duke just clarified it a little more: https://github.com/mamedev/mame/commit/a...5b35188f34c3ccb

Code:

WRITE_LINE_MEMBER(asteroid_state::start1_led_w)
{
output().set_led_value(0, state ? 0 : 1);
}

WRITE_LINE_MEMBER(asteroid_state::start2_led_w)
{
output().set_led_value(1, state ? 0 : 1);
}



- Stiletto

Edited by Stiletto (01/25/18 04:30 PM)



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


Changing topic... playch10.cpp question new [Re: Stiletto]
#373444 - 01/26/18 01:07 PM


> Duke just clarified it a little more:
> https://github.com/mamedev/mame/commit/a...5b35188f34c3ccb
> WRITE_LINE_MEMBER(asteroid_state::start1_led_w)
> {
> output().set_led_value(0, state ? 0 : 1);
> }
>
> WRITE_LINE_MEMBER(asteroid_state::start2_led_w)
> {
> output().set_led_value(1, state ? 0 : 1);
> }
>
> - Stiletto


Thank you... I was just going to point him the same way, but it looks like he got it all figured out.

Since we have your attention... can you... or someone else with the necessary knowledge... look at this here:

https://github.com/mamedev/mame/blob/d46...rs/playch10.cpp

Lines 338-348

Is there a simple way to change that from a popmessage to the built-in LED system?

I've only been waiting almost ten years for it ;-)

http://mametesters.org/view.php?id=2076

As far as color... it's actually a green LED:







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




JWallace
Steamrollered by cool things, and likes it that way
Reged: 09/22/03
Posts: 810
Send PM


Re: Changing topic... playch10.cpp question new [Re: Mr. Do]
#373445 - 01/26/18 04:06 PM


Surely the issue here is not the porting to the artwork system, but the fact that the driver doesn't seem to support that display ticking down outside of the data writes? Unless I've misunderstood and the BIOS has to keep writing updated values to that for it to work. If it didn't, then you'd want code like this instead of the popmessage, then you can have artwork for digit0 to digit3 to do the job.

Code:


for (i=0; i<4; i++)
{
output().set_digit_value(i,m_timedata[i]);
}



There's probably some argument about what actually drives that display as well, but since I'm thigh deep in an attempt to rebuild and improve my development/playing PC, I can't actually run anything to test it, so there are caveats with using this directly.



http://agemame.mameworld.info

AGEMAME HQ - was once a thing, now isn't really.



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


Re: Changing topic... playch10.cpp question new [Re: Mr. Do]
#373478 - 01/27/18 10:34 AM Attachment: 0001.png 9 KB (0 downloads)


> Since we have your attention... can you... or someone else with the necessary
> knowledge... look at this here:
>
> https://github.com/mamedev/mame/blob/d46...rs/playch10.cpp
>
> Lines 338-348
>
> Is there a simple way to change that from a popmessage to the built-in LED system?
>
> I've only been waiting almost ten years for it ;-)
>
> http://mametesters.org/view.php?id=2076

Done

[ATTACHED IMAGE]

Attachment



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


Re: Changing topic... playch10.cpp question new [Re: Vas Crabb]
#373491 - 01/28/18 04:48 AM


> > Since we have your attention... can you... or someone else with the necessary
> > knowledge... look at this here:
> >
> >
> https://github.com/mamedev/mame/blob/d46...rs/playch10.cpp
> >
> > Lines 338-348
> >
> > Is there a simple way to change that from a popmessage to the built-in LED system?
> >
> > I've only been waiting almost ten years for it ;-)
> >
> > http://mametesters.org/view.php?id=2076
>
> Done

Dude... awesome... thank you!!!!





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




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


Re: Changing topic... playch10.cpp question new [Re: JWallace]
#373492 - 01/28/18 06:01 AM


> Surely the issue here is not the porting to the artwork system, but the fact that the
> driver doesn't seem to support that display ticking down outside of the data writes?
> Unless I've misunderstood and the BIOS has to keep writing updated values to that for
> it to work. If it didn't, then you'd want code like this instead of the popmessage,
> then you can have artwork for digit0 to digit3 to do the job.
>
> for (i=0; i<4; i++)
> {
> output().set_digit_value(i,m_timedata);
> }
>
> There's probably some argument about what actually drives that display as well, but
> since I'm thigh deep in an attempt to rebuild and improve my development/playing PC,
> I can't actually run anything to test it, so there are caveats with using this
> directly.


  • There's no need to set every digit when only one's written
  • set_digit_value is horribly inefficient, and I plan to kill it with fire at some point
  • There's a BCD decoder in the path so you have to map values



JWallace
Steamrollered by cool things, and likes it that way
Reged: 09/22/03
Posts: 810
Send PM


Re: Changing topic... playch10.cpp question new [Re: Vas Crabb]
#373496 - 01/28/18 03:10 PM


You can tell I haven't worked with output handlers for a while, can't you? ANyway, glad someone's done it properly.



http://agemame.mameworld.info

AGEMAME HQ - was once a thing, now isn't really.



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


Back on topic... Asteroids in 0.195 new [Re: Stiletto]
#373659 - 02/03/18 10:29 PM


> > Thank you for looking. I spent about half hour looking at it before I posted and
> > didn't see anything. But then again, I haven't wrote code in 15 years so I figured
> I
> > would ask around and see if I missed something.
> >
> > Thanks again.
> >
> > [Edit] This has been resolved thanks to Mr.Do! Thank you guys for the help...
>
> Oh, I'm an idiot.
>
> Missed line 120 here:
> https://github.com/mamedev/mame/blob/master/src/mame/machine/asteroid.cpp#L120
>
> Duke just clarified it a little more:
> https://github.com/mamedev/mame/commit/a...5b35188f34c3ccb
> WRITE_LINE_MEMBER(asteroid_state::start1_led_w)
> {
> output().set_led_value(0, state ? 0 : 1);
> }
>
> WRITE_LINE_MEMBER(asteroid_state::start2_led_w)
> {
> output().set_led_value(1, state ? 0 : 1);
> }
>
> - Stiletto

So... things changed in 0.195... want to verify if these changes are correct or not:

1) Prior to 0.194 led0 was Player1 start and led1 was Player2 start... these have now switched in 0.195. (Insert a single coin, and the Player2 LED starts flashing). Assuming for clarity sake, they should be switched back to the way they were?

2) Prior to 0.194, when you insert a second credit, each start button would flash alternately. In 0.195, both start buttons flash at the same time. I don't know which one is correct, compared to a real machine... I just know it changed.

And... only Asteroids changed... Asteroids Deluxe works the same in 0.195 as it did in 0.194.

If you need a file to test with, you can grab the artwork SteelTiger recently completed below (just make two copies of the file; rename one to asteroid, the other to astdelux.)

http://www.mameworld.info/ubbthreads/sho...part=1&vc=1




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




Bad A Billy
Oop Ack!
Reged: 12/27/07
Posts: 1072
Loc: Outland
Send PM


Re: Back on topic... Asteroids in 0.195 new [Re: Mr. Do]
#373683 - 02/04/18 06:31 AM


From a couple quick U-boob viewings of actual cabs, I've come to the conclusion that it depends on the machine as to how the P1 & P2 lights flash...

-This 1 seems to flash alternatively (hard to tell for sure) https://youtu.be/FQA_NpZUC24?t=26s
while the rest of them all flashed in unison. https://youtu.be/OE7BZAq8Noo?t=47s

-But, on all of them the P1 button stayed on after hitting it to start the game. I couldn't see on any of them if it switched to the other button & glowed as the players changed or if both of them came on & stayed on. (but I seem to recall it did the former...)

So no definitive answer here.
Have you tried all the different versions? Do they all work the same now?

Hope this helps a bit...GL!

Amazing how something that seems so simple ends up being a such a PITA to figure out...



Pessimist: Oh, this can't get any worse!
Optimist: Yes, it can!



eientei95
MAME Fan
Reged: 06/06/17
Posts: 12
Send PM


Re: Back on topic... Asteroids in 0.195 new [Re: Bad A Billy]
#374436 - 03/07/18 09:39 AM


> From a couple quick U-boob viewings of actual cabs, I've come to the conclusion that
> it depends on the machine as to how the P1 & P2 lights flash...
>
> -This 1 seems to flash alternatively (hard to tell for sure)
> https://youtu.be/FQA_NpZUC24?t=26s
> while the rest of them all flashed in unison. https://youtu.be/OE7BZAq8Noo?t=47s
>
> -But, on all of them the P1 button stayed on after hitting it to start the game. I
> couldn't see on any of them if it switched to the other button & glowed as the
> players changed or if both of them came on & stayed on. (but I seem to recall it did
> the former...)
>
> So no definitive answer here.
> Have you tried all the different versions? Do they all work the same now?

All sets in MAME have concurrently flashing LEDs except for asteroid1, which has the alternately flashing lights.



Nightvoice
MAME Fan
Reged: 03/19/10
Posts: 879
Loc: The Room Next To You
Send PM


Re: asteroid.cpp question... new [Re: SteelTigers]
#375091 - 03/25/18 07:55 AM


I don't know if this helps anyone or not, but I discovered the secret is hitting F3 to reset the game. I noticed this not just on Asteroids but on Centipede as well, that if the LEDs aren't showing correctly, a reset fixes it, but this has to be done every time the game is booted up. ??



----------------------
I have officially retired from sucking at everything I do. Life is much easier now.

My MAME/MESS artwork files: https://drive.google.com/open?id=1ABxeKgNIrKlIsyck7dx4V241NFQDWAF4
Related screen shots: https://drive.google.com/open?id=1U5IbvbVzYW97PuOOQuocvZFE_YJz7WIn


Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

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