-
Notifications
You must be signed in to change notification settings - Fork 44
/
wram.asm
2616 lines (1870 loc) · 47.6 KB
/
wram.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
INCLUDE "macros.asm"
INCLUDE "constants/pokemon_constants.asm"
; Sprite Animations use this 3-byte struct.
MACRO animation
\1FrameCounter:: ds 1
\1Frame:: ds 1
\1Index:: ds 1
endm
SECTION "WRAM Bank 0", WRAM0
wc000:: ; 0xc000
ds $10
wPokedexFontBuffer:: ; 0xc010
; Buffer to build up the variable-width font used for various displayed text in the pokedex screen.
; This buffer is copied directly to VRAM tile data. There is room for 10 characters worth of the widest text character.
ds 10 * $20
wc150:: ; 0xc150
ds $68
wc1b8:: ; 0xc1b8
ds $c8
wSendHighScoresTopBarTilemap:: ; 0xc280
; This is the tilemap data that is sent via infrared in the High Scores screen.
; It actually takes up $400 bytes of spaces, but there are other labels that use this space, too.
ds $180
wMonAnimatedCollisionMask:: ; 0xc400
ds $80
ds $40
wc4c0:: ; 0xc4c0
ds $c
wc4cc:: ; 0xc4cc
ds $34
wBottomMessageText:: ; 0xc500 WARNING: text loading code may break if this is moved
; This must be aligned with $100, since there is some logic that depends on the lower byte of the address. (See LoadMonNameIntoEvolutionSelectionList)
ds $100
wBottomMessageBuffer:: ; 0xc600
; This acts as a buffer to hold the scrolling text message.
; Rather than storing the raw text, it stores tile ids for the text.
; The lower-left most tile is at 0xc640, so everything before isn't visible on screen.
ds $100
wStageCollisionMap:: ; 0xc700
ds $300
wca00::
ds $100
wcb00:: ; 0xcb00
ds $500
SECTION "WRAM Bank 1", WRAMX
wSpriteBuffer:: ; 0xd000
ds $a0
wSpriteBufferEnd:: ; 0xd0a0
SECTION "WRAM Bank 1.1", WRAMX
wPaletteData:: ; 0xd200
ds $80
; This buffer holds the intermediate palette data when fading to a new palette.
; The target palette is held in wPaletteData.
wFadeBGPaletteData:: ; 0xd280
ds $40
wFadeOBJPaletteData:: ; 0xd2c0
ds $40
wPartyMons:: ; 0xd300
ds $100
wAddScoreQueue:: ; 0xd400
ds $60
wAddScoreQueueEnd:: ; 0xd460
wNumPartyMons:: ; 0xd460
; Number of pokemon caught in the current pinball game.
ds $1
wCurSelectedPartyMon:: ; 0xd461
; The index of the selected party pokemon.
; This is mainly used during evolution mode, when the player selects which of their
; caught pokemon to evolve.
ds $1
wCurSelectedPartyMonScrollOffset:: ; 0xd462
; Holds the scrolling offset for the pokemon list when choosing which
; pokemon to evolve.
ds $1
wPartySelectionCursorCounter:: ; 0xd463
; Counter to animate the blinking cursor when choosing a pokemon to evolve.
ds $1
wScoreToAdd:: ; 0xd464
; Holds a 6-byte BCD value to add to the player's score.
ds $6
wScore:: ; 0xd46a
; 6-byte BCD value that represents the player's score.
ds $6
wPlayerName:: ; 0xd470
; Player's 3-character name when entering High Scores.
ds $3
wHighScoreId:: ; 0xd473
; 4 randomly-generated bytes when a high score is achieved.
; These 4 bytes are appended to the high score data structure.
; See the high_scores macro.
; These 4 bytes don't appear to be used by anything. It's possible they're used by the
; "send high scores" capability, but haven't tested it.
ds $4
wAddScoreQueueOffset:: ; 0xd477
ds $1
wd478:: ; 0xd478
ds $1
wd479:: ; 0xd479
ds $1
wCurrentJackpot:: ; 0xd47a
; BCD buffer. holds catchem jackpot score
ds $4
wBallType:: ; 0xd47e
; See constants/ball_types.asm
ds $1
wBallTypeCounter:: ; 0xd47f
ds $2
wBallTypeBackup:: ; 0xd481
ds $1
wCurBonusMultiplier:: ; 0xd482
; Current value of the bonus multiplier. Incremented from achieving various events during the game, or hitting the two bonus multiplier
; railings. (left one first, then right one). See MAX_BONUS_MULTIPLIER
ds $1
wEndOfBallBonusCategoryScore:: ; 0xd483
; The "Bonus" score for the currently-displayed category of bonus score. (e.g. bonus score for "Pokemon Caught" category)
; It is a 6-digit BCD value.
ds $6
wEndOfBallBonusSubTotal:: ; 0xd489
; The running subtotal for the end-of-ball-bonus display.
; It is a 6-digit BCD value.
ds $6
wEndOfBallBonusTotalScore:: ; 0xd48f
; The final score after the end-of-ball-bonus score is added to the player's previous score.
; It is a 6-digit BCD value.
ds $6
wGoingToBonusStage:: ; 0xd495
; Set to 1 when the player's pinball enters the Slot cave to go to a Bonus Stage.
ds $1
wReturningFromBonusStage:: ; 0xd496
; Set to 1 when a bonus stage is is finished. This is used when the main field logic is determining
; where to start the ball, since it falls out of the Slot cave after a bonus stage.
ds $1
wNextStage:: ; 0xd497
; Holds the id of the next stage to go to. Used for transitioning between bonus stage and the main red/blue field.
ds $1
wNextBonusStage:: ; 0xd498
; Holds id of the next Bonus Stage the player is eligible to go to.
; This is not the raw stage id (e.g. STAGE_MEOWTH_BONUS), rather, its the id in the order the STAGE constants are defined.
; See constants/bonus_stage_order_constants.asm for list of values.
ds $1
wInitialNextBonusStage:: ; 0xd499
; Holds the id of the first Bonus Stage for the current field. This is used to "wrap around" back to the start of the bonus stages
; after defeating the Mewtwo stage. See wNextBonusStage.
ds $1
wCompletedBonusStage:: ; 0xd49a
; Set to 1 when a bonus stage is successfully cleared.
ds $1
wExtraBalls:: ; 0xd49b
ds $1
wExtraBallState:: ; 0xd49c
; Helper value to control the animation that occurs when an Extra Ball is exercised upon losing a ball.
ds $1
wCurBallLife:: ; 0xd49d
; Keeps track of the current "life" of the ball. It starts at 1 and increments whenever the player loses a ball.
ds $1
wNumBallLives:: ; 0xd49e
; The total number of "lives" the ball has. It is always 3. wCurBallLife is compared to it whenever the player loses a ball.
ds $1
wd49f:: ; 0xd49f
ds $2
wBallSaverIconOn:: ; 0xd4a1
ds $1
wBallSaverFlashRate:: ; 0xd4a2
ds $1
wBallSaverTimerFrames:: ; 0xd4a3
ds $1
wBallSaverTimerSeconds:: ; 0xd4a4
ds $1
wNumTimesBallSavedTextWillDisplay:: ; 0xd4a5
ds $1
wBallSaverTimerFramesBackup:: ; 0xd4a6
ds $1
wBallSaverTimerSecondsBackup:: ; 0xd4a7
ds $1
wNumTimesBallSavedTextWillDisplayBackup:: ; 0xd4a8
ds $1
wExtraBall:: ; 0xd4a9
; Set to 1 if the player has an extra ball.
ds $1
wDrawBottomMessageBox:: ; 0xd4aa
; Set to non-zero value if enable drawing the 1-tile high bottom message bar during V-Blank in normal pinball gameplay.
; Set to 0 to disable.
ds $1
wBallBonusWaitForButtonPress:: ; 0xd4ab
ds $1
wCurrentStage:: ; 0xd4ac
; see constants/stage_constants.asm for list. bit 0 is 1 if the stage has flippers
ds $1
wCurrentStageBackup:: ; 0xd4ad
; Holds backup of current stage id when going to a Bonus Stage. See wCurrentStage.
ds $1
wMoveToNextScreenState:: ; 0xd4ae
; This is set when the the screen state should advance, in the pinball game's core logic state.
ds $1
wStageCollisionState:: ; 0xd4af
ds $1
wStageCollisionStateBackup:: ; 0xd4b0
; Holds backup of stage collision state when going to a Bonus Stage. See wStageCollisionState.
ds $1
ds $2
wBallXPos:: ; 0xd4b3
ds $2
wBallYPos:: ; 0xd4b5
ds $2
wPreviousBallXPos:: ; 0xd4b7
ds $2
wPreviousBallYPos:: ; 0xd4b9
ds $2
wBallXVelocity:: ; 0xd4bb
ds $2
wBallYVelocity:: ; 0xd4bd
ds $2
ds $4
wBallSpin:: ; 0xd4c3
ds $1
wBallRotation:: ; 0xd4c4
ds $1
wd4c5:: ; 0xd4c5
ds $1
wd4c6:: ; 0xd4c6
ds $1
wd4c7:: ; 0xd4c7
ds $1
wBallSize:: ; 0xd4c8
; Set to 0 for default, set to 1 for mini, set to 2 for super mini
ds $1
wLostBall:: ; 0xd4c9
; Set to 1 when a ball was lost. (Lost a "life"). 0 otherwise.
ds $1
wShowExtraBallText:: ; 0xd4ca
; Setting this byte to 1 or 2 will cause the "Extra Ball" message to scroll across the bottom of the screen.
; 1 = "EXTRA BALL"
; 2 = "EXTRA BALL SPECIAL BONUS"
ds $1
wWhichVoltorb:: ; 0xd4cb
wWhichShellder::
ds $1
wWhichVoltorbId:: ; 0xd4cc
wWhichShellderId::
ds $1
wVoltorb1Animation:: ; 0xd4cd
wShellder1Animation_Unused::
animation wVoltorb1Animation
wVoltorb2Animation:: ; 0xd4d0
wShellder2Animation_Unused::
animation wVoltorb2Animation
wVoltorb3Animation:: ; 0xd4d3
wShellder3Animation_Unused::
animation wVoltorb3Animation
wVoltorbHitAnimationDuration:: ; 0xd4d6
wShellderHitAnimationDuration::
; Number of frames remaining in the light-up animation when a Shellder/Voltorb is hit.
; This single byte actually controls all three of them, since only one can be animated at a time.
ds $1
wWhichAnimatedVoltorb:: ; 0xd4d7
wWhichAnimatedShellder::
; Hold the index (0,1,2) of the Shellder/Voltorb that is currently being animated after it was hit.
ds $1
wWhichBumper:: ; 0xd4d8
; 0 = neither
; 1 = left bumper
; 2 = right bumper
ds $1
wWhichBumperId:: ; 0xd4d9
ds $1
wBumperLightUpDuration:: ; 0xd4da
; Number of frames left in the Bumper light-up animation when the pinball bounces off of it.
; This is shared by both bumpers, so only one can be lit up at a time.
ds $1
wWhichBumperGfx:: ; 0xd4db
; Determines which bumper graphics will be loaded by LoadBumperGraphics_RedField and LoadBumperGraphics_BlueField
; $0 = left bumper
; $1 = right bumper
; $FF = neither bumper
ds $1
wPinballLaunchCollision:: ; 0xd4dc
; 0 = pinball isn't resting at the start, waiting to be launched by the player
; 1 = pinball can be launched to start the round
; second byte is unused, but it's written by HandleGameObjectCollision
ds $2
wPinballLaunched:: ; 0xd4de
; 0 = pinball hasn't been launched, yet
; 1 = pinball was launched
ds $1
wd4df:: ; 0xd4df
ds $1
wChoseInitialMap:: ; 0xd4e0
; Set to 1 after the player chooses the initial map during first pinball launch.
ds $1
wInitialMapSelectionIndex:: ; 0xd4e1
ds $1
wNumMapMoves:: ; 0xd4e2
; Number of times the player has successfully completed a map move.
; Resets to 0 after completing 6.
ds $1
wVisitedMaps:: ; 0xd4e3
; List of the visited maps in order.
; It is reset after moving past Indigo Plateau.
; The last byte is unused, since there are only 6 map moves.
ds $7
wTriggeredGameObject:: ; 0xd4ea
; Game objects, such as the two bumpers, Pikachu savers, CAVE, etc. have unique ids.
; This byte saves the object which the pinball is currently colliding with.
ds $1
wTriggeredGameObjectIndex:: ; 0xd4eb
; Many game objects come in pairs, wuch as the two bumpers, Pikachu savers, etc.
; This byte stores which of them the pinball is currently colliding with.
ds $1
wPreviousTriggeredGameObject:: ; 0xd4ec
; Store the previous triggered game object's id, so that the pinball can't trigger
; an object two frames in a row. It has to "un-collide" before it can collide again.
ds $1
wWhichDiglett:: ; 0xd4ed 0 = none, left = 1 right = 2
wWhichPsyduckPoliwag::
ds $1
wWhichDiglettId:: ; 0xd4ee
wWhichPsyduckPoliwagId::
ds $1
wLeftDiglettAnimationController:: ; 0xd4ef $50 = in and pained look. 0 = normal state
ds $1
wLeftMapMoveCounter:: ; 0xd4f0 WARNING, diglet identifying code relies on this being 2 bytes before right map move counter and 1 byte after that digletts animation controller
ds $1
wRightDiglettAnimationController:: ; 0xd4f1 $50 = in and pained look. 0 = normal state
ds $1
wRightMapMoveCounter:: ; 0xd4f2
ds $1
wLeftMapMoveDiglettAnimationCounter:: ; 0xd4f3
wLeftMapMovePoliwagAnimationCounter::
ds $1
wLeftMapMoveDiglettFrame:: ; 0xd4f4
wLeftMapMovePoliwagFrame::
ds $1
wRightMapMoveDiglettAnimationCounter:: ; 0xd4f5
wRightMapMovePsyduckAnimationCounter::
ds $1
wRightMapMoveDiglettFrame:: ; 0xd4f6
wRightMapMovePsyduckFrame::
ds $1
wLeftMapMoveCounterFramesUntilDecrease:: ; 0xd4f7
; Holds the number of frames remaining until the wLeftMapMoveCounter
; counter will decrease by 1.
ds $2
wRightMapMoveCounterFramesUntilDecrease:: ; 0xd4f9
; Holds the number of frames remaining until the wRightMapMoveCounter
; counter will decrease by 1. WARNING: red tables diglett function relies on this being immediatly after wLeftMapMoveCounterFramesUntilDecrease
ds $2
wBellsproutCollision:: ; 0xd4fb
; Second byte is set by HandleGameObjectCollision, but is unused
ds $2
wBellsproutAnimation:: ; 0xd4fd
animation wBellsproutAnimation
wStaryuCollision:: ; 0xd500
; Second byte is set by HandleGameObjectCollision, but is unused
ds $2
wd502:: ; 0xd502
ds $1
wd503:: ; 0xd503
ds $1
wStaryuAnimation:: ; 0xd504
animation wStaryuAnimation
wSpinnerCollision:: ; 0xd507
; Second byte is set by HandleGameObjectCollision, but is unused
ds $2
wSpinnerState:: ; 0xd509
ds $2
wSpinnerVelocity:: ; 0xd50b
; When the ball intially passes through the spinner, the ball's y velocity is saved to this location.
; Then, the velocity saved here is decreased a little bit each frame, while it's adding to the current "spinner charge".
ds $2
wWhichCAVELight:: ; 0xd50d
ds $1
wWhichCAVELightId:: ; 0xd50e
ds $1
wCAVELightStates:: ; 0xd50f
; Marks each of the 4 CAVE lights as On (1) or Off (0).
; When all four are On, it will do a blinking animation, and then open the Slot bonus.
ds $4
wCAVELightsBlinking:: ; 0xd513
; Set to 1 when the 4 CAVE lights are blinking for a couple seconds after successfully
; lighting up all 4. Set to 0, otherwise.
ds $1
wCAVELightsBlinkingFramesRemaining:: ; 0xd514
; Holds the number of frames remaining in the 4 CAVE lights' blinking animation.
ds $1
wWhichPikachu:: ; 0xd515
ds $1
wWhichPikachuId:: ; 0xd516
ds $1
wPikachuSaverCharge:: ; 0xd517
; Holds the amount of Pikachu "charge" that has been generated by spinning the spinner
; in the right alley. The charge's value ranges from 0 - 15.
ds $1
wWhichPikachuSaverSide:: ; 0xd518
; 0 = Pikachu is on the left side
; 1 = Pikachu is on the right side
ds $1
wPikachuSaverAnimation:: ; 0xd519
animation wPikachuSaverAnimation
wd51c:: ; 0xd51c
ds $1
wPikachuSaverSlotRewardActive:: ; 0xd51d
; Set to 1 if the Pikachu Saver slot reward is active. 0 otherwise.
ds $1
wd51e:: ; 0xd51e
ds $1
wWhichBoardTrigger:: ; 0xd51f
ds $1
wWhichBoardTriggerId:: ; 0xd520
ds $1
wCollidedAlleyTriggers:: ; 0xd521
; These bytes are pretty unnecessary, but the original code decided it would use a roundabout way to decide which function to call based on wWhichBoardTriggerId was collided with.
ds $8
ds $6 ; free space
wIndicatorStates:: ; 0xd52f
ds $13
wLeftAlleyTrigger:: ; 0xd542
ds $1
wLeftAlleyCount:: ; 0xd543
ds $1
wRightAlleyTrigger:: ; 0xd544
ds $1
wRightAlleyCount:: ; 0xd545
ds $1
wSecondaryLeftAlleyTrigger:: ; 0xd546
ds $2
wPinballIsVisible:: ; 0xd548
; Set to 1 if the pinball is visible in play.
; Set to 0 when the pinball disappears in things like the Slot, Slowpoke, Cloyster, Bellsprout, etc.
; When it's set to 0, it disables tilt effects on the pinball.
ds $1
wEnableBallGravityAndTilt:: ; 0xd549
; Set to 1 to enable the effect of gravity and tilt on the pinball.
; 0 disables these forces. Used for things likes the initial pinball launch or to hold the ball stationary.
ds $1
wCurrentMap:: ; 0xd54a
ds $1
wInSpecialMode:: ; 0xd54b
; Set to 1 if currently in special game mode. See wSpecialMode.
ds $1
wSpecialModeCollisionID:: ; 0xd54c 10000 sets it to a input, records what the ball has collided with see constants/special_collision_constants.asm for more info
ds $1
wSpecialModeState:: ; 0xd54d
; Tracks the current state of special modes (catchem, evolution, map move)
ds $1
wd54e:: ; 0xd54e set to 20 by catch mode when all tiles are flipped and on lower stage
ds $1
wd54f:: ; 0xd54f set to 5 by catch mode when all tiles are flipped and on lower stage
ds $1
wSpecialMode:: ; 0xd550
; Represents the current pinball mode. Example special modes would be, Catch'Em, Evolution, Map Move
; See SPECIAL_MODE constants.
ds $1
wEvolutionObjectsDisabled:: ; 0xd551
; 0 = Hitting an evolution game object will either create an evolution trinket or show the "item not found" message.
; non-0 = The volution game objects are disabled, meaning the player needs to wait a few seconds before they can be hit again.
ds $1
wCurrentEvolutionMon:: ; 0xd552
ds $1
wCurrentEvolutionType:: ; 0xd553
ds $1
wNumEvolutionTrinkets:: ; 0xd554
ds $1
wNumPossibleEvolutionObjects:: ; 0xd555
; Each mon has a different number of possible field objects that can produce trinkets.
; This number is used to randomly choose objects that fall within that set, which will
; produce trinkets when hit with the pinball. This also corresponds to the blinking
; arrows that are displayed when the player is trying to hit one of the objects.
ds $1
wEvolutionTrinketCooldownFrames:: ; 0xd556
; Holds the number of remaining frames until the player can hit more objects to discover evolution trinkets in evolution mode.
; When the pinball hits an object in evolution mode, sometimes that object doesn't contain a trinket. When this happens, this
; cooldown is created so the player has to wait a few seconds until the objects becomes activated again.
ds $2
wd558:: ; 0xd558
ds $1
wd559:: ; 0xd559
ds $1
wMapMoveDirection:: ; 0xd55a
; 0 = need to hit the ball left to open map move slot cave
; 1 = need to hit the ball right to open map move slot cave
ds $1
wRareMonsFlag:: ; 0xd55b
ds $1
wEvolutionObjectStates:: ; 0xd55c
; There are 10 possible objects to hit that can spawn an evolution trinket. However, only three
; will actually spawn the trinket. The rest are "duds". This list of states keeps track of which
; ones will spawn the trinket. $1 = spawn trinket, $0 otherwise.
; The indexes in this list correspond to the following objects:
; Blue Field:
; 0: Any of the 3 Shellder bumpers
; 1: Poliwag
; 2: Psyduck
; 3: Left Bonus Multiplier railing
; 4: Right Bonus Multiplier railing
; 5: Slowpoke
; 6: Cloyster
; 7: Left alley trigger point
; 8: Spinner
; 9: Any of the 3 Ball Upgrade lights
; Red Field:
; 0: Any of the 3 Voltorb bumpers
; 1: Left Diglett
; 2: Right Diglett
; 3: Left Bonus Multiplier railing
; 4: Right Bonus Multiplier railing
; 5: Staryu
; 6: Bellsprout
; 7: Staryu alley trigger point
; 8: Spinner
; 9: Any of the 3 Ball Upgrade lights
ds 10
wActiveEvolutionTrinkets:: ; 0xd566
; There are 18 different positions that an evolution trinket can exist.
; Each entry in this list corresponds to one of those positions. The values
; in this list are evolution type constants, and $0 if the trinket is inactive.
; (See constants/evolution_type_constants.asm)
; During gameplay, only one of these trinkets is ever active at a given time.
; However, the game logic perfectly supports multiple being active.
ds 18
wCollidedPointIndex:: ; 0xd578
; Stores the result of the PinballCollidesWithPoints function.
; This index is 1-based, meaning 1 corresponds to the first item in the points array
ds $1
wCurrentCatchEmMon:: ; 0xd579
ds $1
wTimerSeconds:: ; 0xd57a
ds $1
wTimerMinutes:: ; 0xd57b
ds $1
wTimerFrames:: ; 0xd57c
ds $1
wTimerActive:: ; 0xd57d
; Set to 1 when the Timer is displayed and counting down.
ds $1
wTimeRanOut:: ; 0xd57e set to 1 when the timer reaches 0
ds $1
wPauseTimer:: ; 0xd57f If set to nz, timer pauses
ds $1
wd580:: ; 0xd580
ds $1
wd581:: ; 0xd581
ds $1
wTimerDigits:: ; 0xd582
; first byte = minutes
; second byte = tens place
; third byte = ones place
; fourth byte = unused, but still written to
ds $4
wBillboardTilesIlluminationStates:: ; 0xd586
; This array holds the illuminated state for each of the 24 tiles in a pokemon's billboard picture.
; During Catch'Em mode, the billboard picture starts with all tiles being "dark", and they light up
; as the Shellder or Voltorb are hit.
;
; If the tile is lit up, the value is $01, and $00 when dark.
;
; Each entry in this array is 2 bytes.
; Byte 1 = Current illumination state
; Bytes 2 = Previous illumination state. This is used to avoid re-loading the same graphics.
ds $18 * 2
wNumberOfCatchModeTilesFlipped:: ; 0xd5b6 a 24 wide block starts here and is filled before catch mode. first step of catch mode only passes if it is 24. top byte records the number of tiles flipped
ds $5
wWildMonIsHittable:: ; 0xd5bb
; Set to 1 when the wild pokemon is animated and hittable with the pinball.
ds $1
wCurrentAnimatedMonSpriteType:: ; 0xd5bc
ds $1
wCurrentAnimatedMonSpriteFrame:: ; 0xd5bd
ds $1
wLoopsUntilNextCatchSpriteAnimationChange:: ; 0xd5be
ds $1
wBallHitWildMon:: ; 0xd5bf
ds $1
wNumMonHits:: ; 0xd5c0
ds $1
wCurrentCatchMonIdleFrame1Duration:: ; 0xd5c1 sets wLoopsUntilNextCatchSpriteAnimationChange if wCurrentAnimatedMonSpriteFrame - wCurrentAnimatedMonSpriteType < 1 holds animatedSpriteType
ds $1 ;mystery data byte 1
wCurrentCatchMonIdleFrame2Duration:: ; 0xd5c2 sets wLoopsUntilNextCatchSpriteAnimationChange if wCurrentAnimatedMonSpriteFrame - wCurrentAnimatedMonSpriteType >= 1
ds $1 ;mystery data byte 2
wCurrentCatchMonHitFrameDuration:: ; 0xd5c3
ds $1
wCatchModeMonUpdateTimer:: ; 0xd5c4 increments while the caught mon is active once per frame(?), ensuring that the code only checks for the mon being hit every 4 frames or when the animation changes....for some reason (performance?)
ds $1
wNumMewHits:: ; 0xd5c5
ds $1
wd5c6:: ; 0xd5c6
ds $1
wWildMonCollision:: ; 0xd5c7
; Set by HandleGameObjectCollision
; Second byte gets set, but is unused
ds $2
ds $1
wBottomTextEnabled:: ; 0xd5ca
; 1 = text messages in the bottom black bar are enabled
; 0 = disabled--the text won't appear even if LoadScrollingText is called
ds $1
wDisableDrawScoreboardInfo:: ; 0xd5cb
; This is set when text messages are shown in the bottom black bar.
; 1 = Skip drawing the scoreboard icons in the bottom black bar. (num pokemon caught, number of balls left, score)
; 0 = Draw them.
ds $1
MACRO scrolling_text_label
\1Enabled:: ds 1 ; Toggles if enabled. 0 is off, non-0 is on
\1ScrollDelayCounter:: ds 1 ; Number of frames remaining until the next scroll step
\1ScrollDelay:: ds 1 ; Number of frames between each scroll step
\1MessageBoxOffset:: ds 1 ; Offset in wBottomMessageBuffer to place first character of text
\1StopOffset:: ds 1 ; Offset in wBottomMessageBuffer where the scrolling text will briefly stop
\1StopDuration:: ds 1 ; Number of frames the message will remained stopped, before resuming scroll
\1SourceTextOffset:: ds 1 ; Offset in wBottomMessageText for the text to be displayed
\1ScrollStepsRemaining:: ds 1 ; Number of scroll steps remaining. Isn't decremented during the stop.
ENDM
wScrollingText1:: ; 0xd5cc
scrolling_text_label wScrollingText1
wScrollingText2:: ; 0xd5d4
scrolling_text_label wScrollingText2
wScrollingText3:: ; 0xd5dc
scrolling_text_label wScrollingText3
MACRO stationary_text_label
\1Enabled::ds 1 ; Toggles if enabled. 0 is off, non-0 is on
\1MessageBoxOffset:: ds 1 ; Offset in wBottomMessageBuffer to place first character of text
\1SourceTextOffset:: ds 1 ; Offset in wBottomMessageText for the text to be displayed
\1Duration::
\1DurationLowByte:: ds 1 ;how many frames to stay on screen.
\1DurationHighByte:: ds 1 ;thiswill trigger as 0 if >= 128
ENDM
wStationaryText1:: ; 0xd5e4
stationary_text_label wStationaryText1
wStationaryText2:: ; 0xd5e9
stationary_text_label wStationaryText2
wStationaryText3:: ; 0xd5ee
stationary_text_label wStationaryText3
wCapturingMon:: ; 0xd5f3
; Set to 1 when the capturing animation starts.
ds $1
wBallCaptureAnimation:: ; 0xd5f4
animation wBallCaptureAnimation
wWhichPinballUpgradeTrigger:: ; 0xd5f7
ds $1
wWhichPinballUpgradeTriggerId:: ; 0xd5f8
ds $1
wBallUpgradeTriggerStates:: ; 0xd5f9
; Marks each of the 3 ball upgrade triggers as On (1) or Off (0).
; When all three are On, it upgrades the pinball field multiplier. (e.g. Pokeball -> Great Ball)
ds $3
wBallUpgradeTriggersBlinking:: ; 0xd5fc
; Set to 1 when the 3 ball upgrade triggers are blinking for a couple seconds after successfully
; lighting up all 3. Set to 0, otherwise.
ds $1
wBallUpgradeTriggersBlinkingFramesRemaining:: ; 0xd5fd
; Holds the number of frames remaining in the ball upgrade blinking animation.
ds $1
wDittoSlotCollision:: ; 0xd5fe
; Second byte is set by HandleGameObjectCollision, but is unused
ds $2
wDittoEnterOrExitCounter:: ; 0xd600
; Number of frames remaining in the process when the pinball is entering or exiting the Ditto cave.
; This functions the same way as wSlotEnterOrExitCounter.
ds $1
wSlotCollision:: ; 0xd601
; Second byte is set by HandleGameObjectCollision, but is unused
ds $2
wSlotEnterOrExitCounter:: ; 0xd603
; Number of frames remaining in the process when the pinball is entering or exiting the slot cave.
; This functions the same way as wDittoEnterOrExitCounter.
ds $1
wSlotIsOpen:: ; 0xd604
; Whether or not the Slot is open for the pinball to enter. 1 = open; 0 = closed
ds $1
ds $1 ; unused
wSlotGlowingAnimationCounter:: ; 0xd606
; When the slot is open, this counter increments once every frame, which controls the glowing
; animation around the slot cave.
ds $1
wFramesUntilSlotCaveOpens:: ; 0xd607
; When set to non-zero value, it decrements once per frame. When it hits 0, the Slot cave will open.
ds $1
wOpenedSlotByGetting4CAVELights:: ; 0xd608
; Set to 1 when the slot bonus was trigered by lighting up all 4 CAVE lights.
; See wCAVELightStates
ds $1
wOpenedSlotByGetting3Pokeballs:: ; 0xd609
; Set to 1 when the slot bonus was triggered by achieving 3 Pokeballs (the pokeballs underneath the billboard).
; See wNumPokeballs.
ds $1
wWhichBonusMultiplierRailing:: ; 0xd60a
ds $1
wWhichBonusMultiplierRailingId:: ; 0xd60b
ds $1
wBonusMultiplierTensDigit:: ; 0xd60c
; Holds the tens digit for the current bonus multiplier value. This number is displayed on the left-side bonus multiplier railing.
ds $1
wBonusMultiplierOnesDigit:: ; 0xd60d
; Holds the ones digit for the current bonus multiplier value. This number is displayed on the right-side bonus multiplier railing.
ds $1
wd60e:: ; 0xd60e
ds $1
wd60f:: ; 0xd60f
ds $1
wd610:: ; 0xd610
ds $1
wd611:: ; 0xd611
ds $1
wd612:: ; 0xd612
ds $1
wShowBonusMultiplierBottomMessage:: ; 0xd613
; Set to 1 when the bonus multiplier message should appear on the bottom of the screen. 0 otherwise.
ds $1
wd614:: ; 0xd614
ds $1
wd615:: ; 0xd615
ds $1
wGameOver:: ; 0xd616
ds $3
wSlotRewardProgress:: ; 0xd619
; Increases in increments of 10 each time a slot reward is obtained.
ds $1
wCurSlotRewardRouletteIndex:: ; 0xd61a
ds $1
wSlotRouletteCounter:: ; 0xd61b
ds $1
ds $1
wSlotRouletteBillboardPicture:: ; 0xd61d
ds $1
wSlotRouletteSlowed:: ; 0xd61e
ds $1
wCurSlotBonus:: ; 0xd61f
ds $1
wSlotAnyPokemonCaught:: ; 0xd620
; Used by the slot logic to store whether or not any pokemon are caught.
ds $1
wSlotBallIncrease:: ; 0xd621
ds $1
wCatchEmOrEvolutionSlotRewardActive:: ; 0xd622
; Set to 1 if the "Start Catch 'Em Mode" Slot Reward is received.
; Set to 2 if the "Start Evolution Mode" Slot Reward is received.
ds $1
wBonusStageSlotRewardActive:: ; 0xd623
; Set to 1 when the "Go To Bonus" Slot Reward is received.
ds $1
wPreviousNumPokeballs:: ; 0xd624
; See wNumPokeballs. This holds the previous number of them to handle the blinking
; animation, so that it only blinks the newly-acquired pokeballs.
ds $1
wNumPokeballs:: ; 0xd625
; The number of Pokeballs that appear directly underneath the billboard area.
; When you get 3 of these, the bonus stage opens up. This number is increased
; when doing things like catching of evolving a pokemon.
ds $1
wPokeballBlinkingCounter:: ; 0xd626
; Counts the number of frames left in the blinking pokeballs animation.
; These Pokeballs are located underneath the billboard area, and blink after
; doing things such as catching or evolving a pokemon.
ds $1
ds $1 ; unused byte
wNumPokemonCaughtInBallBonus:: ; 0xd628
; Counts the number of pokemon caught in a single ball bonus.
ds $1
wNumPokemonEvolvedInBallBonus:: ; 0xd629
; Counts the number of pokemon evolved in a single ball bonus.