Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 1/Scripts/LevelSelect/HexNo.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
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
temp1 = object.ixpos
87
temp1 <<= 16
88
DrawSpriteXY(temp0, temp1, object.ypos)
89
90
temp1 = object.ixpos
91
temp1 += 8
92
temp0 = object.number
93
temp0 &= 15
94
temp1 <<= 16
95
DrawSpriteXY(temp0, temp1, object.ypos)
96
end event
97
98
99
event RSDKLoad
100
LoadSpriteSheet("LevelSelect/Text.gif")
101
102
temp0 = 0
103
while temp0 < 80
104
SpriteFrame(0, 0, 8, 8, temp0, 24)
105
temp0 += 8
106
loop
107
108
temp0 = 8
109
while temp0 < 56
110
SpriteFrame(0, 0, 8, 8, temp0, 32)
111
temp0 += 8
112
loop
113
114
temp0 = 0
115
while temp0 < 80
116
SpriteFrame(0, 0, 8, 8, temp0, 152)
117
temp0 += 8
118
loop
119
120
temp0 = 8
121
while temp0 < 56
122
SpriteFrame(0, 0, 8, 8, temp0, 160)
123
temp0 += 8
124
loop
125
126
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
127
end event
128
129