battle_transitions.asm 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  1. BattleTransition:
  2. ld a, 1
  3. ld [H_AUTOBGTRANSFERENABLED], a
  4. call Delay3
  5. xor a
  6. ld [hWY], a
  7. dec a
  8. ld [wUpdateSpritesEnabled], a
  9. call DelayFrame
  10. ; Determine which OAM block is being used by the enemy trainer sprite (if there
  11. ; is one).
  12. ld hl, wSpriteStateData1 + 2
  13. ld a, [hSpriteIndexOrTextID] ; enemy trainer sprite index (0 if wild battle)
  14. ld c, a
  15. ld b, 0
  16. ld de, $10
  17. .loop1
  18. ld a, [hl]
  19. cp $ff
  20. jr z, .skip1
  21. inc b
  22. .skip1
  23. add hl, de
  24. dec c
  25. jr nz, .loop1
  26. ; Clear OAM except for the blocks used by the player and enemy trainer sprites.
  27. ld hl, wOAMBuffer + $10
  28. ld c, 9
  29. .loop2
  30. ld a, b
  31. swap a
  32. cp l
  33. jr z, .skip2 ; skip clearing the block if the enemy trainer is using it
  34. push hl
  35. push bc
  36. ld bc, $10
  37. xor a
  38. call FillMemory
  39. pop bc
  40. pop hl
  41. .skip2
  42. ld de, $10
  43. add hl, de
  44. dec c
  45. jr nz, .loop2
  46. call Delay3
  47. call LoadBattleTransitionTile
  48. ld bc, 0
  49. ld a, [wLinkState]
  50. cp LINK_STATE_BATTLING
  51. jr z, .linkBattle
  52. call GetBattleTransitionID_WildOrTrainer
  53. call GetBattleTransitionID_CompareLevels
  54. call GetBattleTransitionID_IsDungeonMap
  55. .linkBattle
  56. ld hl, BattleTransitions
  57. add hl, bc
  58. add hl, bc
  59. ld a, [hli]
  60. ld h, [hl]
  61. ld l, a
  62. jp hl
  63. ; the three GetBattleTransitionID functions set the first
  64. ; three bits of c, which determines what transition animation
  65. ; to play at the beginning of a battle
  66. ; bit 0: set if trainer battle
  67. ; bit 1: set if enemy is at least 3 levels higher than player
  68. ; bit 2: set if dungeon map
  69. BattleTransitions:
  70. dw BattleTransition_DoubleCircle ; %000
  71. dw BattleTransition_Spiral ; %001
  72. dw BattleTransition_Circle ; %010
  73. dw BattleTransition_Spiral ; %011
  74. dw BattleTransition_HorizontalStripes ; %100
  75. dw BattleTransition_Shrink ; %101
  76. dw BattleTransition_VerticalStripes ; %110
  77. dw BattleTransition_Split ; %111
  78. GetBattleTransitionID_WildOrTrainer:
  79. ld a, [wCurOpponent]
  80. cp 200
  81. jr nc, .trainer
  82. res 0, c
  83. ret
  84. .trainer
  85. set 0, c
  86. ret
  87. GetBattleTransitionID_CompareLevels:
  88. ld hl, wPartyMon1HP
  89. .faintedLoop
  90. ld a, [hli]
  91. or [hl]
  92. jr nz, .notFainted
  93. ld de, wPartyMon2 - (wPartyMon1 + 1)
  94. add hl, de
  95. jr .faintedLoop
  96. .notFainted
  97. ld de, wPartyMon1Level - (wPartyMon1HP + 1)
  98. add hl, de
  99. ld a, [hl]
  100. add $3
  101. ld e, a
  102. ld a, [wCurEnemyLVL]
  103. sub e
  104. jr nc, .highLevelEnemy
  105. res 1, c
  106. ld a, 1
  107. ld [wBattleTransitionSpiralDirection], a
  108. ret
  109. .highLevelEnemy
  110. set 1, c
  111. xor a
  112. ld [wBattleTransitionSpiralDirection], a
  113. ret
  114. ; fails to recognize VICTORY_ROAD_2, VICTORY_ROAD_3, all ROCKET_HIDEOUT maps,
  115. ; MANSION_1, SEAFOAM_ISLANDS_[2-5], POWER_PLANT, DIGLETTS_CAVE
  116. ; and SILPH_CO_[9-11]F as dungeon maps
  117. GetBattleTransitionID_IsDungeonMap:
  118. ld a, [wCurMap]
  119. ld e, a
  120. ld hl, DungeonMaps1
  121. .loop1
  122. ld a, [hli]
  123. cp $ff
  124. jr z, .noMatch1
  125. cp e
  126. jr nz, .loop1
  127. .match
  128. set 2, c
  129. ret
  130. .noMatch1
  131. ld hl, DungeonMaps2
  132. .loop2
  133. ld a, [hli]
  134. cp $ff
  135. jr z, .noMatch2
  136. ld d, a
  137. ld a, [hli]
  138. cp e
  139. jr c, .loop2
  140. ld a, e
  141. cp d
  142. jr nc, .match
  143. .noMatch2
  144. res 2, c
  145. ret
  146. ; GetBattleTransitionID_IsDungeonMap checks if wCurMap
  147. ; is equal to one of these maps
  148. DungeonMaps1:
  149. db VIRIDIAN_FOREST
  150. db ROCK_TUNNEL_1
  151. db SEAFOAM_ISLANDS_1
  152. db ROCK_TUNNEL_2
  153. db $FF
  154. ; GetBattleTransitionID_IsDungeonMap checks if wCurMap
  155. ; is in between or equal to each pair of maps
  156. DungeonMaps2:
  157. ; all MT_MOON maps
  158. db MT_MOON_1
  159. db MT_MOON_3
  160. ; all SS_ANNE maps, VICTORY_ROAD_1, LANCES_ROOM, and HALL_OF_FAME
  161. db SS_ANNE_1
  162. db HALL_OF_FAME
  163. ; all POKEMONTOWER maps and Lavender Town buildings
  164. db LAVENDER_POKECENTER
  165. db LAVENDER_HOUSE_2
  166. ; SILPH_CO_[2-8]F, MANSION[2-4], SAFARI_ZONE, and UNKNOWN_DUNGEON maps,
  167. ; except for SILPH_CO_1F
  168. db SILPH_CO_2F
  169. db UNKNOWN_DUNGEON_1
  170. db $FF
  171. LoadBattleTransitionTile:
  172. ld hl, vChars1 + $7f0
  173. ld de, BattleTransitionTile
  174. lb bc, BANK(BattleTransitionTile), (BattleTransitionTileEnd - BattleTransitionTile) / $10
  175. jp CopyVideoData
  176. BattleTransitionTile:
  177. INCBIN "gfx/battle_transition.2bpp"
  178. BattleTransitionTileEnd:
  179. BattleTransition_BlackScreen:
  180. ld a, $ff
  181. ld [rBGP], a
  182. ld [rOBP0], a
  183. ld [rOBP1], a
  184. ret
  185. ; for non-dungeon trainer battles
  186. ; called regardless of mon levels, but does an
  187. ; outward spiral if enemy is at least 3 levels
  188. ; higher than player and does an inward spiral otherwise
  189. BattleTransition_Spiral:
  190. ld a, [wBattleTransitionSpiralDirection]
  191. and a
  192. jr z, .outwardSpiral
  193. call BattleTransition_InwardSpiral
  194. jr .done
  195. .outwardSpiral
  196. coord hl, 10, 10
  197. ld a, $3
  198. ld [wOutwardSpiralCurrentDirection], a
  199. ld a, l
  200. ld [wOutwardSpiralTileMapPointer + 1], a
  201. ld a, h
  202. ld [wOutwardSpiralTileMapPointer], a
  203. ld b, 120
  204. .loop
  205. ld c, 3
  206. .innerLoop
  207. push bc
  208. call BattleTransition_OutwardSpiral_
  209. pop bc
  210. dec c
  211. jr nz, .innerLoop
  212. call DelayFrame
  213. dec b
  214. jr nz, .loop
  215. .done
  216. call BattleTransition_BlackScreen
  217. xor a
  218. ld [wOutwardSpiralTileMapPointer + 1], a
  219. ld [wOutwardSpiralTileMapPointer], a
  220. ret
  221. BattleTransition_InwardSpiral:
  222. ld a, 7
  223. ld [wInwardSpiralUpdateScreenCounter], a
  224. coord hl, 0, 0
  225. ld c, SCREEN_HEIGHT - 1
  226. ld de, SCREEN_WIDTH
  227. call BattleTransition_InwardSpiral_
  228. inc c
  229. jr .skip
  230. .loop
  231. ld de, SCREEN_WIDTH
  232. call BattleTransition_InwardSpiral_
  233. .skip
  234. inc c
  235. ld de, 1
  236. call BattleTransition_InwardSpiral_
  237. dec c
  238. dec c
  239. ld de, -SCREEN_WIDTH
  240. call BattleTransition_InwardSpiral_
  241. inc c
  242. ld de, -1
  243. call BattleTransition_InwardSpiral_
  244. dec c
  245. dec c
  246. ld a, c
  247. and a
  248. jr nz, .loop
  249. ret
  250. BattleTransition_InwardSpiral_:
  251. push bc
  252. .loop
  253. ld [hl], $ff
  254. add hl, de
  255. push bc
  256. ld a, [wInwardSpiralUpdateScreenCounter]
  257. dec a
  258. jr nz, .skip
  259. call BattleTransition_TransferDelay3
  260. ld a, 7
  261. .skip
  262. ld [wInwardSpiralUpdateScreenCounter], a
  263. pop bc
  264. dec c
  265. jr nz, .loop
  266. pop bc
  267. ret
  268. BattleTransition_OutwardSpiral_:
  269. ld bc, -SCREEN_WIDTH
  270. ld de, SCREEN_WIDTH
  271. ld a, [wOutwardSpiralTileMapPointer + 1]
  272. ld l, a
  273. ld a, [wOutwardSpiralTileMapPointer]
  274. ld h, a
  275. ld a, [wOutwardSpiralCurrentDirection]
  276. cp $0
  277. jr z, .up
  278. cp $1
  279. jr z, .left
  280. cp $2
  281. jr z, .down
  282. cp $3
  283. jr z, .right
  284. .keepSameDirection
  285. ld [hl], $ff
  286. .done
  287. ld a, l
  288. ld [wOutwardSpiralTileMapPointer + 1], a
  289. ld a, h
  290. ld [wOutwardSpiralTileMapPointer], a
  291. ret
  292. .up
  293. dec hl
  294. ld a, [hl]
  295. cp $ff
  296. jr nz, .changeDirection
  297. inc hl
  298. add hl, bc
  299. jr .keepSameDirection
  300. .left
  301. add hl, de
  302. ld a, [hl]
  303. cp $ff
  304. jr nz, .changeDirection
  305. add hl, bc
  306. dec hl
  307. jr .keepSameDirection
  308. .down
  309. inc hl
  310. ld a, [hl]
  311. cp $ff
  312. jr nz, .changeDirection
  313. dec hl
  314. add hl, de
  315. jr .keepSameDirection
  316. .right
  317. add hl, bc
  318. ld a, [hl]
  319. cp $ff
  320. jr nz, .changeDirection
  321. add hl, de
  322. inc hl
  323. jr .keepSameDirection
  324. .changeDirection
  325. ld [hl], $ff
  326. ld a, [wOutwardSpiralCurrentDirection]
  327. inc a
  328. cp $4
  329. jr nz, .skip
  330. xor a
  331. .skip
  332. ld [wOutwardSpiralCurrentDirection], a
  333. jr .done
  334. FlashScreen:
  335. BattleTransition_FlashScreen_:
  336. ld hl, BattleTransition_FlashScreenPalettes
  337. .loop
  338. ld a, [hli]
  339. cp $1
  340. jr z, .done
  341. ld [rBGP], a
  342. ld c, 2
  343. call DelayFrames
  344. jr .loop
  345. .done
  346. dec b
  347. jr nz, BattleTransition_FlashScreen_
  348. ret
  349. BattleTransition_FlashScreenPalettes:
  350. db $F9,$FE,$FF,$FE,$F9,$E4,$90,$40,$00,$40,$90,$E4
  351. db $01 ; terminator
  352. ; used for low level trainer dungeon battles
  353. BattleTransition_Shrink:
  354. ld c, SCREEN_HEIGHT / 2
  355. .loop
  356. push bc
  357. xor a
  358. ld [H_AUTOBGTRANSFERENABLED], a
  359. coord hl, 0, 7
  360. coord de, 0, 8
  361. ld bc, -SCREEN_WIDTH * 2
  362. call BattleTransition_CopyTiles1
  363. coord hl, 0, 10
  364. coord de, 0, 9
  365. ld bc, SCREEN_WIDTH * 2
  366. call BattleTransition_CopyTiles1
  367. coord hl, 8, 0
  368. coord de, 9, 0
  369. ld bc, -2
  370. call BattleTransition_CopyTiles2
  371. coord hl, 11, 0
  372. coord de, 10, 0
  373. ld bc, 2
  374. call BattleTransition_CopyTiles2
  375. ld a, $1
  376. ld [H_AUTOBGTRANSFERENABLED], a
  377. ld c, 6
  378. call DelayFrames
  379. pop bc
  380. dec c
  381. jr nz, .loop
  382. call BattleTransition_BlackScreen
  383. ld c, 10
  384. jp DelayFrames
  385. ; used for high level trainer dungeon battles
  386. BattleTransition_Split:
  387. ld c, SCREEN_HEIGHT / 2
  388. xor a
  389. ld [H_AUTOBGTRANSFERENABLED], a
  390. .loop
  391. push bc
  392. coord hl, 0, 16
  393. coord de, 0, 17
  394. ld bc, -SCREEN_WIDTH * 2
  395. call BattleTransition_CopyTiles1
  396. coord hl, 0, 1
  397. coord de, 0, 0
  398. ld bc, SCREEN_WIDTH * 2
  399. call BattleTransition_CopyTiles1
  400. coord hl, 18, 0
  401. coord de, 19, 0
  402. ld bc, -2
  403. call BattleTransition_CopyTiles2
  404. coord hl, 1, 0
  405. coord de, 0, 0
  406. ld bc, 2
  407. call BattleTransition_CopyTiles2
  408. call BattleTransition_TransferDelay3
  409. call Delay3
  410. pop bc
  411. dec c
  412. jr nz, .loop
  413. call BattleTransition_BlackScreen
  414. ld c, 10
  415. jp DelayFrames
  416. BattleTransition_CopyTiles1:
  417. ld a, c
  418. ld [wBattleTransitionCopyTilesOffset], a
  419. ld a, b
  420. ld [wBattleTransitionCopyTilesOffset + 1], a
  421. ld c, 8
  422. .loop1
  423. push bc
  424. push hl
  425. push de
  426. ld bc, SCREEN_WIDTH
  427. call CopyData
  428. pop hl
  429. pop de
  430. ld a, [wBattleTransitionCopyTilesOffset]
  431. ld c, a
  432. ld a, [wBattleTransitionCopyTilesOffset + 1]
  433. ld b, a
  434. add hl, bc
  435. pop bc
  436. dec c
  437. jr nz, .loop1
  438. ld l, e
  439. ld h, d
  440. ld a, $ff
  441. ld c, SCREEN_WIDTH
  442. .loop2
  443. ld [hli], a
  444. dec c
  445. jr nz, .loop2
  446. ret
  447. BattleTransition_CopyTiles2:
  448. ld a, c
  449. ld [wBattleTransitionCopyTilesOffset], a
  450. ld a, b
  451. ld [wBattleTransitionCopyTilesOffset + 1], a
  452. ld c, SCREEN_HEIGHT / 2
  453. .loop1
  454. push bc
  455. push hl
  456. push de
  457. ld c, SCREEN_HEIGHT
  458. .loop2
  459. ld a, [hl]
  460. ld [de], a
  461. ld a, e
  462. add SCREEN_WIDTH
  463. jr nc, .noCarry1
  464. inc d
  465. .noCarry1
  466. ld e, a
  467. ld a, l
  468. add SCREEN_WIDTH
  469. jr nc, .noCarry2
  470. inc h
  471. .noCarry2
  472. ld l, a
  473. dec c
  474. jr nz, .loop2
  475. pop hl
  476. pop de
  477. ld a, [wBattleTransitionCopyTilesOffset]
  478. ld c, a
  479. ld a, [wBattleTransitionCopyTilesOffset + 1]
  480. ld b, a
  481. add hl, bc
  482. pop bc
  483. dec c
  484. jr nz, .loop1
  485. ld l, e
  486. ld h, d
  487. ld de, SCREEN_WIDTH
  488. ld c, SCREEN_HEIGHT
  489. .loop3
  490. ld [hl], $ff
  491. add hl, de
  492. dec c
  493. jr nz, .loop3
  494. ret
  495. ; used for high level wild dungeon battles
  496. BattleTransition_VerticalStripes:
  497. ld c, SCREEN_HEIGHT
  498. coord hl, 0, 0
  499. coord de, 1, 17
  500. xor a
  501. ld [H_AUTOBGTRANSFERENABLED], a
  502. .loop
  503. push bc
  504. push hl
  505. push de
  506. push de
  507. call BattleTransition_VerticalStripes_
  508. pop hl
  509. call BattleTransition_VerticalStripes_
  510. call BattleTransition_TransferDelay3
  511. pop hl
  512. ld bc, -SCREEN_WIDTH
  513. add hl, bc
  514. ld e, l
  515. ld d, h
  516. pop hl
  517. ld bc, SCREEN_WIDTH
  518. add hl, bc
  519. pop bc
  520. dec c
  521. jr nz, .loop
  522. jp BattleTransition_BlackScreen
  523. BattleTransition_VerticalStripes_:
  524. ld c, SCREEN_WIDTH / 2
  525. .loop
  526. ld [hl], $ff
  527. inc hl
  528. inc hl
  529. dec c
  530. jr nz, .loop
  531. ret
  532. ; used for low level wild dungeon battles
  533. BattleTransition_HorizontalStripes:
  534. ld c, SCREEN_WIDTH
  535. coord hl, 0, 0
  536. coord de, 19, 1
  537. xor a
  538. ld [H_AUTOBGTRANSFERENABLED], a
  539. .loop
  540. push bc
  541. push hl
  542. push de
  543. push de
  544. call BattleTransition_HorizontalStripes_
  545. pop hl
  546. call BattleTransition_HorizontalStripes_
  547. call BattleTransition_TransferDelay3
  548. pop de
  549. pop hl
  550. pop bc
  551. inc hl
  552. dec de
  553. dec c
  554. jr nz, .loop
  555. jp BattleTransition_BlackScreen
  556. BattleTransition_HorizontalStripes_:
  557. ld c, SCREEN_HEIGHT / 2
  558. ld de, SCREEN_WIDTH * 2
  559. .loop
  560. ld [hl], $ff
  561. add hl, de
  562. dec c
  563. jr nz, .loop
  564. ret
  565. ; used for high level wild non-dungeon battles
  566. ; makes one full circle around the screen
  567. ; by animating each half circle one at a time
  568. BattleTransition_Circle:
  569. call BattleTransition_FlashScreen
  570. lb bc, 0, SCREEN_WIDTH / 2
  571. ld hl, BattleTransition_HalfCircle1
  572. call BattleTransition_Circle_Sub1
  573. ld c, SCREEN_WIDTH / 2
  574. ld b, 1
  575. ld hl, BattleTransition_HalfCircle2
  576. call BattleTransition_Circle_Sub1
  577. jp BattleTransition_BlackScreen
  578. BattleTransition_FlashScreen:
  579. ld b, $3
  580. call BattleTransition_FlashScreen_
  581. xor a
  582. ld [H_AUTOBGTRANSFERENABLED], a
  583. ret
  584. BattleTransition_Circle_Sub1:
  585. push bc
  586. push hl
  587. ld a, b
  588. call BattleTransition_Circle_Sub2
  589. pop hl
  590. ld bc, 5
  591. add hl, bc
  592. call BattleTransition_TransferDelay3
  593. pop bc
  594. dec c
  595. jr nz, BattleTransition_Circle_Sub1
  596. ret
  597. BattleTransition_TransferDelay3:
  598. ld a, 1
  599. ld [H_AUTOBGTRANSFERENABLED], a
  600. call Delay3
  601. xor a
  602. ld [H_AUTOBGTRANSFERENABLED], a
  603. ret
  604. ; used for low level wild non-dungeon battles
  605. ; makes two half circles around the screen
  606. ; by animating both half circles at the same time
  607. BattleTransition_DoubleCircle:
  608. call BattleTransition_FlashScreen
  609. ld c, SCREEN_WIDTH / 2
  610. ld hl, BattleTransition_HalfCircle1
  611. ld de, BattleTransition_HalfCircle2
  612. .loop
  613. push bc
  614. push hl
  615. push de
  616. push de
  617. xor a
  618. call BattleTransition_Circle_Sub2
  619. pop hl
  620. ld a, $1
  621. call BattleTransition_Circle_Sub2
  622. pop hl
  623. ld bc, 5
  624. add hl, bc
  625. ld e, l
  626. ld d, h
  627. pop hl
  628. add hl, bc
  629. call BattleTransition_TransferDelay3
  630. pop bc
  631. dec c
  632. jr nz, .loop
  633. jp BattleTransition_BlackScreen
  634. BattleTransition_Circle_Sub2:
  635. ld [wBattleTransitionCircleScreenQuadrantY], a
  636. ld a, [hli]
  637. ld [wBattleTransitionCircleScreenQuadrantX], a
  638. ld a, [hli]
  639. ld e, a
  640. ld a, [hli]
  641. ld d, a
  642. ld a, [hli]
  643. ld h, [hl]
  644. ld l, a
  645. jp BattleTransition_Circle_Sub3
  646. BattleTransition_HalfCircle1:
  647. db $01
  648. dw BattleTransition_CircleData1
  649. dwCoord 18, 6
  650. db $01
  651. dw BattleTransition_CircleData2
  652. dwCoord 19, 3
  653. db $01
  654. dw BattleTransition_CircleData3
  655. dwCoord 18, 0
  656. db $01
  657. dw BattleTransition_CircleData4
  658. dwCoord 14, 0
  659. db $01
  660. dw BattleTransition_CircleData5
  661. dwCoord 10, 0
  662. db $00
  663. dw BattleTransition_CircleData5
  664. dwCoord 9, 0
  665. db $00
  666. dw BattleTransition_CircleData4
  667. dwCoord 5, 0
  668. db $00
  669. dw BattleTransition_CircleData3
  670. dwCoord 1, 0
  671. db $00
  672. dw BattleTransition_CircleData2
  673. dwCoord 0, 3
  674. db $00
  675. dw BattleTransition_CircleData1
  676. dwCoord 1, 6
  677. BattleTransition_HalfCircle2:
  678. db $00
  679. dw BattleTransition_CircleData1
  680. dwCoord 1, 11
  681. db $00
  682. dw BattleTransition_CircleData2
  683. dwCoord 0, 14
  684. db $00
  685. dw BattleTransition_CircleData3
  686. dwCoord 1, 17
  687. db $00
  688. dw BattleTransition_CircleData4
  689. dwCoord 5, 17
  690. db $00
  691. dw BattleTransition_CircleData5
  692. dwCoord 9, 17
  693. db $01
  694. dw BattleTransition_CircleData5
  695. dwCoord 10, 17
  696. db $01
  697. dw BattleTransition_CircleData4
  698. dwCoord 14, 17
  699. db $01
  700. dw BattleTransition_CircleData3
  701. dwCoord 18, 17
  702. db $01
  703. dw BattleTransition_CircleData2
  704. dwCoord 19, 14
  705. db $01
  706. dw BattleTransition_CircleData1
  707. dwCoord 18, 11
  708. BattleTransition_Circle_Sub3:
  709. push hl
  710. ld a, [de]
  711. ld c, a
  712. inc de
  713. .loop1
  714. ld [hl], $ff
  715. ld a, [wBattleTransitionCircleScreenQuadrantX]
  716. and a
  717. jr z, .skip1
  718. inc hl
  719. jr .skip2
  720. .skip1
  721. dec hl
  722. .skip2
  723. dec c
  724. jr nz, .loop1
  725. pop hl
  726. ld a, [wBattleTransitionCircleScreenQuadrantY]
  727. and a
  728. ld bc, SCREEN_WIDTH
  729. jr z, .skip3
  730. ld bc, -SCREEN_WIDTH
  731. .skip3
  732. add hl, bc
  733. ld a, [de]
  734. inc de
  735. cp $ff
  736. ret z
  737. and a
  738. jr z, BattleTransition_Circle_Sub3
  739. ld c, a
  740. .loop2
  741. ld a, [wBattleTransitionCircleScreenQuadrantX]
  742. and a
  743. jr z, .skip4
  744. dec hl
  745. jr .skip5
  746. .skip4
  747. inc hl
  748. .skip5
  749. dec c
  750. jr nz, .loop2
  751. jr BattleTransition_Circle_Sub3
  752. BattleTransition_CircleData1:
  753. db $02,$03,$05,$04,$09,$FF
  754. BattleTransition_CircleData2:
  755. db $01,$01,$02,$02,$04,$02,$04,$02,$03,$FF
  756. BattleTransition_CircleData3:
  757. db $02,$01,$03,$01,$04,$01,$04,$01,$04,$01,$03,$01,$02,$01,$01,$01,$01,$FF
  758. BattleTransition_CircleData4:
  759. db $04,$01,$04,$00,$03,$01,$03,$00,$02,$01,$02,$00,$01,$FF
  760. BattleTransition_CircleData5:
  761. db $04,$00,$03,$00,$03,$00,$02,$00,$02,$00,$01,$00,$01,$00,$01,$FF