//called once upon cartridge load event: perform dry-run state save. //determines exactly how many bytes are needed to save state for this cartridge, //as amount varies per game (eg different RAM sizes, special chips, etc.) public void serialize_init() { Serializer s = new Serializer(); uint signature = 0, version = 0, crc32 = 0; byte[] profile = new byte[16], description = new byte[512]; s.integer(signature, "signature"); s.integer(version, "version"); s.integer(crc32, "crc32"); s.array(profile, "profile"); s.array(description, "description"); serialize_all(s); serialize_size = s.size(); }