route18gate.asm 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. Route18GateScript:
  2. ld hl, wd732
  3. res 5, [hl]
  4. call EnableAutoTextBoxDrawing
  5. ld a, [wRoute18GateCurScript]
  6. ld hl, Route18GateScriptPointers
  7. jp CallFunctionInTable
  8. Route18GateScriptPointers:
  9. dw Route18GateScript0
  10. dw Route18GateScript1
  11. dw Route18GateScript2
  12. dw Route18GateScript3
  13. Route18GateScript0:
  14. call Route16GateScript_49755
  15. ret nz
  16. ld hl, CoordsData_498cc
  17. call ArePlayerCoordsInArray
  18. ret nc
  19. ld a, $2
  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_498c6
  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 [wRoute18GateCurScript], a
  38. ret
  39. .asm_498c6
  40. ld a, $2
  41. ld [wRoute18GateCurScript], a
  42. ret
  43. CoordsData_498cc:
  44. db $03,$04
  45. db $04,$04
  46. db $05,$04
  47. db $06,$04
  48. db $FF
  49. Route18GateScript1:
  50. ld a, [wSimulatedJoypadStatesIndex]
  51. and a
  52. ret nz
  53. ld a, $f0
  54. ld [wJoyIgnore], a
  55. Route18GateScript2:
  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 [wRoute18GateCurScript], a
  66. ret
  67. Route18GateScript3:
  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 [wRoute18GateCurScript], a
  77. ret
  78. Route18GateTextPointers:
  79. dw Route18GateText1
  80. dw Route18GateText2
  81. Route18GateText1:
  82. TX_ASM
  83. call Route16GateScript_49755
  84. jr z, .asm_3c84d
  85. ld hl, Route18GateText_4992d
  86. call PrintText
  87. jr .asm_a8410
  88. .asm_3c84d
  89. ld hl, Route18GateText_49928
  90. call PrintText
  91. .asm_a8410
  92. jp TextScriptEnd
  93. Route18GateText_49928:
  94. TX_FAR _Route18GateText_49928
  95. db "@"
  96. Route18GateText_4992d:
  97. TX_FAR _Route18GateText_4992d
  98. db "@"
  99. Route18GateText2:
  100. TX_FAR _Route18GateText_49932
  101. db "@"