Jump to content
IGNORED

Accurate 2600 digital clock rom?


godzillajoe

Recommended Posts

It's also terrible for my laptop, since I specifically bought it because it's a low-power Intel chip that can run silently (ie, no fans). Pegging the CPU like that causes the fan to cut in, which is quite annoying. Also, on the GP2X and WinCE devices, doing this would kill the batteries much faster. Stella doesn't work on the just the desktop.

 

Yah, I was posting it as a "I've tried this, and it sucks" example, not an example to actually be followed :)

 

...although really old (0.x and 1.x) versions of Stella used to do exactly that (at least, the X11 port did)... which kept me from being able to use it on my laptop, too.

Link to comment
Share on other sites

It's also terrible for my laptop, since I specifically bought it because it's a low-power Intel chip that can run silently (ie, no fans). Pegging the CPU like that causes the fan to cut in, which is quite annoying. Also, on the GP2X and WinCE devices, doing this would kill the batteries much faster. Stella doesn't work on the just the desktop.

 

Yah, I was posting it as a "I've tried this, and it sucks" example, not an example to actually be followed :)

I know, I was just reiterating the point. I'm familiar with the timing code you added in z26, and have even used it for some ideas.

 

...although really old (0.x and 1.x) versions of Stella used to do exactly that (at least, the X11 port did)... which kept me from being able to use it on my laptop, too.

Yes, it was used on all ports up until around version 1.3 (I think). I started with Stella when it was 1.1, and getting rid of the CPU hogging was on the top of my list :)

 

Also, I forgot another possible drawback to this approach. Under some systems (most notably Linux), hogging the CPU for long periods of time can actually cause the app to be marked as a hog, and time will be intentionally stolen from it whenever it's required. It's sort of a fairness thing; if you abuse the system, prepare to be abused by the OS if/when required :)

Edited by stephena
Link to comment
Share on other sites

...except that non-realtime OSes typically don't provide anywhere near that level of accuracy for the system clock. You call your hypothetical delay_seconds(1.23456), but it'll actually delay for an even number of "ticks" (1.2 or 1.25 seconds maybe).

 

Even if an OS rounded all returns from the timer functions to 1/10 second, provided the game didn't force a delay of a whole tick per frame, the game clock would stay within 1/10 second of the system clock. Individual frames may take much longer or shorter than they should, but they would all balance out.

 

Busywaits are nasty and should be avoided at all costs.

Link to comment
Share on other sites

I found the "9:40" problem, and it was another dumb logic error. :roll: Considering that I wrote the initial program between midnight and 8:27 AM-- or probably closer to 4 AM and 8:37 AM, since the first 4 or so hours were spent working on paper and in a spreadsheet trying to figure out the best approach-- I'm not surprised there were a lot of dumb logic errors, although I *am* embarrassed by how long it's taken me to spot them! :D Anyway, I'm now working on the next version, which will be 0.1 (I decided I should have called the first version 0.0, since 1.0 should be the first version that's actually a finished program). Besides adding the ability to set the time, I'm also adding support for PAL and SECAM Atari 2600s-- although for now the program will output only a 262-line display, since I can't give the user the ability to flip between 262 lines and 312 lines until I write a custom kernel. I'll be posting the next version a little later tonight.

 

As far as all the discussion of timing on the emulators (which is over my head, although I do have a very basic understanding of the general issue), I'm currently running the program on Stella and z26, both of which seem to be keeping pretty good time. I can't see the frame rate in Stella, but when I display the frame rate in z26, I can see it flipping back and forth between 59.88 and 59.94 Hertz, so it must be averaging out fairly well to the NTSC Atari's standard of 59.92275 Hertz.

 

I do have a few comments and questions about the timing values on the different Atari 2600s (i.e., NTSC, PAL, and SECAM), but I think it's more appropriate to move any further posts related to my program into a programming forum, so I've posted them in the Homebrew forum:

 

http://www.atariage.com/forums/index.php?showtopic=99601

 

Michael

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...