Jump to content
IGNORED

Inty Clock?


Recommended Posts

Hi -

 

Was wondering how on earth I could go about running a minute and second clock in game. Unlike a sports game where the clock ticks down from 20 minutes, for example, I want it to start at 00:00:00 and go up. I'd probably cap it at, say, a 5 hour mark (ie, 04.59.59) .   It would be nice to be able to pause it with the push of a button, too. 

 

How is this done? 

 

Just a hint.....don't have to give it all away...I need to do some of the actual work myself or I will never learn :)

 

thanks in advance to all you really smart people out there 

Link to comment
Share on other sites

I believe that IntyBASIC normalizes the frame rate to 50 Hz, skipping every sixth ISR when in NTSC, so that should simplify things a bit.

 

Here is another hint:

5 hours is actually 18,000 seconds (5 hours x 60 minutes x 60 seconds); but 900,000 frames (18,000 seconds x 50 frames per second).  That means that a single 16-bit counter will not be able to count that high. ;)

 

     dZ.

Link to comment
Share on other sites

45 minutes ago, DZ-Jay said:

I believe that IntyBASIC normalizes the frame rate to 50 Hz, skipping every sixth ISR when in NTSC, so that should simplify things a bit.

 

Here is another hint:

5 hours is actually 18,000 seconds (5 hours x 60 minutes x 60 seconds); but 900,000 frames (18,000 seconds x 50 frames per second).  That means that a single 16-bit counter will not be able to count that high. ;)

 

     dZ.

thanks for the quick replies.  I will see what I can do, I was definitely worried about hitting a limit.  So that means the clock is sort of internal based on frame rate

 

I actually wrote up a design document for this game, so I am trying to do it for real this time. I am going to tackle one small piece at a time and them move onto the next. The clock mechanism is a critical element to the gameplay itself, so I may have to come up with a trick to count higher, like if it hits a limit I push a counter to 2 and start over or something.  Maybe I don't need to simulate a 'real time' running clock and can base my calculation on a fake sense of time for the purpose of gameplay.   Actually, as I typed this I just came up with a method....I will just count up each chunk of time needed and then reset to 0 and start over.  This way, I will only need to count up to about 10-15 minutes max.  If this doesn't pan out, then no point in going further so I am tackling this part first.  Since I didn't initially play to display the running clock (it would have been a nice to have), it won't be a loss...

 

I'll admit, still not sure I am up to the task of programming a full game, but it will be fun trying and I know I can soundboard my dumb ideas here  :)

 

 

Edited by Mik's Arcade
Link to comment
Share on other sites

51 minutes ago, DZ-Jay said:

I believe that IntyBASIC normalizes the frame rate to 50 Hz, skipping every sixth ISR when in NTSC, so that should simplify things a bit.

 

Here is another hint:

5 hours is actually 18,000 seconds (5 hours x 60 minutes x 60 seconds); but 900,000 frames (18,000 seconds x 50 frames per second).  That means that a single 16-bit counter will not be able to count that high. ;)

 

     dZ.

Only for the music.

 

The FRAME variable keeps counting with frame rate. The variable NTSC is non-zero if there are 60 frames per second, or zero if there are 50 frames per second.

 

Link to comment
Share on other sites

54 minutes ago, nanochess said:

Only for the music.


Aha!  Well, it shows you were my focus of IntyBASIC has been; mostly in trying to integrate the Intellivision Music Tracker.

 

Thanks for the correction. :)

 

Quote

The FRAME variable keeps counting with frame rate. The variable NTSC is non-zero if there are 60 frames per second, or zero if there are 50 frames per second.

And the same ISR is called on every tick (PRNG, collisions, STIC shadow, etc.), irrespective of TV signal, and only the music player is affected?  So, time-sensitive mechanisms in games have to account for this themselves, correct?

 

    dZ.

Edited by DZ-Jay
Link to comment
Share on other sites

47 minutes ago, DZ-Jay said:


Aha!  Well, it shows you were my focus of IntyBASIC has been; mostly in trying to integrate the Intellivision Music Tracker.

 

Thanks for the correction. :)

 

And the same ISR is called on every tick (PRNG, collisions, STIC shadow, etc.), irrespective of TV signal, and only the music player is affected?  So, time-sensitive mechanisms in games have to account for this themselves, correct?

 

    dZ.

That's right! ?

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...