-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathrammap.asm
2306 lines (2102 loc) · 53.1 KB
/
rammap.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
incsrc "hardware_registers.asm"
; WORK RAM
ORG $000000
; scratch ram
; used for many various purposes
_0: skip 1
_1: skip 1
_2: skip 1
_3: skip 1
_4: skip 1
_5: skip 1
_6: skip 1
_7: skip 1
_8: skip 1
_9: skip 1
_A: skip 1
_B: skip 1
_C: skip 1
_D: skip 1
_E: skip 1
_F: skip 1
; === $7E0010 ===
; 1 byte
; non-zero during game loop
; set to zero after game loop
; must be non-zero to start game loop
; set to non-zero at end of V-blank
LagFlag: skip 1
; === $7E0011 ===
; 1 byte
; the ID of the currently queued IRQ
; for areas that use multiple IRQs, this value distinguishes them
IRQType: skip 1
; === $7E0012 ===
; 1 byte
; stripe image ID to draw
; index into a list of pointers to stripe images to draw
; must be divisible by 3 or it will draw garbage
; if this value is zero, the address points to the stripe image ram buffer
StripeImage: skip 1
; === $7E0013 ===
; 1 byte
; frame counter
; increments for every frame of execution
; not incremented during lag frames
TrueFrame: skip 1
; === $7E0014 ===
; 1 byte
; frame counter
; increments for every frame of execution when gameplay is not paused or frozen
; not incremented during lag frames
EffFrame: skip 1
; === $7E0015 ===
; 1 byte
; controller data for the currently active player
; byetudlr
; |||||||+ set if right on the dpad was pressed this frame
; ||||||+- set if left on the dpad was pressed this frame
; |||||+-- set if down on the dpad was pressed this frame
; ||||+--- set if up on the dpad was pressed this frame
; |||+---- set if the start button was pressed this frame
; ||+----- set if the select button was pressed this frame
; |+------ set if the Y button was pressed this frame
; +------- set if the A or B button were pressed this frame
byetudlrHold: skip 1
; Valid values
!ButB = %10000000
!ButY = %01000000
!ButSelect = %00100000
!ButStart = %00010000
!DpadUp = %00001000
!DpadDown = %00000100
!DpadLeft = %00000010
!DpadRight = %00000001
; === $7E0016 ===
; 1 byte
; controller data for the currently active player
; byetudlr
; |||||||+ set if right on the dpad is held this frame
; ||||||+- set if left on the dpad is held this frame
; |||||+-- set if down on the dpad is held this frame
; ||||+--- set if up on the dpad is held this frame
; |||+---- set if the start button is held this frame
; ||+----- set if the select button is held this frame
; |+------ set if the Y button is held this frame
; +------- set if the B button is held this frame
byetudlrFrame: skip 1
; Valid values
!ButB = %10000000
!ButY = %01000000
!ButSelect = %00100000
!ButStart = %00010000
!DpadUp = %00001000
!DpadDown = %00000100
!DpadLeft = %00000010
!DpadRight = %00000001
; === $7E0017 ===
; 1 byte
; controller data for the currently active player
; axlr0000
; ||||++++ always 0
; |||+---- set if the R button was pressed this frame
; ||+----- set if the L button was pressed this frame
; |+------ set if the X button was pressed this frame
; +------- set if the A button was pressed this frame
axlr0000Hold: skip 1
; Valid values
!ButA = %10000000
!ButX = %01000000
!ButL = %00100000
!ButR = %00010000
; === $7E0018 ===
; 1 byte
; controller data for the currently active player
; axlr0000
; ||||++++ always 0
; |||+---- set if the R button is held this frame
; ||+----- set if the L button is held this frame
; |+------ set if the X button is held this frame
; +------- set if the A button is held this frame
axlr0000Frame: skip 1
; Valid values
!ButA = %10000000
!ButX = %01000000
!ButL = %00100000
!ButR = %00010000
; === $7E0019 ===
; 1 byte
; the player's current powerup status
Powerup: skip 1
; Valid values
!Powerup_Small = 0
!Powerup_Big = 1
!Powerup_Cape = 2
!Powerup_Flower = 3
; === $7E001A ===
; 2 bytes
; the horizontal scroll value for background layer 1
; value buffer for PPU register $210D, BG1HOFS
Layer1XPos: skip 2
; === $7E001C ===
; 2 bytes
; the vertical scroll value for background layer 1
; value buffer for PPU register $210E, BG1VOFS
Layer1YPos: skip 2
; === $7E001E ===
; 2 bytes
; the horizontal scroll value for background layer 2
; value buffer for PPU register $210F, BG2HOFS
Layer2XPos: skip 2
; === $7E0020 ===
; 2 bytes
; the vertical scroll value for background layer 2
; value buffer for PPU register $2110, BG2VOFS
Layer2YPos: skip 2
; === $7E0022 ===
; 2 bytes
; the horizontal scroll value for background layer 3
; value buffer for PPU register $2111, BG3HOFS
Layer3XPos: skip 2
; === $7E0024 ===
; 2 bytes
; the vertical scroll value for background layer 3
; value buffer for PPU register $2112, BG3VOFS
Layer3YPos: skip 2
; === $7E0026 ===
; 2 bytes
; the horizontal difference between the two interactive layers
; the difference between layer 1 and layer 2 or 3 depending on the level mode
Layer23XRelPos: skip 2
; === $7E0028 ===
; 2 bytes
; the vertical difference between the two interactive layers
; the difference between layer 1 and layer 2 or 3 depending on the level mode
Layer23YRelPos: skip 2
; === $7E002A ===
; 2 bytes
; the horizontal co-ordinate of the mode 7 fixed point
; the value stored here is #$0080 more than the PPU register
; value buffer for PPU register $211F, M7X
Mode7CenterX: skip 2
; === $7E002C ===
; 2 bytes
; the vertical co-ordinate of the mode 7 fixed point
; the value stored here is #$0080 more than the PPU register
; value buffer for PPU register $2120, M7Y
Mode7CenterY: skip 2
; === $7E002E ===
; 2 bytes
; the value of the A parameter for the mode 7 transformation matrix
; value buffer for PPU register $211B, M7A
Mode7ParamA: skip 2
; === $7E0030 ===
; 2 bytes
; the value of the B parameter for the mode 7 transformation matrix
; value buffer for PPU register $211C, M7B
Mode7ParamB: skip 2
; === $7E0032 ===
; 2 bytes
; the value of the C parameter for the mode 7 transformation matrix
; value buffer for PPU register $211D, M7C
Mode7ParamC: skip 2
; === $7E0034 ===
; 2 bytes
; the value of the D parameter for the mode 7 transformation matrix
; value buffer for PPU register $211E, M7D
Mode7ParamD: skip 2
; === $7E0036 ===
; 2 bytes
; the value of an angle, where #$0200 marks a complete circle
; used in calculation of mode 7 parameters, and in brown swinging platforms
Mode7Angle: skip 2
; === $7E0038 ===
; 1 byte
; the value of horizontal scaling, where #$20 marks the identity
; used in calculation of mode 7 parameters
; lower values result in higher scaling and vis-versa
Mode7XScale: skip 1
; === $7E0039 ===
; 1 byte
; the value of vertical scaling, where #$20 marks the identity
; used in calculation of mode 7 parameters
; lower values result in higher scaling and vis-versa
Mode7YScale: skip 1
; === $7E003A ===
; 2 bytes
; the horizontal scroll value for the mode 7 background layer
; value buffer for PPU register $210D, BG1HOFS
Mode7XPos: skip 2
; === $7E003C ===
; 2 bytes
; the vertical scroll value for the mode 7 background layer
; value buffer for PPU register $210E, BG1VOFS
Mode7YPos: skip 2
; === $7E003E ===
; 1 byte
; the background mode and layer character size settings
; value buffer for PPU register $2105, BGMODE
; 4321pmmm
; |||||+++ the background mode (0-7)
; ||||+--- set if background layer 3 has high priority
; ++++---- set if background layer 1/2/3/4 has 16x16 characters, else 8x8
MainBGMode: skip 1
; === $7E003F ===
; 1 byte
; index of the OBJ that should take highest priority
; value buffer for PPU register $2102, OAMADDL
; highest bit of $2103, OAMADDH, is set automatically
OAMAddress: skip 1
; === $7E0040 ===
; 1 byte
; color math settings
; value buffer for PPU register $2131, CGADSUB
; shbo4321
; ||++++++ set if background layer 1/2/3/4/OBJ/back color should participate in color math
; |+------ set if color math result should be halved (e.g. average)
; +------- set if subtract subscreens, else add
ColorSettings: skip 1
; === $7E0041 ===
; 1 byte
; window selection settings for background layers 1 and 2
; value buffer for PPU register $2123, W12SEL
; 2i1i2i1i
; |||||||+ background layer 1, in/out bit for window 1
; ||||||+- background layer 1, enable bit for window 1
; |||||+-- background layer 1, in/out bit for window 2
; ||||+--- background layer 1, enable bit for window 2
; |||+---- background layer 2, in/out bit for window 1
; ||+----- background layer 2, enable bit for window 1
; |+------ background layer 2, in/out bit for window 2
; +------- background layer 2, enable bit for window 2
Layer12Window: skip 1
; === $7E0042 ===
; 1 byte
; window selection settings for background layers 3 and 4
; value buffer for PPU register $2124, W34SEL
; 2i1i2i1i
; |||||||+ background layer 3, in/out bit for window 1
; ||||||+- background layer 3, enable bit for window 1
; |||||+-- background layer 3, in/out bit for window 2
; ||||+--- background layer 3, enable bit for window 2
; |||+---- background layer 4, in/out bit for window 1
; ||+----- background layer 4, enable bit for window 1
; |+------ background layer 4, in/out bit for window 2
; +------- background layer 4, enable bit for window 2
Layer34Window: skip 1
; === $7E0043 ===
; 1 byte
; window selection settings for OBJ layer and color window
; value buffer for PPU register $2125, WOBJSEL
; 2i1i2i1i
; |||||||+ OBJ layer, in/out bit for window 1
; ||||||+- OBJ layer, enable bit for window 1
; |||||+-- OBJ layer, in/out bit for window 2
; ||||+--- OBJ layer, enable bit for window 2
; |||+---- color window, in/out bit for window 1
; ||+----- color window, enable bit for window 1
; |+------ color window, in/out bit for window 2
; +------- color window, enable bit for window 2
OBJCWWindow: skip 1
; === $7E0044 ===
; 1 byte
; color math enable and selection switch
; value buffer for PPU register $2130, CGSWSEL
; mmss--fd
; |||| |+ set if direct color is enabled
; |||| +- set for color math between subscreens, clear for fixed color math
; ||++---- color window sub screen (00 = on, 01 = inside, 10 = outside, 11 = off)
; ++------ color window main screen (00 = on, 01 = inside, 10 = outside, 11 = off)
ColorAddition: skip 1
; === $7E0045 ===
; 2 bytes
; In horizontal levels:
; the X coordinate (in 16x16 tiles) of the
; left edge of currently loaded Layer 1 tilemap data
; In vertical levels:
; the Y coordinate (in 16x16 tiles) of the
; top edge of currently loaded Layer 1 tilemap data
Layer1TileUp: skip 2
; === $7E0047 ===
; 2 bytes
; In horizontal levels:
; the X coordinate (in 16x16 tiles) of the
; right edge of currently loaded Layer 1 tilemap data
; In vertical levels:
; the Y coordinate (in 16x16 tiles) of the
; bottom edge of currently loaded Layer 1 tilemap data
Layer1TileDown: skip 2
; === $7E0049 ===
; 2 bytes
; In horizontal levels:
; the X coordinate (in 16x16 tiles) of the
; left edge of currently loaded Layer 2 tilemap data
; In vertical levels:
; the Y coordinate (in 16x16 tiles) of the
; top edge of currently loaded Layer 2 tilemap data
Layer2TileUp: skip 2
; === $7E004B ===
; 2 bytes
; In horizontal levels:
; the X coordinate (in 16x16 tiles) of the
; right edge of currently loaded Layer 2 tilemap data
; In vertical levels:
; the Y coordinate (in 16x16 tiles) of the
; bottom edge of currently loaded Layer 2 tilemap data
Layer2TileDown: skip 2
; === $7E004D ===
; 2 bytes
; In horizontal levels:
; the X coordinate of Layer 1 when a column of tiles
; was last uploaded to VRAM via scrolling left
; In vertical levels:
; the Y coordinate of Layer 1 when a column of tiles
; was last uploaded to VRAM via scrolling up
Layer1PrevTileUp: skip 2
; === $7E004F ===
; 2 bytes
; In horizontal levels:
; the X coordinate of Layer 1 when a column of tiles
; was last uploaded to VRAM via scrolling right
; In vertical levels:
; the Y coordinate of Layer 1 when a column of tiles
; was last uploaded to VRAM via scrolling down
Layer1PrevTileDown: skip 2
; === $7E0051 ===
; 2 bytes
; In horizontal levels:
; the X coordinate of Layer 2 when a column of tiles
; was last uploaded to VRAM via scrolling left
; In vertical levels:
; the Y coordinate of Layer 2 when a column of tiles
; was last uploaded to VRAM via scrolling up
Layer2PrevTileUp: skip 2
; === $7E0053 ===
; 2 bytes
; In horizontal levels:
; the X coordinate of Layer 2 when a column of tiles
; was last uploaded to VRAM via scrolling right
; In vertical levels:
; the Y coordinate of Layer 2 when a column of tiles
; was last uploaded to VRAM via scrolling down
Layer2PrevTileDown: skip 2
; === $7E0055 ===
; 1 byte
; Which direction Layer 1 has scrolled
; used for handling camera behavior and spawning sprites
Layer1ScrollDir: skip 1
; Valid values
!ScrollDir_LeftUp = 0
!ScrollDir_Loading = 1
!ScrollDir_RightDown = 2
; === $7E0056 ===
; 1 byte
; Which direction Layer 2 has scrolled
; used for handling camera behavior
Layer2ScrollDir: skip 1
; Valid values
!ScrollDir_LeftUp = 0
!ScrollDir_RightDown = 2
; === $7E0057 ===
; 1 byte
; Position of a 16x16 tile within a screen
; Used during level loading
LevelLoadPos: skip 1
; === $7E0058 ===
; 1 byte
; unused
WRAM_0058: skip 1
; === $7E0059 ===
; 1 byte
; Size or extended type of the currently loading object
LvlLoadObjSize: skip 1
; === $7E005A ===
; 1 byte
; Object number of the currently loading object
LvlLoadObjNo: skip 1
; === $7E005B ===
; 1 byte
; Level type properties
; id----21
; || |+ Layer 1 is vertical
; || +- Layer 2 is vertical
; |+------ set to disable interaction with Layer 1
; +------- set to enable interaction with Layer 2
ScreenMode: skip 1
; Valid values
!ScrMode_Layer1Vert = %01
!ScrMode_Layer2Vert = %10
!ScrMode_DisableL1Int = %01000000
!ScrMode_EnableL2Int = %10000000
; === $7E005C ===
; 1 byte
; unused
WRAM_005C: skip 1
; === $7E005D ===
; 1 byte
; Number of screens in a level
; Set to -1 during Ludwig and Reznor battles, which represents 1.5
LevelScrLength: skip 1
; === $7E005E ===
; 1 byte
; In horizontal levels: the last screen of the level (stop scrolling right)
LastScreenHoriz: skip 1
; === $7E005F ===
; 1 byte
; In vertical levels: the last screen of the level (stop scrolling down)
LastScreenVert: skip 1
; === $7E0060 ===
; 4 bytes
; unused
WRAM_0060: skip 4
; === $7E0064 ===
; 1 byte
; Default properties for all objects
; yxppccct
; |||||||+ 9th bit of tile number
; ||||+++- palette
; ||++---- object priority
; |+------ x flip
; +------- y flip
SpriteProperties: skip 1
; Valid values
!OBJ_Priority0 = %000000
!OBJ_Priority1 = %010000
!OBJ_Priority2 = %100000
!OBJ_Priority3 = %110000
!OBJ_XFlip = %01000000
!OBJ_YFlip = %10000000
; === $7E0065 ===
; 3 bytes
; pointer to Layer 1 level data
Layer1DataPtr:
; === $7E0065 ===
; 2 bytes
; position of the currently loading line of staff roll text
StaffRollLinePos: skip 2
; === $7E0067 ===
; 1 byte
; current line of the staff roll being drawn
StaffRollCurLine: skip 1
; === $7E0068 ===
; 3 bytes
; pointer to Layer 2 level data
Layer2DataPtr: skip 3
; === $7E006B ===
; 3 bytes
; pointer to Layer 1 Map16 data
Map16LowPtr: skip 3
; === $7E006E ===
; 3 bytes
; pointer to Layer 2 Map16 data
Map16HighPtr: skip 3
; === $7E0071 ===
; 1 byte
; Current player animation that blocks player input
PlayerAnimation: skip 1
; Valid values
!PlayerAni_Default = 0
!PlayerAni_IFrames = 1
!PlayerAni_Growing = 2
!PlayerAni_GetCape = 3
!PlayerAni_GetFire = 4
!PlayerAni_EnterHPipe = 5
!PlayerAni_EnterVPipe = 6
!PlayerAni_CannonPipe = 7
!PlayerAni_YoshiHeaven = 8
!PlayerAni_Death = 9
!PlayerAni_EnterCastle = 10
!PlayerAni_Frozen = 11
!PlayerAni_CastleCutscene = 12
!PlayerAni_Door = 13
; === $7E0072 ===
; 1 byte
; set if player is not on the ground
PlayerInAir: skip 1
; Valid values
!PlayerAir_Jump = 11 ; normal jump or swimming in water level
!PlayerAir_Takeoff = 12 ; pspeed jump
!PlayerAir_Falling = 36 ; descending or swimming in non-water level
; === $7E0073 ===
; 1 byte
; set if player is ducking
PlayerIsDucking: skip 1
; Valid values
!PlayerDuck_Duck = 4
; === $7E0074 ===
; 1 byte
; set if player is climbing
; n--shbtc
; | ||||+ center collision
; | |||+- top collision
; | ||+-- bottom collision
; | |+--- top horizontal collision
; | +---- bottom horizontal collision
; +------- can climb diagonally (net vs vine)
PlayerIsClimbing: skip 1
; Valid values
!PlayerClimb_Center = %00001
!PlayerClimb_Top = %00010
!PlayerClimb_Bottom = %00100
!PlayerClimb_SideTop = %01000
!PlayerClimb_SideBottom = %10000
!PlayerClimb_Diagonally = %10000000
; === $7E0075 ===
; 1 byte
; set if player is in water
PlayerInWater: skip 1
; === $7E0076 ===
; 1 byte
; direction player is facing
PlayerDirection: skip 1
; Valid values
!PlayerDir_Left = 0
!PlayerDir_Right = 1
; === $7E0077 ===
; 1 byte
; flags for player collision with blocks
; s--cudlr
; | ||||+ collision on right side
; | |||+- collision on left side
; | ||+-- collision on bottom
; | |+--- collision on top
; | +---- collision inside
; +------- collision with edge of screen
PlayerBlockedDir: skip 1
; Valid values
!PlayerBlock_Right = %00001
!PlayerBlock_Left = %00010
!PlayerBlock_Bottom = %00100
!PlayerBlock_Top = %01000
!PlayerBlock_Inside = %10000
!PlayerBlock_Screen = %10000000
; === $7E0078 ===
; 1 byte
; bitfield to hide certain tiles that make up the player
; sabcxylu
; |||||||+ upper half of body
; ||||||+- lower half of body
; ||||++-- various extra smaller tiles
; |||+---- cape tile
; |++----- various other cape tiles
; +------- don't decrement star timer (used with brown swinging platforms)
PlayerHiddenTiles: skip 1
; Valid values
!PlayerHide_None = %00000000
!PlayerHide_Body = %00000011
!PlayerHide_Extra = %00001100
!PlayerHide_Cape = %00010000
!PlayerHide_CapeX1 = %00100000
!PlayerHide_CapeX2 = %01000000
!PlayerHide_All = %01111111
!PlayerHide_PauseStar = %10000000
; === $7E0079 ===
; 1 byte
WRAM_0079: skip 1
; === $7E007A ===
; 2 bytes
; 4.12 fixed point player horizontal speed (pixels per frame)
; while all 16 bits are used for acceleration, only the
; upper 8 bits are used for position calculation
PlayerXSpeed: skip 2
; === $7E007C ===
; 2 bytes
; 4.12 fixed point player vertical speed (pixels per frame)
; while all 16 bits are used for acceleration, only the
; upper 8 bits are used for position calculation
PlayerYSpeed: skip 2
; === $7E007E ===
; 2 bytes
; player horizontal position relative to the screen boundary
PlayerXPosScrRel: skip 2
; === $7E0080 ===
; 2 bytes
; player horizontal position relative to the screen boundary
PlayerYPosScrRel: skip 2
; === $7E0082 ===
; 3 bytes
; pointer to various slope data
; changes with the level tileset
SlopesPtr: skip 3
; === $7E0085 ===
; 1 byte
; set if the level is a completely underwater level
LevelIsWater: skip 1
; === $7E0086 ===
; 1 byte
; set if the level is slippery
LevelIsSlippery: skip 1
; === $7E0087 ===
; 1 byte
; unused
WRAM_0087: skip 1
; === $7E0088 ===
; 1 byte
; timer that controls how long the animation is
; for entering/exiting a pipe
PipeTimer:
; === $7E0088 ===
; 1 byte
; index into no yoshi intro auto input
NoYoshiInputIndex:
; === $7E0088 ===
; 1 byte
; timer for castle cutscene auto input (how long each input lasts)
CutsceneInputTimer: skip 1
; === $7E0089 ===
; 1 byte
; which pipe animation to display
PlayerPipeAction:
; Valid values
!PlayerPipe_EnterRight = 0
!PlayerPipe_EnterLeft = 1
!PlayerPipe_EnterDown = 2
!PlayerPipe_EnterUp = 3
!PlayerPipe_ExitLeft = 4
!PlayerPipe_ExitRight = 5
!PlayerPipe_ExitUp = 6
!PlayerPipe_ExitDown = 7
; === $7E0089 ===
; 1 byte
; timer for no yoshi intro auto input (how long each input lasts)
NoYoshiInputTimer: skip 1
; === $7E008A ===
; 1 byte
; temporary location for player Y speed
; used when calculating player speed when running on a wall
TempPlayerYSpeed:
; === $7E008A ===
; 2 bytes
; running sum for calculating the checksum of save files
PartialChecksum:
; === $7E008A ===
; 1 byte
; number of options in the current menu
MaxMenuOptions:
; === $7E008A ===
; 3 bytes
; pointer to the current position within compressed graphics data
GraphicsCompPtr:
; === $7E008A ===
; 1 byte
; which player interaction points are in water
; ---shbtc
; ||||+ center collision
; |||+- top collision
; ||+-- bottom collision
; |+--- top horizontal collision
; +---- bottom horizontal collision
InteractionPtsInWater: skip 1
; === $7E008B ===
; 1 byte
; which player interaction points are on a climbable tile
; ---shbtc
; ||||+ center collision
; |||+- top collision
; ||+-- bottom collision
; |+--- top horizontal collision
; +---- bottom horizontal collision
InteractionPtsClimbable: skip 1
; === $7E008C ===
; 1 byte
; which side of a block the current player interaction point is touching
InteractionPtDirection: skip 1
; === $7E008D ===
; 3 bytes
; pointer to the current position within decompressed graphics data
GraphicsUncompPtr:
; === $7E008D ===
; 1 byte
; temporary copy of PlayerIsOnGround
; ------21
; |+ set if player standing on Layer 1
; +- set if player standing on Layer 2
TempPlayerGround: skip 1
; === $7E008E ===
; 1 byte
; temporary copy of ScreenMode
; Level type properties
; id----21
; || |+ Layer 1 is vertical
; || +- Layer 2 is vertical
; |+------ set to disable interaction with Layer 1
; +------- set to enable interaction with Layer 2
TempScreenMode: skip 1
; === $7E008F ===
; 1 byte
; temporary copy of PlayerInAir
TempPlayerAir:
; === $7E008F ===
; 1 byte
; index into castle cutscene auto input
CutsceneInputIndex: skip 1
; === $7E0090 ===
; 1 byte
; vertical position of the player within a block
; relative to the player's feet
PlayerYPosInBlock: skip 1
; === $7E0091 ===
; 1 byte
; vertical position of the player's interaction point within a block
PlayerBlockMoveY: skip 1
; === $7E0092 ===
; 1 byte
; horizontal position of the player within a block
; relative to the center of the player
PlayerXPosInBlock: skip 1
; === $7E0093 ===
; 1 byte
; which side of a tile the player is currently within
PlayerBlockXSide: skip 1
; === $7E0094 ===
; 2 bytes
; horizontal position of the player within the level
; forward calculation for the next frame
PlayerXPosNext: skip 2
; === $7E0096 ===
; 2 bytes
; vertical position of the player within the level
; forward calculation for the next frame
PlayerYPosNext: skip 2
; === $7E0098 ===
; 2 bytes
; vertical position of the currently processing player interaction point
TouchBlockYPos: skip 2
; === $7E009A ===
; 2 bytes
; horizontal position of the currently processing player interaction point
TouchBlockXPos: skip 2
; === $7E009C ===
; 1 byte
; a Map16 tile to draw to the screen
Map16TileGenerate: skip 1
; Valid values
!Map16Gen_CollectEmpty = 1 ; sets item memory
!Map16Gen_Empty = 2
!Map16Gen_Vine = 3
!Map16Gen_Bush = 4
!Map16Gen_TurningBlock = 5
!Map16Gen_Coin = 6
!Map16Gen_MushStalk = 7
!Map16Gen_MoleHole = 8
!Map16Gen_SolidEmpty = 9
!Map16Gen_TurnMulticoin = 10
!Map16Gen_QMulticoin = 11
!Map16Gen_TurnBlock = 12
!Map16Gen_UsedBlock = 13
!Map16Gen_NoteBlock = 14
!Map16Gen_NoteUnused = 15
!Map16Gen_NoteAllSides = 16
!Map16Gen_TurnBounce = 17
!Map16Gen_Roulette = 18
!Map16Gen_OnOff = 19
!Map16Gen_PipeLeft = 20
!Map16Gen_PipeRight = 21
!Map16Gen_CollectUsed = 22 ; sets item memory
!Map16Gen_CollectCorrect = 23 ; sets item memory
!Map16Gen_CollectDragon = 24 ; sets item memory
!Map16Gen_NetDoorEmpty = 25
!Map16Gen_NetDoorClosed = 26
!Map16Gen_FlatSwitch = 27
; === $7E009D ===
; 1 byte
; locks most animations and movements when set
SpriteLock: skip 1
; === $7E009E ===
; 12 bytes
; sprite ID table
SpriteNumber: skip 12
; === $7E00AA ===
; 12 bytes
; sprite vertical speed table
SpriteYSpeed: skip 12
; === $7E00B6 ===
; 12 bytes
; sprite horizontal speed table
SpriteXSpeed: skip 12
; === $7E00C2 ===
; 12 bytes
; various sprite properties table
SpriteTableC2: skip 12
; === $7E00CE ===
; 3 bytes
; pointer to the level's sprite data
SpriteDataPtr: skip 3
; === $7E00D1 ===
; 2 bytes
; horizontal position of the player within the level
PlayerXPosNow: skip 2
; === $7E00D3 ===
; 2 bytes
; vertical position of the player within the level
PlayerYPosNow: skip 2
; === $7E00D5 ===
; 3 bytes
; pointer to the segment data of currently processing Wiggler
WigglerSegmentPtr: skip 3
; === $7E00D8 ===
; 12 bytes
; sprite vertical position table
; lower 8 bits
SpriteYPosLow: skip 12
; === $7E00E4 ===
; 12 bytes
; sprite horizontal position table
; lower 8 bits
SpriteXPosLow: skip 12
; === $7E00F0 ===
; 16 bytes
; unused
WRAM_00F0:
ORG $000100
StackPage:
; === $7E0100 ===
; 1 byte
; the current game mode
GameMode: skip 1
; Valid values
!GameMode_LoadPresents = 0
!GameMode_Presents = 1
!GameMode_FadeToTitleScreen = 2
!GameMode_LoadTitleScreen = 3
!GameMode_PrepareTitleScreen = 4
!GameMode_FadeInTitleScreen = 5
!GameMode_SpotlightTitleScreen = 6
!GameMode_TitleScreen = 7
!GameMode_FileSelect = 8
!GameMode_FileDelete = 9
!GameMode_PlayerSelect = 10
!GameMode_FadeToOverworld = 11
!GameMode_LoadOverworld = 12
!GameMode_FadeInOverworld = 13
!GameMode_Overworld = 14
!GameMode_FadeToLevel = 15
!GameMode_FadeLevelBlack = 16
!GameMode_LoadLevel = 17
!GameMode_PrepareLevel = 18