FE6, 7, and 8 RAM question

Trying to see the feasibility of something; is there like a part of the RAM that fits any of these qualifications in the 3 games:

  • Section that changes when ANY unit finishes their turn. (I know there’s a part for each individual Player character, but was wondering if there was a more general flag.)
  • Section that changes when it switches to Enemy/Ally Phase from Player Phase. (Ie, say it’s like 0 when Player Phase, 1 when Enemy Phase, 2 when Ally Phase)
  • If the first one doesn’t exist, less general flags that change when a unit does any specific action (rescue, heal, dance, attack, etc.)

This is for FE8

  1. not sure, i would try breaking on what sets the unitActionType field in ActionData
  2. ChapterState
/* 0F */ u8 currentPhase;
  1. ActionData
/* 11 */ u8 unitActionType;

This is further elaborated as

	// 0x00?
	UNIT_ACTION_WAIT = 0x01,
	UNIT_ACTION_COMBAT = 0x02,
	UNIT_ACTION_STAFF = 0x03,
	UNIT_ACTION_DANCE = 0x04,
	// 0x05?
	UNIT_ACTION_STEAL = 0x06,
	UNIT_ACTION_SUMMON = 0x07,
	UNIT_ACTION_SUMMON_DK = 0x08,
	UNIT_ACTION_RESCUE = 0x09,
	UNIT_ACTION_DROP = 0x0A,
	UNIT_ACTION_TAKE = 0x0B,
	UNIT_ACTION_GIVE = 0x0C,
	// 0x0D?
	UNIT_ACTION_TALK = 0x0E,
	UNIT_ACTION_SUPPORT = 0x0F,
	UNIT_ACTION_VISIT = 0x10,
	UNIT_ACTION_SEIZE = 0x11,
	UNIT_ACTION_DOOR = 0x12,
	// 0x13?
	UNIT_ACTION_CHEST = 0x14,
	UNIT_ACTION_PICK = 0x15,
	// 0x16?
	UNIT_ACTION_SHOPPED = 0x17,
	// 0x18?
	UNIT_ACTION_ARENA = 0x19,
	UNIT_ACTION_USE_ITEM = 0x1A,
	// 0x1B?
	// 0x1C?
	UNIT_ACTION_TRADED = 0x1D,
	UNIT_ACTION_FOG_ENCOUNTER = 0x1E,
	// 0x1F?
	// 0x20?
	UNIT_ACTION_RIDE_BALLISTA = 0x21,
	UNIT_ACTION_EXIT_BALLISTA = 0x22,

Both ChapterState and ActionData have a singleton struct at these addresses

SET_DATA gChapterData, 0x202BCF0
SET_DATA gActionData, 0x203A958

If you need more info I recommend checking out stan’s clib here his doc here and teq’s (somewhat outdated) doc here