route16gate.asm 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. Route16GateScript:
  2. ld hl, wd732
  3. res 5, [hl]
  4. call EnableAutoTextBoxDrawing
  5. ld a, [wRoute16GateCurScript]
  6. ld hl, Route16GateScriptPointers
  7. jp CallFunctionInTable
  8. Route16GateScriptPointers:
  9. dw Route16GateScript0
  10. dw Route16GateScript1
  11. dw Route16GateScript2
  12. dw Route16GateScript3
  13. Route16GateScript0:
  14. call Route16GateScript_49755
  15. ret nz
  16. ld hl, CoordsData_49714
  17. call ArePlayerCoordsInArray
  18. ret nc
  19. ld a, $3
  20. ld [hSpriteIndexOrTextID], a
  21. call DisplayTextID
  22. xor a
  23. ld [hJoyHeld], a
  24. ld a, [wCoordIndex]
  25. cp $1
  26. jr z, .asm_4970e
  27. ld a, [wCoordIndex]
  28. dec a
  29. ld [wSimulatedJoypadStatesIndex], a
  30. ld b, $0
  31. ld c, a
  32. ld a, D_UP
  33. ld hl, wSimulatedJoypadStatesEnd
  34. call FillMemory
  35. call StartSimulatingJoypadStates
  36. ld a, $1
  37. ld [wRoute16GateCurScript], a
  38. ret
  39. .asm_4970e
  40. ld a, $2
  41. ld [wRoute16GateCurScript], a
  42. ret
  43. CoordsData_49714:
  44. db $07,$04
  45. db $08,$04
  46. db $09,$04
  47. db $0A,$04
  48. db $FF
  49. Route16GateScript1:
  50. ld a, [wSimulatedJoypadStatesIndex]
  51. and a
  52. ret nz
  53. ld a, $f0
  54. ld [wJoyIgnore], a
  55. Route16GateScript2:
  56. ld a, $1
  57. ld [hSpriteIndexOrTextID], a
  58. call DisplayTextID
  59. ld a, $1
  60. ld [wSimulatedJoypadStatesIndex], a
  61. ld a, D_RIGHT
  62. ld [wSimulatedJoypadStatesEnd], a
  63. call StartSimulatingJoypadStates
  64. ld a, $3
  65. ld [wRoute16GateCurScript], a
  66. ret
  67. Route16GateScript3:
  68. ld a, [wSimulatedJoypadStatesIndex]
  69. and a
  70. ret nz
  71. xor a
  72. ld [wJoyIgnore], a
  73. ld hl, wd730
  74. res 7, [hl]
  75. ld a, $0
  76. ld [wRoute16GateCurScript], a
  77. ret
  78. Route16GateScript_49755:
  79. ld b, BICYCLE
  80. jp IsItemInBag
  81. Route16GateTextPointers:
  82. dw Route16GateText1
  83. dw Route16GateText2
  84. dw Route16GateText3
  85. Route16GateText1:
  86. TX_ASM
  87. call Route16GateScript_49755
  88. jr z, .asm_0bdf3
  89. ld hl, Route16GateText_4977c
  90. call PrintText
  91. jr .asm_56c9d
  92. .asm_0bdf3
  93. ld hl, Route16GateText_49777
  94. call PrintText
  95. .asm_56c9d
  96. jp TextScriptEnd
  97. Route16GateText_49777:
  98. TX_FAR _Route16GateText_49777
  99. db "@"
  100. Route16GateText_4977c:
  101. TX_FAR _Route16GateText_4977c
  102. db "@"
  103. Route16GateText3:
  104. TX_FAR _Route16GateText_49781
  105. db "@"
  106. Route16GateText2:
  107. TX_FAR _Route16GateText2
  108. db "@"