MAMEWorld >> EmuChat
View all threads Index   Flat Mode Flat  

gregf
Ramtek's Trivia promoter
Reged: 09/21/03
Posts: 8603
Loc: southern CA, US
Send PM
Re: G & W lua script time feature
09/13/20 07:49 AM


>> Anyways, A feature I hope to see implemented someday is the feature of having Mame
>> automatically set the Game & Watch machine's time so you don't have to make it
>> accurate every time you play the Game & Watch machines on Mame.


>MAME is accurately emulating the machine like it works... a real G&W never turns off,
>until the battery dies. When the battery dies, and you replace it, you have to set the
>time again.

>Instead of simply using ESC to end the game, you can create a save state [Shift+F7], then
>load that next time playing the game. Nevermind... that won't work either, as it will be
>whatever time it was when you last played the game. We would need something to where MAME
>displays the time based on the system time on the end user machine. Maybe someone can
>come up with a LUA script for that later... that would be a cool add-on. Moving on...



And I thought you would have been already using this lua script for the Snoopy table top game already.



Similar topic was discussed on Bannister's prior September. I don't know if it will be exactly what you are looking for, but it comes close imo. It was started by notknown with carl, hap responding along the way. One might have to create different cheat scripts for the feature since it might depend what type of G&W hardware game the script is for.



--
notknown

09/08/19

https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115847#Post115847

I also wanted to weigh in on suggestions. For instance, if it's ever possible, like how we have cheats for these games just for fun purposes of modifying game mechanics, if it's possible for mame to pull system time into the emulator and sync the G&W clocks to it, would be an awesome feature to add to the cheat and game mechanics.


crazyc 09/10/19
https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115871#Post115871

Here's a lua cheat that works with the change just pushed for zelda that sets the clock. Put it in "cheat/gnw_zelda.json" and run mame with "-plugin cheat" and look in Plugin Options/Cheats.


crazyc 09/10/19
https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115880#Post115880

You need to get

https://raw.githubusercontent.com/mamede.../cheat/init.lua




notknown 09/11/19
https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115888#Post115888

Oh wow that's awesome it works!
I do have some feedback though. The cheat set it to 12 pm instead of am, and the alarm didn't work because of this I'm assuming.

Is there a way to make the cheat toggle activated to make sure the time is synced at all times? The main issue I have is that since it's emulation the timing might not be spot on and drop out of sync. That's the biggest issue I have with the clock in these G&W emulations.

I might try to mess with the script myself but I never messed with lua before.



crazyc 09/11/19

https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115893#Post115893

Do you mean noon or midnight? The G&W clock seems to have 12 am as midnight and 12 pm as noon which how the cheat works (or at least should).

Change "on" to "run" and it'll reset the clock every frame. Does the clock drift that quickly though?


hap 09/11/19
https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115894#Post115894

G&W clock is fine with the games I tried it on, even after a few playing sessions. It will go out of sync if you play with savestates or press fastforward(INS key), but that is obvious.


notknown 09/11/19

https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115897#Post115897


So I tested the clock script at 12 am (midnight) and it made it set to 12pm. Stranger yet, I tried cycling through time setting mode ( alarm + time) and it actually was stuck on pm for like 2 cycles until it hit am instead.

It's probably why the alarm didn't work.

As for time drifting, I know emulation and accuracy is important but the fact that emulation can sometimes drift from 100% correct timing is what concerns me about the clock drifting. It's why I the idea to sync the clock is so nice to make the clock actually functional. That and any pauses in the emulation itself.

Edit: It is set to pm regardless of wheter it's am or pm on the system, but again, when entering time change mode, it cycles through pm twice before jumping to am at 12, and then it's fixed.


More posts on page 331 with notknown eventually getting something of what he wanted to work with G&W hardware and time when running emulation in MAME.

https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115847&page=331

Edited by gregf (09/13/20 07:59 AM)







Entire thread
Subject Posted by Posted on
* Somewhat First Timer here, Tokusatsu Nut, and Hope to be with mame for Long Haul JamesTCatHudson 09/13/20 02:28 AM
. * Re: Somewhat First Timer here, Tokusatsu Nut, and Hope to be with mame for Long Haul Mr. DoAdministrator  09/13/20 02:59 AM
. * Re: G & W lua script time feature gregf  09/13/20 07:49 AM
. * Re: G & W lua script time feature crazyc  09/14/20 02:57 AM
. * Re: G & W lua script time feature gregf  09/14/20 04:27 AM
. * Re: Somewhat First Timer here, Tokusatsu Nut, and Hope to be with mame for Long Haul JamesTCatHudson  09/13/20 03:17 AM

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