Advertisement
Thar0

en_suttari D_80BAE820

Jul 24th, 2021 (edited)
1,448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.53 KB | None | 0 0
  1. /*
  2.  * The format is a bit of a mess, it would look nicer as some sort of assembly language than as C.
  3.  * Names are rushed, I hope they are intelligible.
  4.  * The comments indicate command position and command length.
  5.  * The arguments that are formatted as `offset1 - offset2` are relative branches, the first value is where it branches to
  6.  * and the second value is the position it's branching from (command position + command length)
  7.  * 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,
  8.  * there is another command that is identical except the branch offset is two bytes large, suffixed with _L for "long" range branching.
  9.  *
  10.  * The commands were figured out through reverse engineering the handler functions in code_801323D0
  11.  */
  12.  
  13. // D_80BAE820
  14. u8 sEventScript = {
  15. /* 0x00000 0x04 */  DAY_CHECK_S(0x2, 0x0080 - 0x0004), // The following is on Day 2
  16. /* 0x00004 0x04 */  FLAG_CHECK_S(0x2108, 0x007f - 0x0008), // weekEventReg[0x21] & 0x08 , saved bomb shop lady
  17. /* 0x00008 0x04 */  SCENE_CHECK_S(0x6d, 0x003d - 0x000c), // West Clock Town
  18. /* 0x0000C 0x06 */  TIME_RANGE_CHECK_S(00, 00, 00, 25, 0x0037 - 0x0012), // 00:00 to 00:25
  19. /* 0x00012 0x06 */  TIME_RANGE_CHECK_S(00, 25, 00, 30, 0x0031 - 0x0018), // 00:25 to 00:30
  20. /* 0x00018 0x06 */  TIME_RANGE_CHECK_S(01, 15, 01, 20, 0x002b - 0x001e), // 01:15 to 01:20
  21. /* 0x0001E 0x06 */  TIME_RANGE_CHECK_S(01, 20, 01, 45, 0x0025 - 0x0024), // 01:20 to 01:45
  22. /* 0x00024 0x01 */  END_0(), // No time condition met, exit
  23. /* 0x00025 0x06 */  SCRIPT_TIME_DATA(01, 20, 01, 45, 0x0E), // the time range conditions above branch into these to inform the actor
  24. /* 0x0002B 0x06 */  SCRIPT_TIME_DATA(01, 15, 01, 20, 0x07), // which condition was met.
  25. /* 0x00031 0x06 */  SCRIPT_TIME_DATA(00, 25, 00, 30, 0x06), // these commands also end script execution, returning the time and the
  26. /* 0x00037 0x06 */  SCRIPT_TIME_DATA(00, 00, 00, 25, 0x0D), // special value to notify the actor on what to do now.
  27. /* 0x0003D 0x04 */  SCENE_CHECK_S(0xd, 0x007e - 0x0041), // Curiosity Shop
  28. /* 0x00041 0x06 */  TIME_RANGE_CHECK_S(00, 25, 00, 30, 0x0078 - 0x0047), // 00:25 to 00:30 times for curiosity shop visit
  29. /* 0x00047 0x06 */  TIME_RANGE_CHECK_S(00, 30, 00, 45, 0x0072 - 0x004d), // 00:30 to 00:45
  30. /* 0x0004D 0x06 */  TIME_RANGE_CHECK_S(00, 45, 01, 00, 0x006c - 0x0053), // 00:45 to 01:00
  31. /* 0x00053 0x06 */  TIME_RANGE_CHECK_S(01, 00, 01, 15, 0x0066 - 0x0059), // 01:00 to 01:15
  32. /* 0x00059 0x06 */  TIME_RANGE_CHECK_S(01, 15, 01, 20, 0x0060 - 0x005f), // 01:15 to 01:20
  33. /* 0x0005F 0x01 */  END_0(), // No time condition met, exit
  34. /* 0x00060 0x06 */  SCRIPT_TIME_DATA(01, 15, 01, 20, 0x09),
  35. /* 0x00066 0x06 */  SCRIPT_TIME_DATA(01, 00, 01, 15, 0x0B),
  36. /* 0x0006C 0x06 */  SCRIPT_TIME_DATA(00, 45, 01, 00, 0x02),
  37. /* 0x00072 0x06 */  SCRIPT_TIME_DATA(00, 30, 00, 45, 0x0A),
  38. /* 0x00078 0x06 */  SCRIPT_TIME_DATA(00, 25, 00, 30, 0x08),
  39. /* 0x0007E 0x01 */  END_0(), // conditions other than the time range conditions branch down to these end markers
  40. /* 0x0007F 0x01 */  END_0(),
  41. /* 0x00080 0x04 */  DAY_CHECK_S(0x1, 0x00a9 - 0x0084), // The following is on Day 1
  42. /* 0x00084 0x04 */  SCENE_CHECK_S(0x6e, 0x00a8 - 0x0088), // North Clock Town
  43. /* 0x00088 0x06 */  TIME_RANGE_CHECK_S(18, 00, 00, 20, 0x00a2 - 0x008e), // 18:00 to 00:20 times for old lady event
  44. /* 0x0008E 0x06 */  TIME_RANGE_CHECK_S(00, 20, 00, 30, 0x009c - 0x0094), // 00:20 to 00:30
  45. /* 0x00094 0x04 */  TIME_CHECK_S(00, 30, 0x009b - 0x0098),               // Any time after 00:30
  46. /* 0x00098 0x03 */  SCRIPT_DATA(0x0004),
  47. /* 0x0009B 0x01 */  END_0(), // No time condition met, exit
  48. /* 0x0009C 0x06 */  SCRIPT_TIME_DATA(00, 20, 00, 30, 0x0F),
  49. /* 0x000A2 0x06 */  SCRIPT_TIME_DATA(18, 00, 00, 20, 0x03),
  50. /* 0x000A8 0x01 */  END_0(),
  51. /* 0x000A9 0x04 */  DAY_CHECK_S(0x3, 0x00d4 - 0x00ad), // The following is on Day 3
  52. /* 0x000AD 0x04 */  SCENE_CHECK_S(0x13, 0x00d3 - 0x00b1), // Ikana Valley
  53. /* 0x000B1 0x06 */  TIME_RANGE_CHECK_S(18, 00, 19, 00, 0x00cd - 0x00b7), // 18:00 to 19:00
  54. /* 0x000B7 0x06 */  TIME_RANGE_CHECK_S(19, 00, 19, 25, 0x00ca - 0x00bd), // 19:00 to 19:25
  55. /* 0x000BD 0x06 */  TIME_RANGE_CHECK_S(19, 25, 00, 00, 0x00c4 - 0x00c3), // 19:25 to 00:00
  56. /* 0x000C3 0x01 */  END_0(), // No time condition met, exit
  57. /* 0x000C4 0x06 */  SCRIPT_TIME_DATA(19, 25, 00, 00, 0x01),
  58. /* 0x000CA 0x03 */  SCRIPT_DATA(0x0005),                    // does not provide time information back to the actor?
  59. /* 0x000CD 0x06 */  SCRIPT_TIME_DATA(18, 00, 19, 00, 0x0C),
  60. /* 0x000D3 0x01 */  END_0(),
  61. /* 0x000D4 0x01 */  END_0(),
  62. };
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement