Dino from Bula #1 Posted February 7, 2004 Why did some games have a 2 minute 16 second limit? Probably an easy, obvious answer...please forgive the newbie. Quote Share this post Link to post Share on other sites
ApolloBoy #4 Posted February 7, 2004 He's talking about the time limit in early 2600 games. Quote Share this post Link to post Share on other sites
bjk7382 #5 Posted February 7, 2004 He's talking about the time limit in early 2600 games. Which ones? I would like to see if for myself Quote Share this post Link to post Share on other sites
ApolloBoy #6 Posted February 7, 2004 Which ones? I would like to see if for myself Combat Star Ship Air-Sea Battle Outlaw Surround Breakout And several more... Quote Share this post Link to post Share on other sites
Mindfield #7 Posted February 7, 2004 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... Quote Share this post Link to post Share on other sites
NovaXpress #8 Posted February 7, 2004 More games than that used the 2:16 time limit. Activision anyone? I'd like to know the answer myself. Quote Share this post Link to post Share on other sites
Bryan #10 Posted February 7, 2004 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 Quote Share this post Link to post Share on other sites
NovaXpress #11 Posted February 7, 2004 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? Quote Share this post Link to post Share on other sites
CPUWIZ #12 Posted February 7, 2004 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. Quote Share this post Link to post Share on other sites
Cootster #13 Posted February 7, 2004 FWIW, arcade Tank also uses 2:16 . . . And I think some of the others do as well? Possibly a restriction of the older arcade hardware? Quote Share this post Link to post Share on other sites
Bryan #14 Posted February 7, 2004 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. 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 Quote Share this post Link to post Share on other sites
lhfreak #15 Posted February 7, 2004 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..... Quote Share this post Link to post Share on other sites
Big Player #16 Posted February 7, 2004 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. Quote Share this post Link to post Share on other sites
Bryan #17 Posted February 7, 2004 beauty movie reference! Quote Share this post Link to post Share on other sites
Buck #18 Posted February 7, 2004 Howz it goin' eh? Time to dig up the old Strange Brew Video!! Thanks for the reminder! Buck Quote Share this post Link to post Share on other sites
Bryan #19 Posted February 7, 2004 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 Quote Share this post Link to post Share on other sites
Dino from Bula #20 Posted February 7, 2004 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. Quote Share this post Link to post Share on other sites
Bryan #21 Posted February 7, 2004 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 Quote Share this post Link to post Share on other sites
Nukey Shay #22 Posted February 7, 2004 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). Quote Share this post Link to post Share on other sites
Bryan #23 Posted February 7, 2004 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 Quote Share this post Link to post Share on other sites
Nukey Shay #24 Posted February 7, 2004 Simplicity? LDA timer BPL loop is shorter than... LDA timer CMP #$8F BNE loop Quote Share this post Link to post Share on other sites
Bryan #25 Posted February 7, 2004 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 Quote Share this post Link to post Share on other sites