Pascal Georges wrote: Hi!
> Now I tried to hook it up with the usual game play > functions, but I'm not entirely clear how to do this > correctly. Especially I'm confused with the gameclock 1/2 > and their change with engine colour and if it is enough to > just call ::gameclock:setSec at all. > > > To use clocks you just call gameclock::new and gameclock:setSec should > be enough. No no, I do not want to create a new clock. But I would like to use the hardware clock for playing a serious game e.g. That is, in this case the hardware clock should give the timeing and not Scids internal clocks. This is the goal. > You can also change some parameters in ::gameclock::data > array but it should not be necessary (for example > ::gameclock::data(fg$n) represents clock's foreground color). There are > many examples of use of clocks (play games, FICS in Scid's code). Sure. The point is, how could I _set_ them from an event delivered from the hardware clock in such a way, that e.g. it gets also send to the opponent engine, and without screwing any internal timing. > Once a clock is started, it counts timing by itself, without external > source. Thats the point. And I want to overwrite the internal timing and force it to the external events. > For example with FICS, clocks are synchronized after every > move because I get the info from FICS server. But between > two moves, it works (of course) by itself. This is the other way round, the DGT can handle this as well (Mode 23) but this is not yet in dgtnix, as far as I can see. The clock part there is a bit of highly optimised bit shifting in the usual C manner. I'll have to desect that, I fear. > Pascal, maybe you could have a look here? I fear to > screw things up. I think, it would be logical to > either have a button "external timer" (as timing > option) or to just use it in case an external timer is > found. > > I don't understand : where is the reference ? It is either > Scid's clocks or an external source. Depending on the > reference you synchronize clocks in master / slave mode. > For example on FICS, the reference is the server. Right. And for serious game I want to have the external clock as the master. I'm not sure how to pass on these events to the internal clock and by that to the opposing engine. One point is, that the external source lives in the black/white scheme. Ie. I have only a the time for Black and the time for White. Now in the "serious game" code there is some differntiation between "engine playing white or black", there's some if that just interchanges the two clocks in question. I'm not sure what this does and why it is necessary. > ::inputengine::WhiteClock > > and > > ::inputengine::BlackClock > > You should not need those extra variables. Sort of. If I always overwrite the internal clocks this is true. They're required primarily to display the actual hardware status in the DGT console. > You already have Scid's clocks that contain those > informations and the same value in two places could lead > to problems. I'd set them properly but as I say, I do not understand where this place is. Let me put it that way. If Scid has a _global_ clock for Black and also a _global_ clock for White, and that clock gets its ticks from some event, I do not know where this global clocks are and how to set them. So to say, I've the tick generator but don't know where to send the events properly and what I need to switch off to disable internal events. [...] > I've commited the code to cvs. > > > I cannot give it a try (I have no DGT board and clock). > Donations are welcome :-) Well, If I could, that's not the point. But actually you don't need any of them to give me a hand to tell me how to set Scids clocks correctly. My reference to the code was more or less as it is pretty clear where the event comes in. I'll have a look into the FICS code, maybe this could enlighten me. Still I'm a bit confused if we just have a global clock for the current game or several clocks spread arround and created if need arrises. > But clock handling should not be a hard thing to do (the > code is already there in the ::gameclock namespace). Yepp, but there is always a new clock generated in any other part, and I do not understand if they refer to a common tick source and common time settings or all live on their own. Plus, it would probably not be sensible to overwrite the FICS clock internally, for FICS it would make much more sense to display the server time on the external clock using this mode 23. -- Kind regards, / War is Peace. | Freedom is Slavery. Alexander Wagner | Ignorance is Strength. | | Theory : G. Orwell, "1984" / In practice: USA, since 2001 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Scid-users mailing list Scid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scid-users