Sure, but it really is not a nice solution as it could break easily if the offsets used for the flags are in use by the actual game.
First of all you have to find an unused offset where you can write two 16 bit (or one 32 bit) values.
I'll write two comments per line, one is the translation of...