Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/DAGarden/MusicSelector.txt
1319 views
1
//--------------Sonic CD Music Selector Script----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// States
6
#alias 0 : MUSICSELECTOR_BLANK
7
#alias 1 : MUSICSELECTOR_STOP_MOVE_L
8
#alias 2 : MUSICSELECTOR_MOVE_L
9
#alias 3 : MUSICSELECTOR_STOP_MOVE_R
10
#alias 4 : MUSICSELECTOR_MOVE_R
11
12
13
sub ObjectMain
14
switch Object.State
15
case MUSICSELECTOR_BLANK
16
break
17
18
case MUSICSELECTOR_STOP_MOVE_L
19
Object.XPos -= 0xC0000
20
TempValue0 = Screen.CenterX
21
TempValue0 <<= 16
22
if Object.XPos <= TempValue0
23
Object.XPos = TempValue0
24
Object.State = MUSICSELECTOR_BLANK
25
end if
26
break
27
28
case MUSICSELECTOR_MOVE_L
29
Object.XPos -= 0xC0000
30
if Object.XPos < -0x600000
31
TempValue0 = Screen.XSize
32
TempValue0 += 192
33
TempValue0 <<= 16
34
Object.XPos += TempValue0
35
Object.State = MUSICSELECTOR_STOP_MOVE_L
36
if Object.Frame < 30
37
Object.Frame++
38
else
39
Object.Frame = 0
40
end if
41
end if
42
break
43
44
case MUSICSELECTOR_STOP_MOVE_R
45
Object.XPos += 0xC0000
46
TempValue0 = Screen.CenterX
47
TempValue0 <<= 16
48
if Object.XPos >= TempValue0
49
Object.XPos = TempValue0
50
Object.State = MUSICSELECTOR_BLANK
51
end if
52
break
53
54
case MUSICSELECTOR_MOVE_R
55
Object.XPos += 0xC0000
56
TempValue0 = Screen.XSize
57
TempValue0 += 96
58
TempValue0 <<= 16
59
if Object.XPos > TempValue0
60
Object.XPos -= TempValue0
61
Object.XPos -= 0x600000
62
Object.State = MUSICSELECTOR_STOP_MOVE_R
63
if Object.Frame > 0
64
Object.Frame--
65
else
66
Object.Frame = 30
67
end if
68
end if
69
break
70
71
end switch
72
end sub
73
74
75
sub ObjectDraw
76
DrawSprite(Object.Frame)
77
end sub
78
79
80
sub ObjectStartup
81
LoadSpriteSheet("DAGarden/Objects.gif")
82
83
SpriteFrame(-49, -4, 98, 8, 1, 577) // #0 - PPZ
84
SpriteFrame(-68, -4, 136, 8, 1, 586) // #1 - PPZ "G" Mix
85
SpriteFrame(-68, -4, 136, 8, 1, 595) // #2 - PPZ "B" Mix
86
SpriteFrame(-54, -4, 108, 8, 1, 604) // #3 - CCZ
87
SpriteFrame(-72, -4, 144, 8, 1, 613) // #4 - CCZ "G" Mix
88
SpriteFrame(-72, -4, 144, 8, 1, 622) // #5 - CCZ "B" Mix
89
SpriteFrame(-46, -4, 92, 8, 1, 631) // #6 - TTZ
90
SpriteFrame(-65, -4, 130, 8, 1, 640) // #7 - TTZ "G" Mix
91
SpriteFrame(-65, -4, 130, 8, 1, 649) // #8 - TTZ "B" Mix
92
SpriteFrame(-54, -4, 108, 8, 1, 658) // #9 - QQZ
93
SpriteFrame(-72, -4, 144, 8, 1, 667) // #10 - QQZ "G" Mix
94
SpriteFrame(-72, -4, 144, 8, 1, 676) // #11 - QQZ "B" Mix
95
SpriteFrame(-55, -4, 110, 8, 1, 685) // #12 - WWZ
96
SpriteFrame(-73, -4, 146, 8, 1, 694) // #13 - WWZ "G" Mix
97
SpriteFrame(-73, -4, 146, 8, 1, 703) // #14 - WWZ "B" Mix
98
SpriteFrame(-61, -4, 122, 8, 1, 712) // #15 - SSZ
99
SpriteFrame(-79, -4, 158, 8, 1, 721) // #16 - SSZ "G" Mix
100
SpriteFrame(-79, -4, 158, 8, 1, 730) // #17 - SSZ "B" Mix
101
SpriteFrame(-59, -4, 118, 8, 1, 739) // #18 - MMZ
102
SpriteFrame(-77, -4, 154, 8, 1, 748) // #19 - MMZ "G" Mix
103
SpriteFrame(-77, -4, 154, 8, 1, 757) // #20 - MMZ "B" Mix
104
SpriteFrame(-38, -4, 76, 8, 1, 766) // #21 - Final Fever
105
SpriteFrame(-46, -4, 92, 8, 1, 775) // #22 - Little Planet
106
SpriteFrame(-33, -4, 66, 8, 1, 784) // #23 - Game Over
107
SpriteFrame(-36, -4, 72, 8, 1, 793) // #24 - Zone Clear
108
SpriteFrame(-18, -4, 36, 8, 1, 802) // #25 - Boss!!
109
SpriteFrame(-37, -4, 74, 8, 1, 811) // #26 - Invincible!!
110
SpriteFrame(-30, -4, 60, 8, 1, 820) // #27 - Speed Up!!
111
SpriteFrame(-18, -4, 36, 8, 1, 829) // #28 - Title
112
SpriteFrame(-45, -4, 90, 8, 1, 838) // #29 - Special Stage
113
SpriteFrame(-40, -4, 81, 8, 1, 847) // #30 - Time Attack
114
end sub
115
116
117
// ========================
118
// Editor Subs
119
// ========================
120
121
sub RSDKDraw
122
DrawSprite(0)
123
end sub
124
125
126
sub RSDKLoad
127
LoadSpriteSheet("DAGarden/Objects.gif")
128
SpriteFrame(-49, -4, 98, 8, 1, 577) // PPZ text
129
130
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
131
end sub
132
133