Jump to content
Dino from Bula

Always wondered, and you'll know the answer

Recommended Posts

:?  :?

 

He's talking about the time limit in early 2600 games.

 

Which ones? I would like to see if for myself

Share this post


Link to post
Share on other sites
Which ones? I would like to see if for myself

 

Combat

Star Ship

Air-Sea Battle

Outlaw

Surround

Breakout

 

And several more...

Share this post


Link to post
Share on other sites

One possibility is that they could have reused the same kernel (core game code) for multiple games and just left the timer as-is.

 

It might have also been a programming consideration, though it doesn't quite fit. You could have a one-byte timer with a negative bit, but that would give you 127 seconds (2:08) -- not quite the 2:16, unless they stole the lower three bytes from some other register to make up an extra 8 seconds, which doesn't make any sense since they could have just used the negative bit to get up to 255 seconds...

 

I'm rambling...

Share this post


Link to post
Share on other sites

More games than that used the 2:16 time limit. Activision anyone?

 

I'd like to know the answer myself.

Share this post


Link to post
Share on other sites

Humm... 13 bits can hold a maximum value of 8191. (2 ^ 13 = 8192 possible states, but since we start counting at 0, the highest state is 8191)

 

Divided by 60 frames per second = 136.516666666

 

Now subtract 120 seconds (2 minutes) from the total seconds = 16.5 remaining seconds.

 

It seems it was common to use a 13 bit timer.

 

-Bry

Share this post


Link to post
Share on other sites

How about Boxing, Fishing Derby, etc.

 

So why would they choose to use such a timer? 2:16 is a weird time, there's no way they chose that for the end result. It had to have been inevitable due to their methods.

 

Other games exceeded the 2:16 limit so WTF?

Share this post


Link to post
Share on other sites
It seems it was common to use a 13 bit timer.

 

    -Bry

 

Why would you only use 13 of the 16 bits available ? :?

 

At first I thought it had something to do with BCD encoding but that can't be it either because one byte can only hold 0 to 99. :ponder:

Share this post


Link to post
Share on other sites
Why would you only use 13 of the 16 bits available ?  :?

 

Because a 16 bit timer would take over 18 minutes to expire.

 

At first I thought it had something to do with BCD encoding but that can't be it either because one byte can only hold 0 to 99.  :ponder:

 

A 16-bit BCD timer can hold from 0000 to 9999.

 

9999/60 frames per second = 166.65

 

166.65 seconds - 120 seconds = (2 minutes+) 46 seconds.

 

It looks like people just liked to use a 13 bit timer to me. I'll go find the Combat source and see how the timer works.

 

-Bry

Share this post


Link to post
Share on other sites

Maybe everyone just 'borrowed' the time code that was in combat (or whichever came first) and used it in games they wanted timed. Like the borrowed code for the rainbow backdrops in Activision games.....

Share this post


Link to post
Share on other sites

Claude Elsinore: And I'd like to point out that these tapes have not been faked, or altered in any way. In fact they have time coding, which is very hard to fake.

 

The Judge: Would you please explain for the court "time coding."

 

Claude Elsinore: Well, uh, just because I don't know what it is, it doesn't mean I'm lying.

Share this post


Link to post
Share on other sites

happydrunks.gif

Howz it goin' eh?

 

Time to dig up the old Strange Brew Video!!

 

Thanks for the reminder!

 

Buck

Share this post


Link to post
Share on other sites

Okay, here's the Combat code:

 

http://www.atariage.com/2600/archives/comb..._asm/index.html

 

(Names in [] are the nearest label)

 

Location $86 is called CLOCK and is a timer. It is INC'ed 60 times a second as the game loop runs [VCNTRL].

 

$DD is called GameTimer. It's set to $80 when a game starts [GSGRCK]. GameTimer is incremented every time CLOCK & #$3F (the low 6 bits) = 0 [sCdrawn]. When GameTimer equals 0, the game is over.

 

So, the counting starts with a value of $80 + six bits from the frame counter, so basically it must go through 8192 frames for GameTimer to wrap back to 0 (at which time GameOn ($88) is set to 0, stopping the game).

 

-Bry

Share this post


Link to post
Share on other sites

bryede, thanks for covering my question so thoroughly. More proof that, no matter how much I might want to, programming Stella is a difficult task. The more I've learned about it over the past few years, thanks mostly to this site, the more I've respected Pac-Man for the 2600 (yes, that first one). I was still a disappointed kid, but now have respect for it.

 

Apolloboy, thanks for getting my question on track, and for respecting my personal favorite, Air/Sea Battle. It's still an awesome game.

Share this post


Link to post
Share on other sites

You're welcome.

 

One reason for the odd time limit is because it was common to for programmers to use nice "whole" binary numbers instead of more accurate values. Commonly in code 256 frames is considered to be 4 seconds, and therefore 64 frames (not 60) is used to represent 1 second. When the programmer of Combat wanted a 2 minute timer, he used 128 of these "seconds" instead of 120. I've noticed this in other programs too. Programmers just like these kinds of values. :)

 

-Bry

Share this post


Link to post
Share on other sites

Not exactly "like"...they are just easier to code (since a byte can have a decimal value of 0-255...half positive, half negative. That leaves 128 instances in either case).

Share this post


Link to post
Share on other sites

Sure, but when you set a timer with an arbitrary value, then wait until it expires, why use a value like $80 unless you just like round numbers? The code is the same whether $80 is used (yielding 2 mins 16 seconds) or $8F (yielding 2 mins).

 

-Bry

Share this post


Link to post
Share on other sites

Yes!

 

The Timer is incremented until it reaches 0. Here's some Combat code:

 

1st the setup - our friend chooses $80

LDA #$80

STA GameTimer

 

Now, the INC and check:

INC GameTimer

BNE ChkSel

STA GameOn

;

ChkSel

 

So, it doesn't matter (from a coding perspective) what the initial value is, only that it reaches 0 at some point.

 

-Bry

Share this post


Link to post
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.

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