Since fe8 has introduced a memory slot, it is closer to asm.
Please think that the memory slot is like a register.
With fe8, the compare instruction can be executed only for the memory slot.
// jump if the contents of MemorySlotA and MemorySlotB are equal
// If I were going to write a little more easily,.
// BEQ [MemorySlotA], [MemorySlotB]
BEQ MemorySlotA, MemorySlotB
// jump if the contents of MemorySlotA and MemorySlotB are not equal
BNE MemorySlotA, MemorySlotB
You can not compare against immediate values.
Be sure to assign it to the memory slot before comparing.
In FEBuilderGBA, this specification is troublesome, so there are macros to compare by assigning immediate values to appropriate memory slots.
Or use MemorySlot0 always returning 0 to use for judging the bool value.
There are memory slots up to 0x0 - 0xD, but some roles are decided.
MemorySlot0 It must always be zero.
MemorySlotC It is primarily used to receive values.
MemorySlotD Represents the number of queues.(Because it is difficult, I will skip this time.)
To check the flag, use the CHECK_EVENTID command.(In FEbuilderGBA, it is called a flag instead of an EventID, so CHECK_FLAGID may be used.)
Check the state of the flag and write the result to memory slot C.
If CHECK_EVENTID 0x12, check the result of flag 0x12 and write the result to MemorySlotC.
If flag 0x12 is valid 1 , is invalid 0 , Write it to MemorySlotC.
As a practical example,.
On ch13, there is a part judging Amelia's survival.
When Amelia dies, flag 0x86 is enabled.
//Acquisition of death of Flag86 Amelia.
//The result is assigned to memory slot C.
//If she is dead, memory slot C will be 1 because 0x86 is ON.
//If she was alive, 0x86 is off, so memory slot C will be 0.
//MemorySlotC is 1 == dead, 0 == alive.
BNE MemorySlotC,MemorySlot0 //Then 1
//This is a comparison between memory slot C and memory slot 0 which always returns 0.
//MemorySlot C is 1 == dead, 0 == alive.
//If Amelia is dead, 1 != 00 will be established and the specified label will jump.
//If Amelia is alive, processing is continued because 0 != 00 because it is not established.
//Asn's BNE, BEQ must be careful as the direction of flight is opposite to that of C language IF statement.
//Amelia is alive.
//will deal with her.
Label 1 //The jump destination when Amelia was dead.