• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other] How many flags in a byte?

222
Posts
6
Years
    • Seen Nov 18, 2023
    Using a routine that needs a certain amount of flags. How many flags are in a single byte of RAM? I thought it was 8 but a simple test setting flags doesn't show that. Here is the routine that needs it, for context.

    Using save block hack with repointed flags, if that matters.

    Thanks!
     
    Last edited:

    Dinisk

    DinisK
    89
    Posts
    7
    Years
    • Seen Apr 27, 2019
    a flag is a word type. A word has 0000-ffff 65535. A flag can only accept one or zero. In one byte, 00-ff means one flag in two bytes
     
    Last edited:
    71
    Posts
    7
    Years
    • Seen Jul 11, 2022
    There are indeed eight flags in a byte. Each flag sets a different bit in the byte. So if you set the eighth flag in the byte, the byte will then add 0x80 to whatever value was there before. For example, if you have flags 0x900 - 0x907 in a single byte, setting flags 0x900, 0x902, 0x903, and 0x907 will set the byte to 0x1 + 0x2 + 0x4 + 0x80 = 0x87. Does that make sense?

    a flag is a word type. A word has 0000-ffff 65535. A flag can only accept one or zero. In one byte, 00-ff means one flag in two bytes
    You're referring to a var, not a flag. Flags are bit set, meaning their values can only be 0 or 1.
     
    Back
    Top