Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * The format is a bit of a mess, it would look nicer as some sort of assembly language than as C.
- * Names are rushed, I hope they are intelligible.
- * The comments indicate command position and command length.
- * The arguments that are formatted as `offset1 - offset2` are relative branches, the first value is where it branches to
- * and the second value is the position it's branching from (command position + command length)
- * The _S at the end of some of the names means that the branch offset is one byte large, S standing for "short" range branching,
- * there is another command that is identical except the branch offset is two bytes large, suffixed with _L for "long" range branching.
- *
- * The commands were figured out through reverse engineering the handler functions in code_801323D0
- */
- // D_80BAE820
- u8 sEventScript = {
- /* 0x00000 0x04 */ DAY_CHECK_S(0x2, 0x0080 - 0x0004), // The following is on Day 2
- /* 0x00004 0x04 */ FLAG_CHECK_S(0x2108, 0x007f - 0x0008), // weekEventReg[0x21] & 0x08 , saved bomb shop lady
- /* 0x00008 0x04 */ SCENE_CHECK_S(0x6d, 0x003d - 0x000c), // West Clock Town
- /* 0x0000C 0x06 */ TIME_RANGE_CHECK_S(00, 00, 00, 25, 0x0037 - 0x0012), // 00:00 to 00:25
- /* 0x00012 0x06 */ TIME_RANGE_CHECK_S(00, 25, 00, 30, 0x0031 - 0x0018), // 00:25 to 00:30
- /* 0x00018 0x06 */ TIME_RANGE_CHECK_S(01, 15, 01, 20, 0x002b - 0x001e), // 01:15 to 01:20
- /* 0x0001E 0x06 */ TIME_RANGE_CHECK_S(01, 20, 01, 45, 0x0025 - 0x0024), // 01:20 to 01:45
- /* 0x00024 0x01 */ END_0(), // No time condition met, exit
- /* 0x00025 0x06 */ SCRIPT_TIME_DATA(01, 20, 01, 45, 0x0E), // the time range conditions above branch into these to inform the actor
- /* 0x0002B 0x06 */ SCRIPT_TIME_DATA(01, 15, 01, 20, 0x07), // which condition was met.
- /* 0x00031 0x06 */ SCRIPT_TIME_DATA(00, 25, 00, 30, 0x06), // these commands also end script execution, returning the time and the
- /* 0x00037 0x06 */ SCRIPT_TIME_DATA(00, 00, 00, 25, 0x0D), // special value to notify the actor on what to do now.
- /* 0x0003D 0x04 */ SCENE_CHECK_S(0xd, 0x007e - 0x0041), // Curiosity Shop
- /* 0x00041 0x06 */ TIME_RANGE_CHECK_S(00, 25, 00, 30, 0x0078 - 0x0047), // 00:25 to 00:30 times for curiosity shop visit
- /* 0x00047 0x06 */ TIME_RANGE_CHECK_S(00, 30, 00, 45, 0x0072 - 0x004d), // 00:30 to 00:45
- /* 0x0004D 0x06 */ TIME_RANGE_CHECK_S(00, 45, 01, 00, 0x006c - 0x0053), // 00:45 to 01:00
- /* 0x00053 0x06 */ TIME_RANGE_CHECK_S(01, 00, 01, 15, 0x0066 - 0x0059), // 01:00 to 01:15
- /* 0x00059 0x06 */ TIME_RANGE_CHECK_S(01, 15, 01, 20, 0x0060 - 0x005f), // 01:15 to 01:20
- /* 0x0005F 0x01 */ END_0(), // No time condition met, exit
- /* 0x00060 0x06 */ SCRIPT_TIME_DATA(01, 15, 01, 20, 0x09),
- /* 0x00066 0x06 */ SCRIPT_TIME_DATA(01, 00, 01, 15, 0x0B),
- /* 0x0006C 0x06 */ SCRIPT_TIME_DATA(00, 45, 01, 00, 0x02),
- /* 0x00072 0x06 */ SCRIPT_TIME_DATA(00, 30, 00, 45, 0x0A),
- /* 0x00078 0x06 */ SCRIPT_TIME_DATA(00, 25, 00, 30, 0x08),
- /* 0x0007E 0x01 */ END_0(), // conditions other than the time range conditions branch down to these end markers
- /* 0x0007F 0x01 */ END_0(),
- /* 0x00080 0x04 */ DAY_CHECK_S(0x1, 0x00a9 - 0x0084), // The following is on Day 1
- /* 0x00084 0x04 */ SCENE_CHECK_S(0x6e, 0x00a8 - 0x0088), // North Clock Town
- /* 0x00088 0x06 */ TIME_RANGE_CHECK_S(18, 00, 00, 20, 0x00a2 - 0x008e), // 18:00 to 00:20 times for old lady event
- /* 0x0008E 0x06 */ TIME_RANGE_CHECK_S(00, 20, 00, 30, 0x009c - 0x0094), // 00:20 to 00:30
- /* 0x00094 0x04 */ TIME_CHECK_S(00, 30, 0x009b - 0x0098), // Any time after 00:30
- /* 0x00098 0x03 */ SCRIPT_DATA(0x0004),
- /* 0x0009B 0x01 */ END_0(), // No time condition met, exit
- /* 0x0009C 0x06 */ SCRIPT_TIME_DATA(00, 20, 00, 30, 0x0F),
- /* 0x000A2 0x06 */ SCRIPT_TIME_DATA(18, 00, 00, 20, 0x03),
- /* 0x000A8 0x01 */ END_0(),
- /* 0x000A9 0x04 */ DAY_CHECK_S(0x3, 0x00d4 - 0x00ad), // The following is on Day 3
- /* 0x000AD 0x04 */ SCENE_CHECK_S(0x13, 0x00d3 - 0x00b1), // Ikana Valley
- /* 0x000B1 0x06 */ TIME_RANGE_CHECK_S(18, 00, 19, 00, 0x00cd - 0x00b7), // 18:00 to 19:00
- /* 0x000B7 0x06 */ TIME_RANGE_CHECK_S(19, 00, 19, 25, 0x00ca - 0x00bd), // 19:00 to 19:25
- /* 0x000BD 0x06 */ TIME_RANGE_CHECK_S(19, 25, 00, 00, 0x00c4 - 0x00c3), // 19:25 to 00:00
- /* 0x000C3 0x01 */ END_0(), // No time condition met, exit
- /* 0x000C4 0x06 */ SCRIPT_TIME_DATA(19, 25, 00, 00, 0x01),
- /* 0x000CA 0x03 */ SCRIPT_DATA(0x0005), // does not provide time information back to the actor?
- /* 0x000CD 0x06 */ SCRIPT_TIME_DATA(18, 00, 19, 00, 0x0C),
- /* 0x000D3 0x01 */ END_0(),
- /* 0x000D4 0x01 */ END_0(),
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement