The CSBwin clock

Here is what I remember and (hopefully) understand about the operation of the clock in CSBwin.  Feel free to report disagreements, questions, and results contrary to what is reported here.

CSBwin was translated from the Atari machine language and the operation of its clock is, of course, patterned after the Atari version of CSB.  The Atari clock was driven by the vertical retrace interrupts of the monitor.  One unfortunate result of this is that in Europe people played CSB at 50 Hertz while people in the United States played at 60 Hertz.  So here in the US we had to have 20 percent quicker wits when chasing Gigglers.

The internal clock in the game 'ticked' every 11 vertical retraces.  That would be 183.33 milliseconds or about 5.45 'ticks' per second.  I had initially assumed that the clock 'ticked' every 10 vertical retraces.....but I changed my mind.  I now believe it was 11.  At any rate, everywhere I have written about the game's timing I have said that each 'tick' of the clock represented one-sixth of a second.  And that value has become the de-facto standard when converting time in the game's world to time in our world.  For example, all the record-breaking races use this value to report the race's result.  It may not be right, but it is consistent over the years and accurately reflects the number of opportunities the party has to make a move or the number of times a monster will attack or the time before a torch will burn out, etc.

So I wrote CSBwin and tried hard to reproduce the effect of the vertical retraces on the Atari.  Of course your Windows machine has a vertical retrace much different and each monitor will be different, so I based the game's clock on the 'time-of-day' as reported by Windows.  This is reported in sub-millisecond units as I recall and should be quite accurate.  And I added one to the game's clock every 10 'virtual retraces'.

Then people wrote to me to say that the game ran much too fast.  They were getting killed by Oitus that were dancing around much too quickly.  Most of these people seemed to be in places that had 50-Hertz electricity.  That would explain some of the difference since I was assuming 60-Hertz.  Further investigation convinced me that I had made a mistake by assuming 10 vertical retraces per clock 'tick'....it should have been 11.  But people were still unhappy.  A lot of study convinced me that one big reason for the problem was that the Atari itself was so SLOW that even though it tried to run at 5.45 'ticks' per second it was not capable of this.  It ran that fast when no changes were occuring in the viewport, but when the viewport had to be redrawn then the graphics overhead caused the game to slow down very significantly.  The fact that the Atari programmers added an 'Extra Tick' to the clock whenever the player moved is some evidence that they thought that movement caused a 'tick' to be lost.

Well, I finally gave up trying to make it exactly like the Atari (I did not want to try to emulate slowness).  It is good enough.  And I added a 'Speed' menu so that everyone can play it a speed they prefer.  The 'Normal' speed is was set to only 4.0 'ticks' per second in deference to all those people who said the game was much too fast.  The 'Fast' setting is at 5.45 'ticks' per second, the speed that the old Atari tried to maintain.  Other settings are faster and slower yet.  And the setting is noted in the recordings in a way that cannot be erased.