Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 2/Scripts/LevelSelect/HexNo.txt
1479 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Hex No Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
private alias object.value0 : object.number
13
private alias object.value1 : object.highlighted // not true/false but 0/16 instead, check out below aliases
14
15
// (Not really used in this script, but MenuControl uses them so these are copied here for reference too)
16
private alias 0 : HEXNO_HIGHLIGHT_FALSE
17
private alias 16 : HEXNO_HIGHLIGHT_TRUE
18
19
20
// ========================
21
// Events
22
// ========================
23
24
event ObjectDraw
25
// First digit
26
temp0 = object.number
27
temp0 >>= 4
28
temp0 += object.highlighted
29
temp1 = object.xpos
30
DrawSpriteScreenXY(temp0, temp1, object.ypos)
31
32
// Second digit
33
temp1 += 8
34
temp0 = object.number
35
temp0 &= 15
36
temp0 += object.highlighted
37
DrawSpriteScreenXY(temp0, temp1, object.ypos)
38
end event
39
40
41
event ObjectStartup
42
LoadSpriteSheet("LevelSelect/Text.gif")
43
44
// Using loops to automate Sprite Framing
45
46
// 0-9 Numbers, Unhighlighted White
47
temp0 = 0
48
while temp0 < 80
49
SpriteFrame(0, 0, 8, 8, temp0, 24)
50
temp0 += 8
51
loop
52
53
// A-F Letters, Unhighlighted White
54
temp0 = 8
55
while temp0 < 56
56
SpriteFrame(0, 0, 8, 8, temp0, 32)
57
temp0 += 8
58
loop
59
60
// 0-9 Numbers, Highlighted Yellow
61
temp0 = 0
62
while temp0 < 80
63
SpriteFrame(0, 0, 8, 8, temp0, 152)
64
temp0 += 8
65
loop
66
67
// A-F Letters, Highlighted Yellow
68
temp0 = 8
69
while temp0 < 56
70
SpriteFrame(0, 0, 8, 8, temp0, 160)
71
temp0 += 8
72
loop
73
end event
74
75
76
// ========================
77
// Editor Events
78
// ========================
79
80
event RSDKDraw
81
object.number = 0x12
82
object.highlighted = HEXNO_HIGHLIGHT_FALSE
83
84
temp0 = object.number
85
temp0 >>= 4
86
DrawSpriteXY(temp0, object.xpos, object.ypos)
87
88
temp1 = object.xpos
89
temp1 += 0x80000
90
temp0 = object.number
91
temp0 &= 15
92
DrawSpriteXY(temp0, temp1, object.ypos)
93
end event
94
95
96
event RSDKLoad
97
LoadSpriteSheet("LevelSelect/Text.gif")
98
99
// Use loops to automate sprite framing
100
temp0 = 0
101
while temp0 < 80
102
SpriteFrame(0, 0, 8, 8, temp0, 24)
103
temp0 += 8
104
loop
105
106
temp0 = 8
107
while temp0 < 56
108
SpriteFrame(0, 0, 8, 8, temp0, 32)
109
temp0 += 8
110
loop
111
112
temp0 = 0
113
while temp0 < 80
114
SpriteFrame(0, 0, 8, 8, temp0, 152)
115
temp0 += 8
116
loop
117
118
temp0 = 8
119
while temp0 < 56
120
SpriteFrame(0, 0, 8, 8, temp0, 160)
121
temp0 += 8
122
loop
123
124
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
125
end event
126
127