Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Title/Logo.txt
1319 views
1
//-------------------Sonic CD Logo Script---------------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Fade
7
8
// States
9
#alias 0 : LOGO_WHITE_FADEIN
10
#alias 1 : LOGO_SONIC_ANIMATE
11
#alias 2 : LOGO_SONIC_RESET
12
13
// Callbacks & Engine States
14
#alias 7 : CALLBACK_EXIT_SELECTED
15
16
#alias 2 : TEXTINFO_ROWCOUNT // Menu Alias
17
18
19
sub ObjectDraw
20
TempValue0 = Screen.CenterX
21
TempValue0 <<= 1
22
DrawSpriteScreenXY(16, 0, 100)
23
DrawSpriteScreenXY(17, TempValue0, 100)
24
25
switch Object.State
26
case LOGO_WHITE_FADEIN
27
SetScreenFade(255, 255, 255, Object.Fade)
28
29
// Draw boths halves of the Emblem
30
Object.Direction = FACING_RIGHT
31
DrawSpriteScreenFX(0, FX_FLIP, Screen.CenterX, 40)
32
33
Object.Direction = FACING_LEFT
34
DrawSpriteScreenFX(0, FX_FLIP, Screen.CenterX, 40)
35
36
// Draw Sonic
37
DrawSpriteScreenXY(2, Screen.CenterX, 120)
38
39
// Draw the Ribbon
40
TempValue0 = Screen.CenterX
41
TempValue0 -= 110
42
DrawSpriteScreenXY(1, TempValue0, 135)
43
44
// And draw his initial Arm frame too
45
TempValue0 += 121
46
DrawSpriteScreenXY(4, TempValue0, 110)
47
48
if Object.Fade > 0
49
Object.Fade -= 8
50
else
51
Object.State = LOGO_SONIC_ANIMATE
52
Object.Frame = 4
53
end if
54
break
55
56
case LOGO_SONIC_ANIMATE
57
58
// Draw both ends of the Emblem
59
Object.Direction = FACING_RIGHT
60
DrawSpriteScreenFX(0, FX_FLIP, Screen.CenterX, 40)
61
Object.Direction = FACING_LEFT
62
DrawSpriteScreenFX(0, FX_FLIP, Screen.CenterX, 40)
63
64
// Draw the main Sonic sprite
65
DrawSpriteScreenXY(2, Screen.CenterX, 120)
66
67
// If needed, draw his blinking frame
68
if Object.Frame > 7
69
if Object.Frame < 13
70
TempValue0 = Screen.CenterX
71
TempValue0 -= 43
72
DrawSpriteScreenXY(3, TempValue0, 48)
73
end if
74
end if
75
76
// Draw the ribbon ontop of that
77
TempValue0 = Screen.CenterX
78
TempValue0 -= 110
79
DrawSpriteScreenXY(1, TempValue0, 135)
80
81
// And afterwards, draw his arm
82
TempValue0 += 121
83
DrawSpriteScreenXY(Object.Frame, TempValue0, 110)
84
85
Object.Fade++
86
if Object.Fade > 1
87
Object.Fade = 0
88
Object.Frame++
89
if Object.Frame > 15
90
Object.State = LOGO_SONIC_RESET
91
Object[+1].Type = TypeName[Touch Start]
92
Object[+1].iXPos = Screen.CenterX
93
Object[+1].iYPos = 200
94
end if
95
end if
96
break
97
98
case LOGO_SONIC_RESET
99
Object.Direction = FACING_RIGHT
100
DrawSpriteScreenFX(0, FX_FLIP, Screen.CenterX, 40)
101
Object.Direction = FACING_LEFT
102
DrawSpriteScreenFX(0, FX_FLIP, Screen.CenterX, 40)
103
104
DrawSpriteScreenXY(2, Screen.CenterX, 120)
105
106
TempValue0 = Screen.CenterX
107
TempValue0 -= 110
108
DrawSpriteScreenXY(1, TempValue0, 135)
109
TempValue0 += 121
110
DrawSpriteScreenXY(4, TempValue0, 110)
111
break
112
113
end switch
114
115
// sure i guess?
116
if Engine.PlatformID == RETRO_WP7
117
if KeyPress[0].ButtonB == true
118
EngineCallback(CALLBACK_EXIT_SELECTED)
119
end if
120
end if
121
122
end sub
123
124
125
sub ObjectStartup
126
127
LoadSpriteSheet("Title/Title.gif")
128
129
// 0 - Logo Ring
130
SpriteFrame(-130, 0, 130, 152, 381, 73)
131
132
// 1 - Logo Ribbon
133
SpriteFrame(0, 0, 220, 80, 1, 122)
134
135
// 2 - The man himself, Sonic!
136
SpriteFrame(-47, -96, 104, 120, 1, 1)
137
138
// 3 - Sonic's Eyes
139
SpriteFrame(0, 0, 56, 48, 106, 33)
140
141
// 4-15 - Sonic Arm Frames
142
SpriteFrame(0, -38, 45, 55, 210, 203)
143
SpriteFrame(0, -44, 32, 61, 223, 125)
144
SpriteFrame(-1, -44, 25, 61, 230, 63)
145
SpriteFrame(-10, -44, 30, 61, 225, 1)
146
SpriteFrame(-1, -44, 25, 61, 230, 63)
147
SpriteFrame(0, -44, 32, 61, 223, 125)
148
SpriteFrame(0, -38, 45, 55, 210, 203)
149
SpriteFrame(0, -44, 32, 61, 223, 125)
150
SpriteFrame(-1, -44, 25, 61, 230, 63)
151
SpriteFrame(-10, -44, 30, 61, 225, 1)
152
SpriteFrame(-1, -44, 25, 61, 230, 63)
153
SpriteFrame(0, -44, 32, 61, 223, 125)
154
155
// 16 - Left Mountain Frame
156
SpriteFrame(0, 0, 176, 68, 256, 4)
157
158
// 17 - Right Mountain
159
160
// This SpriteFrame differs across each version of the game
161
// The Blit version had an issue where it didn't cover empty space when in widescreen, revealing a grey rectangle
162
// The Mobile and Origins releases use a new sprite that's wider, with it getting even wider in a later mobile version
163
164
#platform: Use_Decomp
165
// For the decomp, use the original Blit sprite regardless of version
166
// The grey square is fixed via added code in the Background object's ObjectDraw sub
167
SpriteFrame(-124, 0, 124, 68, 256, 77)
168
#endplatform
169
170
#platform: Use_Standalone
171
// SpriteFrame(-124, 0, 124, 68, 256, 77) // Blit version
172
// SpriteFrame(-144, 0, 144, 68, 257, 251) // Older Mobile version
173
SpriteFrame(-174, 0, 174, 68, 246, 267) // Current Mobile version
174
#endplatform
175
176
#platform: Use_Origins
177
SpriteFrame(-144, 0, 144, 68, 257, 251) // Origins version
178
#endplatform
179
end sub
180
181
182
// ========================
183
// Editor Subs
184
// ========================
185
186
sub RSDKDraw
187
Object.Direction = FACING_RIGHT
188
DrawSpriteFX(0, FX_FLIP, Object.XPos, Object.YPos)
189
Object.Direction = FACING_LEFT
190
DrawSpriteFX(0, FX_FLIP, Object.XPos, Object.YPos)
191
end sub
192
193
194
sub RSDKLoad
195
LoadSpriteSheet("Title/Title.gif")
196
SpriteFrame(-130, 0, 130, 152, 381, 73)
197
198
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
199
end sub
200
201