forked from DRGN-DRC/20XX-HACK-PACK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScratchpad - DRGN.txt
1603 lines (1181 loc) · 56.8 KB
/
Scratchpad - DRGN.txt
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
Created by DRGN of Smashboards
My own R&D combined with random notes of interest from others, mostly specific to 20XX.
TOC (can CTRL-F for these):
General / Memory Card
DOL 20XX Differences
On the CSS (MnSlChr)
Unique Closed Ports (UCP_14_9 Notes)
Special Game Modes
Special Game Modes Text (SdMenu.usd)
Stage Modifications
DOL Data Tables
Color Modifications
On the Debug Menu
Animation File Preloading
/-----------------------\
============= General / Memory Card =====================================
\-----------------------/ + Mem card/flag info
20XX version number changes need to be updated in these locations:
Disc Image Name, Short Title, and Long Title (boot.bin and opening.bnr files)
0x3A4CDD in MnSlChr (for Debug Menu display)
Texture on CSS upper-right (in MnSlChr @0x12760)
In DOL at 803FA154|0x3F7154; checked by OnBoot code
- this last one is the main one and the most detailed (referenced by internal code)
- includes "20XX" string, followed by bytes for project#/major/minor/patch
- cannot do major/minor/patch numbers >9 without updating "Enable OSReport Print on Crash"
- included with the "Debug Menu Region Overwrites" mod
SD Remix version number needs to be updated in the texture in IfComSD.dat
The version shown in OSReport prints is sourced from the DOL location.
There's a flag for playing audio files @804D6B94 (i.e. -0x4B0C(r13)); handled by the Every Frame Function (in Scratchpad). Processes any non-0 ID set there. Should be linked to the SFX player code in the 20XXHP MCM Library. From Achilles:
"I have a custom function that is executed every frame of the game to monitor a flag value, and if not 0, take the value as a SFX ID and play the SFX, then null the flag value. So if I ever need to play a SFX for a code, I just write the SFX ID to this RAM address and I know my every-frame code will take care of it next frame (ex. the SFX when hitting L/R for alternate costumes)."
IfAll.usd is loaded into a persistent heap after advancing from the title screen, and is present for the entire time the game is running.
input structs start at 0x804c1fac, with P1
structs are 0x44 long, thus P2=804C1FF0, P3=804C2034, P4=804C2078
5th struct at 804C20BC, which detects for all players
can simulate controller inputs by writing to this area at
the start of ButtonPresses_CopyInputsToStruct (80019900)
probably better to load inputs to the fighter properties at 0x65C
0x02:
1000 = START
0200 = B
0100 = A
0800 = Y
0400 = X
0010 = Z
0040 = L
0020 = R
0008 = D UP
0004 = D DOWN
0001 = D LEFT
0002 = D RIGHT
more detailed info here: https://github.com/Punkline/ppc_melee_codefuncs/blob/main/.include/melee_modules/MPad.s
Dolphin FYI:
Highlighted line (when stepping through code) has NOT been executed yet; it is about to be on next step.
When branching, the distance value includes the length of the branch itself; i.e. the branch is from the address of the branch, not the address immediately following the branch.
Stages upgrades:
https://smashboards.com/threads/the-20xx-melee-training-hack-pack-v4-07-7-04-17.351221/page-178#post-21761748
Memory card space and flag regions
- The 'OnBoot Function' code copies flag data from memory card to DOL space
- Every Frame Code copies flag data from DOL space to memory card RAM space
- Default 20XX flags are stored in MnSlChr at 0x3E2010
- The DOL space is broken into two sections: Ranges restored by 'Reset 20XX' code:
803FA154|0x3F7154 0x380 bytes 803FA174-803FA4E4
803FA848|0x3F7848 0x11E0 bytes 803FA840-803FBC68
- Debug menu data is between the two, at 803FA4D0 to 803FA848 (0x378 bytes long)
- It seems not all of this space is actually used
# Initial copy in RAM; one contiguous region
8045D850 Start of nametag data (Vulnerable name on memory card);
^ I think the version string may be overwritten on save
80469B94 End of last nametag (start of 20XX debug menu flag saves)
8046B0EC End of memcard data (61892/F1C4 total); last byte saved/restored is at B0E8
B0EC-9B94= 0x1558 bytes
The flags in the next two sections are not saved to memory card:
value offset (dol|ram): code name: string offset:
# New code flags in DOL (802288E0 -
0x2254C0 802288E0 Free / Not used
0x2254C4 Disable Wobbling
0x2254C8 802288E8 All Floors Are Drop-Through
0x2254CC low-poly mode
0x2254D0 802288F0 big heads mode
0x2254D4 802288F4 2D characters
0x2254D8 802288F8 Easier Wavedashes (ROA-Style)
0x2254DC 802288FC Missing L-Cancels Fall Through Floor
0x2254E0 80228900 Disable Spot Dodges
0x2254E4 80228904 Disable Air Dodges
0x2254E8 80228908 Longer Moonwalks
0x2254EC 8022890C Air Grabs
0x2254F0 80228910 Everyone Can Float
0x2254F4 80228914 Half-Frame Lag Reduction
- Reserving space for more general codes here
0x225590 802289B0 Kirby Taunt Gives Random Ability
0x225594 G&W Modulo
0x225598 Yoshi Eggs code
0x22559C Nana Respawns After 20 Seconds 80FAEEAA
0x2255A0 Buffed Hylian Sheild 80FAEEDA
0x2255A4 802289C4 Instant Zelda/Shiek Transform 80FAEEF8
0x2255A8 802289C8 Samus - Shoots Random Items 80FAEF20
0x2255AC 802289CC Falcon - Shinesplosion 80FAEF3E
- Reserving space for more character codes here
Flags below are saved to memory card and restored on boot:
Section 1 (803FA154|0x3F7154 to 803FA4D0|0x3F74D0; 0x380 bytes)
0x3F7154 803FA154 "20XX" string
0x3F7158 803FA158 version (the 4 bytes are project#/major/minor/patch)
-
0x3F7174 Game Speed Multiplier
-
0x3F7180 Disable Spot Dodge
0x3F7184 803FA184 Disable Aerial Attacks
0x3F7188 Disable Helpless State
0x3F718C Disable Grounded Jump
0x3F7190 Infinite Aerial Jumps
0x3F7194 803FA194 Blastzone Wrapping
0x3F7198 803FA198 Mushroom Kingdom Adventure (stage variations)
-
0x3F71A0 803FA1A0 Stocks Enter Text Mode At _
0x3F71A4 803FA1A4 Custom Y-axis HUD Offset
0x3F71A8 803FA1A8 Custom Stock Icon Location
-
0x3F71B4 803FA1B4 Random Stage Select flags for pages 1 through 4 (0x10 bytes)
^ the game's reference is at 8045C388
-
0x3F720C 803FA20C Damage Staling in Develop Mode
0x3F7210 803FA210 UCF
0x3F7214 803FA214 Always Draw Collision Links
0x3F7218 803FA218 Force Simple Stage Geometry
0x3F721C 803FA21C Disable FD BG Transitions
-
0x3F7230 803FA230 Disable Star KO
0x3F7234 803FA234 Taunt Canceling
-
0x3F723C 803FA23C Always Small Percents
0x3F7240 803FA240 Small Percents in Teams Mode
0x3F7244 803FA244 Disable Percent Game Logos (insignias)
0x3F7248 803FA248 PAL Stock Icon Size
-
0x3F725C Teams Stock Steal
-
0x3F7280 803FA280 Target Test VS Stage
0x3F7284 Disable Screen Rumble
-
0x3F727C 803FA27C Disable Targets and Flippers
-
0x3F728C 803FA28C P4 Custom Sheild Color RGB (0xC bytes, ordered BGR)
0x3F7298 P4 Custom Sheild Color (On/Off flag)
0x3F729C P3 Custom Sheild Color RGB (0xC bytes, ordered BGR)
0x3F72A8 P3 Custom Sheild Color (On/Off flag)
0x3F72AC P2 Custom Sheild Color RGB (0xC bytes, ordered BGR)
0x3F72B8 P2 Custom Sheild Color (On/Off flag)
0x3F72BC P1 Custom Sheild Color RGB (0xC bytes, ordered BGR)
0x3F72C8 P1 Custom Sheild Color (On/Off flag)
-
0x3F72D0 DK Always Full Giant Punch
0x3F72D4 Luigi Always Misfire
0x3F72D8 Fire Emblem Sword Swing Colors
0x3F72DC Samus Always Full Charge Shot
-
0x3F72E4 803FA2E4 current SSS page (1 byte)
-
0x3F72E7 803FA2E7 next SSS page (1 byte); SSS reload indicator for Every Frame Code; depricate?
-
0x3F7310 803FA310 Battlefield Rainbow Water BG
-
0x3F7354 803FA354 Jungle Japes Hacked
-
0x3F7360 803FA360 Greece Stage Variations
-
0x3F736C 803FA36C Disable Tap Jump - P1
0x3F7370 Disable Tap Jump - P2
0x3F7374 Disable Tap Jump - P3
0x3F7378 Disable Tap Jump - P4
0x3F737C 803FA37C T-Posing Characters
0x3F7380 803FA380 Characters Face Screen
-
0x3F7388 803FA388 Frame Counter Display (in-game)
-
0x3F7394 803FA394 Neutral Spawn Points
0x3F7398 803FA398 Custom FD Color (BLUE)
0x3F739C 803FA39C Custom FD Color (GREEN) <- could probably rewrite the code to condense these to 3 bytes
0x3F73A0 803FA3A0 Custom FD Color (RED)
0x3F73A4 803FA3A4 Custom FD Color (On/Off)
0x3F73A8 803FA3A8 Disable Yoshi's Shy Guys
0x3F73AC 803FA3AC Fountain of Dreams - Lagless
-
0x3F73B0 803FA3B0 Disable DL64 Wind
0x3F73B4 803FA3B4 Rainbow FD
-
0x3F73D0 Widescreen Mode
0x3F73D4 Skip Results Screen
0x3F73D8 20XX Toggles (flag to enable/disable in-game toggles)
-
0x3F73B4 803FA3B4 Rainbow FD
-
0x3F74CC 803FA4CC (last value saved/restored to/from memory card)
Section 2 (803FA848|0x3F7848 to 803FBA28|0x3F8A28; 0x11E0 bytes)
0x3F7850 803FA850 Custom BF 1 - Top/Left/Right Platform settings (0x24 bytes)
0x3F7874 803FA874 Custom BF 2 - Top/Left/Right Platform settings (0x24 bytes)
0x3F7898 803FA898 Custom BF 3 - Top/Left/Right Platform settings (0x24 bytes)
-
0x3F7EB0 803FAEB0 Timer scale
0x3F7EB4 Timer position (x/y values; 8 bytes)
-
0x3F7F60 803FAF60 Sheik Always Full Needles
0x3F7F64 Mewtwo Always Full Shadow Ball
0x3F7F68 Peach Down-B Pull
-
0x3F8A20 803FBA20 Freeze Pokemon Stadium
0x3F8A24 803FBA24 Display Time at Top Right of CSS (last value saved/restored to/from memory card)
Default flags are kept in the CSS file, at 0x3E2010 - 0x3E2380
From Achilles (on the GAMEID and memory card saves):
"The memory card filename ID is located in the DOL. For the 20XX Hack Pack, I modified it as seen below:
[ASCII "XXperSmashBros0110290334" at 0x3B7C5C]
Obviously, I changed it from "Super..." to "XXper...".
So a game save on a memory has two "parsed" IDs. First, is the Game ID it is saved for (e.g. GALE01). Second, is the memory card filename ID.
Since the above change is implemented to the DOL, it will look on the memory card for a save with "GALE01" and "XXperSmashBros..."
A vanilla Melee save is "GALE01", "SuperSmashBros..." so they don't conflict and can both be on a memory card simultaneously.
(I initially used "XuperSmashBros..." but then found out that 20XX TE's "settings" save is using that filename ID)
With the save files in the new Memory Card Management Debug Menu, it saves them under the "GALE01", "SuperSmashBros..." filename (so it overwrites/creates a new default Melee save file). You can just change that ASCII in the picture above right before the game executes a memory card save, and it will use the new memory card filename.
I have not figured out a way, if possible, to change the game ID of a save. This is the main reason why I haven't changed the Game ID of 20XX from GALE01, and don't plan to - so that I can create GALE01 saves from this Debug Menu.
20XXTE exploit cannot be activated from the Hack Pack."
/----------------------\
============= DOL 20XX Differences ==================================
\----------------------/
Diffs between a vanilla 1.02 DOL and the 20XXHP 5.0 base DOL (which has MCM library codes removed);
i.e. custom code regions and areas used for flag storage.
0x18DCC0 - 0x197B30 (0x9E70 bytes) zeroed out for custom code space
0x2254C0 - 0x225644 (0x184 bytes) zeroed out for custom code space
0x329584 - 0x329640 (0xBC bytes) zeroed out
0x32A8E8 - 0x32A9A0 (0xB8 bytes) zeroed out
0x32B96C - 0x32C208 (0x89C bytes) zeroed out for custom code space
0x32C998 - 0x332834 (0x5E9c bytes) zeroed out for PAL FSM List (currently not used) # Extra USB/MCC Region
0x39063C - 0x3907F4 (0x1B8 bytes) zeroed out for custom code space # Area 5 of USB/MCC
After the normal end of the DOL (compared to vanilla, at 0x438600), Achilles added an
extra 0x200 bytes, ending with the value 0x438800 (which is the file size). My guess is
this was a test he was doing to see if it would load into the game, and he just didn't
end up removing this afterwards. However since I'm not 100% sure, I'm leaving it for now.
New code-region overwrite settings for MCM/MMW;
see MCM's "settings.py" or MMW's codeRegionSettings.py for details.
/----------------------\
============= On the CSS (MnSlChr) ==================================
\----------------------/
loads into RAM at 0x80BEC720
heap is normally -> 80bd6440 -> 817f8ac0 C22680 12,723,840
but on the CSS its (for char preloading) 80bd6440 -> 811ad6c0 5D7280 6,124,160
Standalone CSS Color Modifications:
https://smashboards.com/threads/standalone-css-color-modification.450087/
Area to copy from .0sd to update .1sd/.2sd/.3sd: len
1) Tri-CSPs (for 0sd/2sd only) 0x4CA40 to 0x33CE40 0x2F0400 (vanilla CSPs in 1sd/3sd same offsets)
2) CSP Trim Colors 0x3A3C90 to 0x3A45E0 0x950
3) Random Neutral Stage names 0x3C10C0 to 0x3C1F10 0xE50
4) Song (Hex Track) Titles 0x3EC3C0 to 0x3EE1A8 0x1DE8
other regions that may want to be synced:
Debug Menu code 0x3A2848 to 0x3C8FFF
Every Frame Code and CSS Icon data 0x3E3B10 to 0x3EB1FF
Diffs from vanilla to 20XX 4.07++
---------------------------------
len:
Texture at 0x12760 Back button / version ID 0x9A0
Texture at 0x2F760 Closed Port Door 0xC800
Texture at 0x42620 "Stocks" (text) texture 0x2C0
Texture at 0x4baa0 NTSC text in upper-left 0xEA0
Special Melee Mode textures: (All are 0x420 in length)
0x343A80 "Single-Button"
0x343EC0 "Giant"
0x344700 "Fixed-Camera"
0x344F40 "Invisible"
0x344F40 "Lightning"
0x345780 "Super Sudden Death"
0x345BA0 "Slo-Mo"
0x345FC0 "Tiny"
Image data headers (outlined in my main notes file)
Closed Port Door alignment fix:
Two 4-byte ints changed (0 -> BE000000), starting at these offsets:
0x35A3F4
0x35A5F4
0x35A7F4
0x35A9F4 Probably Joint for P1
Diffs from 20XX 4.07++ to 20XX 5.0 (these are actual offsets changed; not struct starts)
----------------------------------
0x7 RT Start Offset (aka data section size) in header changed.
Needed to add RT entries, but couldn't add them to the end of
the table due to 20XX's data following the end of the file.
0xA RT Entry Count in header changed
0x2F760 Image Data for Closed Port Doors (CPDs) for P1 & P2
to
0x3BF60
0x348E8C CSS bottom bar color changed:
to TEV struct 'color 1' changed to 818FAB00
0x348E90 TEV struct 'color 2' changed to 818FAB00
0x34900C CSS top bar color changed:
to TEV struct 'color 1' changed to 818FAB00
0x349010 TEV struct 'color 2' changed to 818FAB00
0x349755 P4 CPD Image Data Header (pointer and image type changed)
0x349815 P4 CPD Image Data Header (pointer and image type changed)
0x34983F 00 -> FF Reverse P4? CPD left-bottom transparency mask in TEV Object
0x349843 FF -> 00 Reverse P4? CPD left-bottom transparency mask in TEV Object
0x349A5F P3 CPD Image Data Header (image type changed)
0x349ADD P3 Texture Object 1 (palette data header pointer added)
0x349B16 P3 CPD Image Data Header (pointer and image type changed)
0x349B3F 00 -> FF Reverse P3 CPD left-bottom transparency mask in TEV Object
0x349B43 FF -> 00 Reverse P3 CPD left-bottom transparency mask in TEV Object
0x349B9D P3 Texture Object 2 (palette data header pointer added)
0x349D55 P2 CPD Image Data Header (pointer and image type changed)
0x349E15 P2 CPD Image Data Header (pointer and image type changed)
0x349E3F 00 -> FF Reverse P2? CPD left-bottom transparency mask in TEV Object
0x349E43 FF -> 00 Reverse P2? CPD left-bottom transparency mask in TEV Object
0x34A055 P1 CPD Image Data Header (pointer and image type changed)
0x34A115 P1 CPD Image Data Header (pointer and image type changed)
0x34A13F 00 -> FF Reverse P1? CPD left-bottom transparency mask in TEV Object
0x34A143 FF -> 00 Reverse P1? CPD left-bottom transparency mask in TEV Object
0x358CA8 P1 CSP alignment improvement; x-scale adjusted
0x358CB4 P1 CSP alignment improvement; x-coord shifted
0x358CE8 P2 CSP alignment improvement; x-scale adjusted
0x358CF4 P2 CSP alignment improvement; x-coord shifted
0x358D28 P3 CSP alignment improvement; x-scale adjusted
0x358D34 P3 CSP alignment improvement; x-coord shifted
0x358D68 P4 CSP alignment improvement; x-scale adjusted
0x358D74 P4 CSP alignment improvement; x-coord shifted
CPDs alignment improvement; P1-P3 port doors moved approx. 1-2px to the right:
0x35A2B4 x-coord for P1 door (shifted slightly right)
0x35A4B4 x-coord for P2 door (shifted slightly right)
0x35A6B4 x-coord for P3 door (shifted slightly right)
0x35F5E5 P4 N/A button red color channel adjusted
0x35F5F1 P4 N/A button green color channel adjusted
0x35F600 P4 N/A button blue color channel adjusted
0x35F68D P3 N/A button red color channel adjusted
0x35F699 P3 N/A button green color channel adjusted
0x35F6A8 P3 N/A button blue color channel adjusted
0x35F735 P2 N/A button red color channel adjusted
0x35F741 P2 N/A button green color channel adjusted
0x35F750 P2 N/A button blue color channel adjusted
0x35F7DD P1 N/A button red color channel adjusted
0x35F7E9 P1 N/A button green color channel adjusted
0x35F7F8 P1 N/A button blue color channel adjusted
0x397BF1 2 structure pointers changed to point to relocated structs below.
0x397BFC Vanilla file structures from this point on (to the start of the RT) were
to moved into the file's "tail data", after the normal end of the file.
0x397C24 This was done to free up space for new RT entries used by the CPD edits.
0x397C2C 6 new RT Entries (0x18 bytes)
0x3A280C 8 existing RT entries adjusted for relocated structure offsets (0x20 bytes)
0x3A4CDD Debug Menu version string updated to "VERSION 5.0"
0x3A4FB0 Seems to be used for backing-up/restoring registers for the EFC for some reason
0x3AB078 Menu Item for CSS screens option count increased to 4
0x3BD3A8 "DODGEBALL INFO" text changed to "TURBOMODE INFO"
The following 3 functions removed from CSS file, and placed in
the DOL with "All Players Can Control the Debug Menu (Rewrite)":
0x3A51A0 (RAM:0x80F918C0; 0x70 in length) Debug Menu SDR Dynamic Menu Switcher
0x3A5830 (RAM:0x80F91F50; 0x44 in length) Debug Menu Player Flag Switcher
0x3BCE10 (RAM:0x80FA9530; 0x88 in length) Debug Menu Line Item Tracking
0x3BCEA0 vestigial; old "Coming Soon Load Logic", which is now in the main library (and added upon)
to (0x4C freed)
0x3BCEEC
0x3C10C0 Custom Stage name strings table updated with new stage names
to
0x3C1F10
0x3C1FE8 Pointer to "<MECHANICS CODES>" changed (reduced by 8 bytes)
0x3C2048 Pointer to 'UCF' string below changed (reduced by 8 bytes)
0x3C22B2 String for "SMASH TURN - 2 FRAME WINDOW :" changed to "Universal Controller Fix (UCF V.8) :"
(Mechanic itself replaced in DOL.)
0x3C24A0 CSS names changed (from "DEFAULT", "TRI-CSP")
0x3C9000 Previously the CPD (Closed Port Door) texture for all players. This space
to is now instead occupied by the image data for P3 & P4, and the palette
0x3DC040 data and palette headers/data for P3.
0x3E1FAC Vanilla structures relocated to here to make space for additional
to RT entries (required for CPD edits).
0x3E2000
0x3E3B00 Every Frame Code updated (v1.1)
0x3E5E00 New CSS Icon Data (Image data only)
to
0x3EB1FF
'EFC' end No further differences.
to
EOF
I don't know the date of the above change notes, but they likely no longer include everything.
Changes for the Closed Port Doors (CPDs) mentioned above are given
in greater detail in the "Unique Closed Ports" section.
All data/changes to MnSlChr after 0x3A2849 should be identical between the .0sd and .1sd files.
CSP texture size: 0x63E0
total CSPs: 118
total space taken by CSPs: 0x2E0940 (3,017,024 bytes)
stock icon size (used just for 1P mode CSS screens): 0x120
total regular stock icons: 127 (non-character icons are: target, empty target, smash insignia)
oversized stock icons (32x32): 2 <- for MH/CH
124 * 0x120 = 0x8B80 (35,712) bytes
MnSlChr sizes (in bytes):
dec hex amount added
vanilla 3,811,401 0x3A2849 n/a
20XX 4.07++: 4,128,785 0x3F0011 +0x4D7C8 (317384) bytes
~Max [known] possible: 4,325,376 0x420000 +0x2FFEF
other files needed on the CSS scene:
size in bytes: hex:
LbMcGame.usd 20,158 4EBE
NtMemAc.usd 4,351 10FF
MnExtAll.usd 1,315,321 1411F9
SdSlChr.usd 14,996 3A94
total: 1,354,826 14AC4A +3F0011 = 53AC5B
Custom Debug Menus thread:
https://smashboards.com/threads/custom-debug-submenu-engine-for-devs-only.398050/
Changing icon clickable area positions:
https://smashboards.com/threads/melee-hacks-and-you-new-hackers-start-here-in-the-op.247119/post-18250184
CSS Icon Notes
-CSS data exists in dol @ 803f0a48
-CSS Icon struct exists in dol @ 803f0b24
-Each entry is 0x1C long
-Indexed by CSS order ID
0x00 = Char Unk ID, used for getting combo count @ 8025c0c4
0x01 = Char Ext ID
0x02 = Status ID. Dictates whether icon can be chosen. 0x0 = Not Unlocked, 0x1 = Unlocked (temp value), 0x2 = Unlocked and Displayed
0x03 = isAnimated ID? is made to be 0xC when the character is chosen.
0x04 = Unk ID, looks to be the same as the Joint ID?
0x05 = Joint ID, used to get JObj pointer from -0x49E0 (r13) (see 80264820 to get the JObj)
0x08 = SFX ID to play on selection
0x0C = Left Onscreen Boundary Position
0x10 = Right Onscreen Boundary Position
0x14 = Top Onscreen Boundary Position
0x18 = Bottom Onscreen Boundary Position
normal MnSlChr
length:
header 0x0 - 0x20 0x20
unknown 0x20 -
textures 0x51c0 -
CSS structs 0x395440 -
rt table 0x397C44 - 0x3A2848 AC04
& root nodes
20XX MnSlChr
length:
header 0x0 - 0x20 0x20
unknown 0x20 -
textures 0x51c0 -
CSS structs 0x395440 -
rt table 0x397C2C - 0x3A2848 AC1C
& root nodes
tail data start
Debug Menu 0x3A2848 - 0x3A45F0 1DA8
CSP Trim 0x3A3C90 - 0x3A45E0 950
colors
CSP Color 0x3A45F0 - 0x3A4720 130
Pointers - External ID
| 0x10
Debug Menu 0x3A4730 - 0x3A4AA0 370
(for stages?)
| 0x10
Debug Menu 0x3A4AB0 - 0x3A538C 8DC
| 0x34
Line Item 0x3A53C0 - 0x3A53D4 20 FUNCTION; 0x14 long
Counter
| 0xC
VS Style Menu 0x3A53E0 - 0x3A5414 40 FUNCTION; 0x34 long
Loader
| 0x4A
PLAYER FLAG 0x3A545E - 0x3A5820 3C2
ACTIVE
| 0x60
Debug Menu 0x3A5880 - 0x3A5BD0? 350
(custom shield colors)
| 0x40
"REG SUB 0x3A5C10 - 0x3A5C50 40 FUNCTION; 0x30 long
Loader"
"RET MAIN 0x3A5C50 - 0x3A5C70 30 FUNCTION; 0x20 long
MENU"
| 0x10
character 0x3A5C80 - 0x3A5CEC 6C
names pointer table
| 0x24
character 0x3A5D10 - 0x3A5DC0 C0
names string table
| ?
Character 0x3A61D0 - 0x3A64F0 320 (assuming full menu)
Codes Menu
|
[Empty] 0x3A64F0
| 0x90
0x3A6580
[SDR stuff]
TRACK PREVIEW 0x3B9060 Function for song previews in Debug Menu
Executed on Left/Right or A press
| 0x90
0x3B90F0
0x3DB0
COMING SOON 0x3BCEA0 Old function no longer used;
CODE should be safe to remove.
| 0x4C
0x3BCEE0
PAL MODE 0x3BDB80 - 0x3BEA40?
TEX
| ?
Stage Texture 0x3C10C0 - 0x3C1F10 E50 pointer table followed
Name Definitions by strings for each stage
| ?
[empty] 0x3C25A0 - 0x3C2700
|
Character 0x3C2700 Reserving block of 0x200 bytes for these strings
Codes Menu
Strings | 0x200
Mechanics 0x3C2900 Reserving block of 0x160 bytes for these strings
Codes Strings
| 0x65A0
Port Door 0x3C9000 In 4.07: 1 texture (0x19000 in length. ended at 0x3E2000)
Texture(s) In 5.0: 2 textures (0x6400), 2 palettes,
| 0x13040 and 2 palette headers
Refer to "Unique Closed Ports" section for details
free space 0x3DC040
| 0x5F6C free space freed from switch from type _6 CSS CPD
Relocated 0x3E1FAC Original file structures, relocated here for CPD edits
structs
| 0x54
Default Flags 0x3E2010 - 0x3E2380 370 <- "20XX RESET DEFAUL" label right before this; set 1 of default
flags for resetting 20XX data (X+A at CSS to Reset 20XX)
|
Song Locations 0x3E276C
|
CPU 0x3E392C
Clone Flags
| 1D4
Every Frame 0x3E3B10 - 0x3E4E40 FUNCTION; 0x1330 long in RAM at 80FD0220
Code
(branched to by "All Players Can Control the Debug Menu")
| 1C0
Char Icons 0x3E5000 - 0x3EB200 6200 CSS Char Icon alt image data;
contains image data for 7 textures, each 0xE00 bytes
| 11C0
Song titles 0x3EC3C0 - 0x3EDDA0 19E0 strings for hex tracks 0x31 to 0xFF
table 2 (bottom-up order; "ends" with string for ID 0x00)
| 3 (range accounts for empty entries)
Song title 0x3EDDA8 - 0x3EE1A8 400 reserving space for 256 pointers
pointer table
| 28 (range accounts for empty entries)
Song titles 0x3EE1D0 - 0x3EE485 2B5 strings for hex tracks 0x01 to 0x30
table 1 (top-down order)
| 0x27
Action state 0x3EE4AC - 0x3EEAAC 600
name pointer table
| 0xC
Action state 0x3EEAB8 - ?
names
| 1559
EOF 0x3F0011
/-----------------------\
============= On Unique Closed Ports ==================================
\-----------------------/
These are old notes regarding the Closed Port Door (CPD) modifications on the CSS for 20XX HP v5.0. Typically, in vanilla Melee and prior 20XX versions, a single texture is shared across all port doors. It's fairly simple to instead use different textures for each, by adding space to the file (assuming you use the same texture properties). However, in 20XX (starting with v5.0), this is achieved through a much trickier way, due to limitations on file space, and data at the end of the file which needs to have its offsets preserved.
RT start: 397C2C
String table start: 3A2834
as type 3 as type 6 as type 9 as type 14
(original)
original closed door panel texture size: 0xc800 0x19000 0x6400 0x3200
+2x 0x220 palettes/headers
for same bit depth (double image data): 0xc800 0x6400
+2x 0x220
============= New File Struct Allocation ==================================
Data/Header 1 = Upper-Right side
Data/Header 2 = Lower-Left side
type: length: _
0x2F760 P1 Image Data 1 14 0x3200 \
0x32960 P1 Image Data 2 14 \______/ 0xC800 total space, contained
0x35B60 P2 Image Data 1 14 / \ in original texture location.
0x38D60 P2 Image Data 2 14 _/
- v Textures here onward in tail data
0x3C9000 P3 Image Data 1 9 0x6400
0x3CF400 P3 Image Data 2 9
0x3D5800 P4 Image Data 1 14 0x3200
0x3D8A00 P4 Image Data 2 14
0x3DBC00 P3 Palette Data 1 2 0x200
0x3DBE00 P3 Palette Header 1 0x20
0x3DBE20 P3 Palette Data 2 2
0x3DC020 P3 Palette Header 2
Total image/palette/pHeader space for P2: 0xCC40
Next usable space, following last header:
0x3DC040
0x5F6C free space between these
0x3E1FAC Relocated Structs 0x48 (The 0xC bytes following this are not used.)
Start of usable space after this is @ 0x
End of space available here:
0x3E2000 Flags for music code (?) start immediately after this
Space remaining: 0x3E1FAC - 0x3DC040 = 0x5F6C
============= File Structure Tree ==================================
Data Headers: Data Blocks:
Texture Object:
====o [ Upper-Right ]
P1 | 34A08C -> 34A054 -> 2F760 (original)
====o
[ Lower-Left ]
34A14C -> 34A114 -> 32960
====o [ Upper-Right ]
P2 | 349D8C -> 349D54 -> 35B60
====o
[ Lower-Left ]
349E4C -> 349E14 -> 38D60
====o [ Upper-Right ]
P3 | 349A8C --> 349A54 -> 3C9000 Image Data 1
====o \-> 3DBE00 -> 3DBE00 Palette Data 1
[ Lower-Left ]
349B4C --> 349B14 -> 3CF400 Image Data 2
\-> 3DC020 -> 3DC020 Palette Data 2
====o [ Upper-Right ]
P4 | 34978C -> 349754 -> 3D5800
====o
[ Lower-Left ]
34984C -> 349814 -> 3D8A00
============= Relocation Table Additions and Struct Relocations ==================================
New RT entries were required for pointers in the texture structs and the new palette data headers.
However, without more changes, I wasn't able to add to the end of the RT table (can't move 20XX data below it),
so I added to the RT's start. Thus, 6 structures at the end of the data section have been relocated, to make space above the RT.
Struct 0x397BFC (len 0xC) moved to 0x3E1FAC <- Each struct moved 0x4A3B0 forward
Struct 0x397C08 (len 0xC) moved to 0x3E1FB8
Struct 0x397C14 (len 0xC) moved to 0x3E1FC4
Struct 0x397C20 (len 0xC) moved to 0x3E1FD0
Struct 0x397C2C (len 0xC) moved to 0x3E1FDC
Struct 0x397C38 (len 0xC) moved to 0x3E1FE8
Pointers (in other structs, as well as in the RT) to these have been adjusted.
New pointers for the RT, in order of tex struct pointer offsets first,
then header pointer offsets, all in file offset order:
(Already modified for relativity to data section (-0x20))
pointer to:
00349DBC palette data header
00349E7C palette data header
003DBDE0 palette data
003DC000 palette data
003E1FD8 fake struct 1
003E1FDC fake struct 2
The fake struct pointers are pointers to structures that aren't really in the file.
They essentially imply a struct starts there, so that DTW can calculate the length
of the last structure before it. These are needed because those structs fall in the
tail section of the file (appearing after the string table; i.e. outside of the
normal data section, of where they should appear in the file).
File header changes:
-24 bytes from RT Start Offset (aka data section size):
From 0x397C24 (original) to 0x397C0C
+6 to RT Entry Count: From 2AFA (original; 11002) to 2B00 (11008)
============= TEV Struct Changes ==================================
The way that the game normally stores the Closed Port Doors includes using the alpha channel as a mask. Pixels for the top-right panel are opaque in the original image, while pixels for the bottom-left panel are transparent. When the texure is used in the game, a blending is used with the alpha channel; only the opaque pixels are shown for the top-right panel, while the blending is reversed for the bottom-left panel so that only transparent pixels are shown. (In both cases, the effect is actually proportional to the alpha channel, meaning that an alpha of 50% would result in that panel appearing partially transparent.)
This is normally fine for _3 or _6 type textures, as the bit depth for colors is the same, regardless of whether the pixel has transparency. However, for _5, _9 or _14 type textures, a color shift naturally occurs during encoding/decoding, which varies partially due to whether or not the color is stored with transparency (in _9, this is due to a different bit depth between pixels with and without an alpha channel, while in _14 this is due to a difference in interpolation of the encoded colors).
Therefore, in order to have same-colors appear the same on both sides of the port doors in-game (after encode/decode), the existance of an alpha channel must be the same for pixels on both panels of the door. To do this, instead of one image for each door, where the application method of the mask is reversed for both sides, I created two images per CPD (one for each panel), changing the mask application method to be the same for both sides. This is done by reversing mask transparency rules in the texture's TEV (Texture Environment) structures. (Specific offsets of these are available in the "On the CSS (MnSlChr)" section.)
/-----------------------\
============= On Special Game Modes ==================================
\-----------------------/
special modes:
4.07 5.0
ID:
camera
stamina
super sudden death chess
giant dual 1v1
tiny beam sword
0x11 invisible hot mr. S Super Shine Bros.
fixed-camera RHE
0x2C single-button dodgeball Turbo Mode
0x13 lightning NBA Jam
slo-mo melee Tag Team
#Scene Struct
.set SceneController,0x80479D30
.set Scene.CurrentMajor,0x0
.set Scene.PendingMajor,0x1
.set Scene.PreviousMajor,0x2
.set Scene.CurrentMinor,0x3
.set Scene.PendingMinor,0x4
.set Scene.PreviousMinor,0x5
Menu IDs (menu major)
------------------
00 - Title Screen (Press Start)
01 - Reloads menu from language change? (brings to language change selection and saves)
02 - VS mode character select
03 - Classic Mode
04 - Adventure Mode
05 - All-Star Mode
06 - Debug Menu
07 - Master Sound Test
08 - Looks like regular VS mode, but actually cycles through many different character select screens
09 - Black Screen...?
0A (10) - Camera Mode
0B (11) - Trophy Gallery
0C (12) - Trophy Lottery
0D (13) - Trophy Collection
0E (14) - Starts a match (with the debug menu configurations?)
0F (15) - Target Test
10 (16) - Super Sudden Death
11 (17) - Invisible Melee
12 (18) - Slo-Mo Melee
13 (19) - Lightning Melee
14 (20) - "A new foe has appeared!" (Ganon with sword, freezes if you try to progress, ID from debug?)
15 (21) - Classic Mode trophy acquisition & credits (C.Falcon, ID from debug?)
16 (22) - Adventure Mode trophy acquisition & credits (C.Falcon, ID from debug?)
17 (23) - All-Star Mode trophy acquisition & credits (C.Falcon, ID from debug?)
18 (24) - Intro video
19 (25) - Cycles through Adventure Mode cinematics
1A (26) - Character trophy acquisition (no credits) (uses All-Star trophy) (C.Falcon, ID from debug?)
1B (27) - Tournament Menu
1C (28) - Training Mode
1D (29) - Tiny Melee
1E (30) - Giant Melee
1F (31) - Stamina Mode
20 (32) - Home-Run Contest
21 (33) - 10-Man Melee
22 (34) - 100-Man Melee
23 (35) - 3-Minute Melee
24 (36) - 15-Minute Melee
25 (37) - Endless Melee
26 (38) - Cruel Melee
27 (39) - "Enable Progressive Scan Display?"
28 (40) - Plays Intro Video
29 (41) - Memory Card Overwrite Confirmation
2A (42) - Fixed-Camera Mode
2B (43) - Loads Event Match 1 (Match ID from the debug menu?)
2C (44) - Single-Button Mode
/---------------------------------------------------\
============= On modifying Special Game Modes Text (SdMenu.usd) ==================================
\---------------------------------------------------/
Original text
suggested replacement for 20XX
SdMenu offset
text hex
hex immediately following the text hex
Chess Melee to replace Super Sudden Death:
All players start with 300% damage.
Fight like every stock is the last.
4DD9
18200A202F202F1A2033202F2024203C2028203520361A203620372024203520371A203A202C2037202B1A20032000200021031A2027202420302024202A202820E7
19 0F 0D 00 16 10 0C AA AA AA 0E 00 B3 00 B3 06 00 00 00 00
Dual 1v1 to replace Giant Melee:
All players are giant-sized.
A 1v1 plus a 1v1, for a 1v1.
4E2F
18200A202F202F1A2033202F2024203C2028203520361A2024203520281A202A202C20242031203720FC2036202C203D2028202720E7
19 0F 0D 00 16 10 0C AA AA AA 0E 00 B3 00 B3 06
Beam Sword Battle to replace Tiny Melee:
All players are tiny.