don't click here

HHELP!! Anyone?

Discussion in 'Engineering & Reverse Engineering' started by LOst, Jan 17, 2005.

Thread Status:
Not open for further replies.
  1. LOst

    LOst

    Tech Member
    4,891
    8
    18
    I'm clock in Sonic 1-3K is increased every framecount. It means that 60 frames in one second.

    Now I'm standing at a problem! I have done a game myself that uses the exact same clock.

    "Minutes" is a byte
    "Seconds" is a byte
    "Frame count" is a byte


    But I'm having a hi-score in my game, and I need to convert the frame count into the same format as Sonic 3's competition timer.

    That means that the counter counts from 0 to 99 in one second, and not from 0 to 60 like the default Sonic timer.

    So I need help. I have already everything set except the name of the timer that counts from 0 to 99 in one second.
    What is this counter called in English?
     
  2. Lightning

    Lightning

    indeed Tech Member
    Hundredths of a second, you mean?
     
  3. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Yea


    I need a shorter name!

    Nemesis calls it "Milliseconds". Is that correct?
     
  4. Xian

    Xian

    Give the DS what it wants. Member
    67
    0
    0
    Milliseconds is the next digit down. Hundredth was the only name I could find.
     
  5. Lightning

    Lightning

    indeed Tech Member
    Milliseconds would be 0 to 999, I think.
    Centiseconds?
     
  6. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Is Centiseconds a real name? I mean is it correct to use it in a English statement?
     
  7. Xian

    Xian

    Give the DS what it wants. Member
    67
    0
    0
    Yes, it is centiseconds
     
  8. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Thank you for your help!

    And to show you how Sonic 3's competition timer works, I present to you in C++ source:
    Code (Text):
    1. const unsigned char centiseconds [60] =
    2. {
    3.     0x00, 0x01, 0x03, 0x05, 0x06, 0x08, 0x0A, 0x0B, 0x0D, 0x0F, 0x10, 0x12,
    4.     0x14, 0x15, 0x17, 0x19, 0x1A, 0x1C, 0x1E, 0x1F, 0x21, 0x23, 0x24, 0x26,
    5.     0x28, 0x29, 0x2B, 0x2D, 0x2E, 0x30, 0x32, 0x33, 0x35, 0x37, 0x38, 0x3A,
    6.     0x3C, 0x3D, 0x3F, 0x41, 0x42, 0x44, 0x46, 0x47, 0x49, 0x4B, 0x4C, 0x4E,
    7.     0x50, 0x51, 0x53, 0x55, 0x56, 0x58, 0x5A, 0x5B, 0x5D, 0x5F, 0x60, 0x62
    8. };
    9.  
    10. void ShowCentiseconds (unsigned char frame_count)
    11. {
    12.     cout << "Using Sonic 3\'s Centiseconds table to convert the frame count into:\n" << endl;
    13.  
    14.     cout << centiseconds [ frame_count ] << endl;
    15. }
     
  9. Lightning

    Lightning

    indeed Tech Member
    Quite welcome. And I'd've imagined they would do something like that.. But in higher level computers I think it would be easier to just use frame_count * 5 / 3. That's essentially what they apparently did, though. =P
     
  10. LOst

    LOst

    Tech Member
    4,891
    8
    18
    They use a table because it of the divide by 3. Both mutiply and divide should not be used unles they really have to because of speed issues.
     
  11. Lightning

    Lightning

    indeed Tech Member
    Exactly why I mentioned that for higher-level computers.
     
  12. Korama

    Korama

    Tech Member
    272
    2
    0
    Interesting question. "Centiseconds" would be perfectly logical, although dictionaries apparently don't know this term (neither does this list on wikipedia). If you are looking for a shorter, albeit fuzzier word, you could probably use jiffy.
     
  13. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    The reason "centiseconds" isn't widely known is because the second is not an SI unit (since time has not yet been decimalised) but centi- is an SI prefix for x10-2.
     
  14. Korama

    Korama

    Tech Member
    272
    2
    0
  15. Trigahd

    Trigahd

    I am your gahd!! Member
    1,523
    0
    0
    Somewhere in the skies
    Nothing worth mentioning
    It's too bad most people confuse millisecond with centisecond. If you ask a normal to tell you time to the nearest centisecond, they'll look at you like you are an idiot and don't know how to tell the time. However, if you ask them to the nearest millisecond, they'll give you an approximation, since they know the incorrect way to tell time. I only wish they'd teach kids that in school ;) . The term is centiseconds and Korama is indeed right about seconds being an SI unit.
     
  16. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    Maybe so, but it doesn't work as a true SI unit because it's not decimal - there's 60 seconds in a minute, 60 minutes in an hour, 24 hours in a day. This makes SI prefixes a severe pain to work with. Roll on decimal time.
     
  17. Simon

    Simon

    Oldbie
    Then don't convert to minutes or hours, at least not until the very last step where human interpretation is truly needed. Stick with seconds.

    http://www.sengpielaudio.com/calculator-millisecond.htm
     
  18. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Well that page says Centiseconds. And cs. So I stick to it.

    Thank you all for your support!
     
  19. Djbrayster

    Djbrayster

    "Do you wana chat with me?" Oldbie
    74
    0
    0
    England UK.
    Classic Amy The Hedgehog
    heh I remember when was at uni, and the questions involving speed and time. We had to convert everthing to the base unit (seconds, metres, etc) and then convert to miles per hour. it caused alot of confusion in the class, but yeah Centisecond is right. just not used often due to centi being a awkward base 10 number. always were told to work in base of 3 like 10^3 or 10^-6 not 10^-2 etc.
    However why is it a millisecond can be used when time is measured in seemingly 60 part intervals? a millisecond IS 1/1000 of a second not 1/60 (the ratio deriviative not avtually 1/60) of a second?
    I think I know why I failed uni.. the SI got messy too fast!

    Edit: typos and fixed some explainations
     
Thread Status:
Not open for further replies.