moonscratch 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-DQk6qfdC.mjs +18 -0
- package/dist/index.d.mts +1173 -0
- package/dist/index.mjs +27135 -0
- package/package.json +6 -1
- package/.agents/skills/moonbit-agent-guide/LICENSE +0 -202
- package/.agents/skills/moonbit-agent-guide/SKILL.mbt.md +0 -1126
- package/.agents/skills/moonbit-agent-guide/SKILL.md +0 -1126
- package/.agents/skills/moonbit-agent-guide/ide.md +0 -116
- package/.agents/skills/moonbit-agent-guide/references/advanced-moonbit-build.md +0 -106
- package/.agents/skills/moonbit-agent-guide/references/moonbit-language-fundamentals.mbt.md +0 -422
- package/.agents/skills/moonbit-agent-guide/references/moonbit-language-fundamentals.md +0 -422
- package/.agents/skills/moonbit-practice/SKILL.md +0 -258
- package/.agents/skills/moonbit-practice/assets/ci.yaml +0 -25
- package/.agents/skills/moonbit-practice/reference/agents.md +0 -1469
- package/.agents/skills/moonbit-practice/reference/configuration.md +0 -228
- package/.agents/skills/moonbit-practice/reference/ffi.md +0 -229
- package/.agents/skills/moonbit-practice/reference/ide.md +0 -189
- package/.agents/skills/moonbit-practice/reference/performance.md +0 -217
- package/.agents/skills/moonbit-practice/reference/refactor.md +0 -154
- package/.agents/skills/moonbit-practice/reference/stdlib.md +0 -351
- package/.agents/skills/moonbit-practice/reference/testing.md +0 -228
- package/.agents/skills/moonbit-refactoring/LICENSE +0 -21
- package/.agents/skills/moonbit-refactoring/SKILL.md +0 -323
- package/.githooks/README.md +0 -23
- package/.githooks/pre-commit +0 -3
- package/.github/workflows/copilot-setup-steps.yml +0 -40
- package/AGENTS.md +0 -91
- package/PLAN.md +0 -64
- package/TODO.md +0 -120
- package/benchmarks/calc.bench.ts +0 -144
- package/benchmarks/draw.bench.ts +0 -215
- package/benchmarks/load.bench.ts +0 -28
- package/benchmarks/render.bench.ts +0 -53
- package/benchmarks/run.bench.ts +0 -8
- package/benchmarks/types.d.ts +0 -15
- package/docs/scratch-vm-specs/eventloop.md +0 -103
- package/docs/scratch-vm-specs/moonscratch-time-separation.md +0 -50
- package/index.html +0 -91
- package/js/AGENTS.md +0 -5
- package/js/a.ts +0 -52
- package/js/assets/AGENTS.md +0 -5
- package/js/assets/base64.test.ts +0 -14
- package/js/assets/base64.ts +0 -21
- package/js/assets/build-asset.test.ts +0 -26
- package/js/assets/build-asset.ts +0 -28
- package/js/assets/create.test.ts +0 -142
- package/js/assets/create.ts +0 -122
- package/js/assets/index.test.ts +0 -15
- package/js/assets/index.ts +0 -2
- package/js/assets/types.ts +0 -26
- package/js/assets/validation.test.ts +0 -34
- package/js/assets/validation.ts +0 -25
- package/js/assets.test.ts +0 -14
- package/js/assets.ts +0 -1
- package/js/index.test.ts +0 -26
- package/js/index.ts +0 -3
- package/js/render/index.test.ts +0 -65
- package/js/render/index.ts +0 -13
- package/js/render/sharp.ts +0 -87
- package/js/render/svg.ts +0 -68
- package/js/render/types.ts +0 -35
- package/js/render/utils.ts +0 -108
- package/js/render/webgl.ts +0 -274
- package/js/sharp-optional.d.ts +0 -16
- package/js/test/helpers.ts +0 -116
- package/js/test/hikkaku-sample.test.ts +0 -37
- package/js/test/rubik-components.input-motion.test.ts +0 -60
- package/js/test/rubik-components.lists.test.ts +0 -49
- package/js/test/rubik-components.operators.test.ts +0 -104
- package/js/test/rubik-components.pen.test.ts +0 -112
- package/js/test/rubik-components.procedures-loops.test.ts +0 -72
- package/js/test/rubik-components.variables-branches.test.ts +0 -57
- package/js/test/rubik-components.visibility-entry.test.ts +0 -31
- package/js/test/test-projects.ts +0 -598
- package/js/test/variable.ts +0 -200
- package/js/test/warp.test.ts +0 -59
- package/js/vm/AGENTS.md +0 -6
- package/js/vm/README.md +0 -183
- package/js/vm/bindings.test.ts +0 -13
- package/js/vm/bindings.ts +0 -5
- package/js/vm/compare-operators.test.ts +0 -145
- package/js/vm/constants.test.ts +0 -11
- package/js/vm/constants.ts +0 -4
- package/js/vm/effect-guards.test.ts +0 -68
- package/js/vm/effect-guards.ts +0 -44
- package/js/vm/factory.test.ts +0 -486
- package/js/vm/factory.ts +0 -615
- package/js/vm/headless-vm.test.ts +0 -131
- package/js/vm/headless-vm.ts +0 -342
- package/js/vm/index.test.ts +0 -28
- package/js/vm/index.ts +0 -5
- package/js/vm/internal-types.ts +0 -32
- package/js/vm/json.test.ts +0 -40
- package/js/vm/json.ts +0 -273
- package/js/vm/normalize.test.ts +0 -48
- package/js/vm/normalize.ts +0 -65
- package/js/vm/options.test.ts +0 -30
- package/js/vm/options.ts +0 -55
- package/js/vm/pen-transparency.test.ts +0 -115
- package/js/vm/program-wasm.ts +0 -322
- package/js/vm/scheduler-render.test.ts +0 -401
- package/js/vm/scratch-assets.test.ts +0 -136
- package/js/vm/scratch-assets.ts +0 -202
- package/js/vm/types.ts +0 -358
- package/js/vm/value-guards.test.ts +0 -25
- package/js/vm/value-guards.ts +0 -18
- package/moon.mod.json +0 -10
- package/scripts/preinstall.ts +0 -4
- package/src/AGENTS.md +0 -6
- package/src/api.mbt +0 -161
- package/src/api_aot_commands.mbt +0 -184
- package/src/api_effects_json.mbt +0 -72
- package/src/api_options.mbt +0 -60
- package/src/api_program_wasm.mbt +0 -1647
- package/src/api_program_wat.mbt +0 -2206
- package/src/api_snapshot_json.mbt +0 -44
- package/src/cmd/AGENTS.md +0 -5
- package/src/cmd/main/AGENTS.md +0 -5
- package/src/cmd/main/main.mbt +0 -29
- package/src/cmd/main/moon.pkg +0 -7
- package/src/cmd/main/pkg.generated.mbti +0 -13
- package/src/json_helpers.mbt +0 -176
- package/src/moon.pkg +0 -65
- package/src/moonscratch.mbt +0 -3
- package/src/moonscratch_wbtest.mbt +0 -40
- package/src/parser_sb3.mbt +0 -890
- package/src/pkg.generated.mbti +0 -479
- package/src/runtime_eval.mbt +0 -2844
- package/src/runtime_exec.mbt +0 -3850
- package/src/runtime_render.mbt +0 -2550
- package/src/runtime_state.mbt +0 -870
- package/src/test/AGENTS.md +0 -3
- package/src/test/projects/AGENTS.md +0 -6
- package/src/test/projects/moon.pkg +0 -4
- package/src/test/projects/moonscratch_compat_test.mbt +0 -642
- package/src/test/projects/moonscratch_core_test.mbt +0 -1332
- package/src/test/projects/moonscratch_runtime_test.mbt +0 -1087
- package/src/test/projects/pkg.generated.mbti +0 -13
- package/src/test/projects/test_support.mbt +0 -35
- package/src/types_effects.mbt +0 -20
- package/src/types_error.mbt +0 -4
- package/src/types_options.mbt +0 -31
- package/src/types_runtime_structs.mbt +0 -254
- package/src/types_vm.mbt +0 -109
- package/tsconfig.json +0 -29
- package/viewer/index.ts +0 -399
- package/viewer/vite.d.ts +0 -1
- package/viewer/worker.ts +0 -161
- package/vite.config.ts +0 -61
package/src/pkg.generated.mbti
DELETED
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
// Generated using `moon info`, DON'T EDIT IT
|
|
2
|
-
package "nakasyou/moonscratch"
|
|
3
|
-
|
|
4
|
-
// Values
|
|
5
|
-
pub fn default_vm_options() -> VmOptions
|
|
6
|
-
|
|
7
|
-
pub fn vm_abi_version() -> Int
|
|
8
|
-
|
|
9
|
-
pub fn vm_broadcast(Vm, String) -> Unit
|
|
10
|
-
|
|
11
|
-
pub fn vm_compile_from_json(String, assets_json? : String) -> PrecompiledProject raise VmError
|
|
12
|
-
|
|
13
|
-
pub fn vm_compile_project_to_wasm(String, assets_json? : String) -> String raise VmError
|
|
14
|
-
|
|
15
|
-
pub fn vm_compile_project_to_wat(String, assets_json? : String) -> String raise VmError
|
|
16
|
-
|
|
17
|
-
pub fn vm_exec_draw_opcode(Vm, Int, String, Double, Double, Int) -> Int
|
|
18
|
-
|
|
19
|
-
pub fn vm_exec_opcode_once_by_pc(Vm, Int, Int) -> Int
|
|
20
|
-
|
|
21
|
-
pub fn vm_exec_script_tail_by_pc(Vm, Int, Int) -> Int
|
|
22
|
-
|
|
23
|
-
pub fn vm_get_variable_number_by_id(Vm, Int, String) -> Double
|
|
24
|
-
|
|
25
|
-
pub fn vm_green_flag(Vm) -> Unit
|
|
26
|
-
|
|
27
|
-
pub fn vm_new_from_compiled(PrecompiledProject, options_json? : String) -> Vm raise VmError
|
|
28
|
-
|
|
29
|
-
pub fn vm_post_io_json(Vm, String, String) -> Unit
|
|
30
|
-
|
|
31
|
-
pub fn vm_render_frame(Vm) -> RenderFrame
|
|
32
|
-
|
|
33
|
-
pub fn vm_set_aot_commands_json(Vm, String) -> Unit raise VmError
|
|
34
|
-
|
|
35
|
-
pub fn vm_set_time(Vm, Int) -> Unit
|
|
36
|
-
|
|
37
|
-
pub fn vm_set_variable_json_by_id(Vm, Int, String, String) -> Unit
|
|
38
|
-
|
|
39
|
-
pub fn vm_set_variable_number_by_id(Vm, Int, String, Double) -> Unit
|
|
40
|
-
|
|
41
|
-
pub fn vm_snapshot_json(Vm) -> String
|
|
42
|
-
|
|
43
|
-
pub fn vm_start(Vm) -> Unit
|
|
44
|
-
|
|
45
|
-
pub fn vm_step_frame(Vm) -> FrameReport
|
|
46
|
-
|
|
47
|
-
pub fn vm_stop_all(Vm) -> Unit
|
|
48
|
-
|
|
49
|
-
pub fn vm_take_effects_json(Vm) -> String
|
|
50
|
-
|
|
51
|
-
// Errors
|
|
52
|
-
pub suberror VmError {
|
|
53
|
-
InvalidProject(String)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Types and methods
|
|
57
|
-
pub(all) enum AotCommand {
|
|
58
|
-
SetVariable(Int, String, Json)
|
|
59
|
-
ChangeVariable(Int, String, Double)
|
|
60
|
-
HostOpcode(Int, Int)
|
|
61
|
-
HostTail(Int, Int)
|
|
62
|
-
}
|
|
63
|
-
pub impl Eq for AotCommand
|
|
64
|
-
pub impl Show for AotCommand
|
|
65
|
-
pub impl ToJson for AotCommand
|
|
66
|
-
|
|
67
|
-
pub(all) struct BackdropHatStart {
|
|
68
|
-
backdrop_name : String
|
|
69
|
-
start_block : String
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
pub(all) struct BlockFastMeta {
|
|
73
|
-
next_pc : Int?
|
|
74
|
-
substack_pc : Int?
|
|
75
|
-
substack2_pc : Int?
|
|
76
|
-
variable : BlockFieldRef?
|
|
77
|
-
list : BlockFieldRef?
|
|
78
|
-
}
|
|
79
|
-
pub impl Eq for BlockFastMeta
|
|
80
|
-
pub impl Show for BlockFastMeta
|
|
81
|
-
pub impl ToJson for BlockFastMeta
|
|
82
|
-
|
|
83
|
-
pub(all) struct BlockFieldRef {
|
|
84
|
-
name : String
|
|
85
|
-
id : String?
|
|
86
|
-
}
|
|
87
|
-
pub impl Eq for BlockFieldRef
|
|
88
|
-
pub impl Show for BlockFieldRef
|
|
89
|
-
pub impl ToJson for BlockFieldRef
|
|
90
|
-
|
|
91
|
-
pub(all) enum BoolReporterOp {
|
|
92
|
-
CompareLt(Int, Int, Bool, CompareNumericGuard?, CompareNumericGuard?)
|
|
93
|
-
CompareGt(Int, Int, Bool, CompareNumericGuard?, CompareNumericGuard?)
|
|
94
|
-
CompareEq(Int, Int, Bool, CompareNumericGuard?, CompareNumericGuard?)
|
|
95
|
-
And
|
|
96
|
-
Or
|
|
97
|
-
Not
|
|
98
|
-
}
|
|
99
|
-
pub impl Eq for BoolReporterOp
|
|
100
|
-
pub impl Show for BoolReporterOp
|
|
101
|
-
|
|
102
|
-
pub(all) struct BoolReporterProgram {
|
|
103
|
-
numeric_programs : Array[NumericReporterProgram]
|
|
104
|
-
ops : Array[BoolReporterOp]
|
|
105
|
-
}
|
|
106
|
-
pub impl Eq for BoolReporterProgram
|
|
107
|
-
pub impl Show for BoolReporterProgram
|
|
108
|
-
|
|
109
|
-
pub(all) struct BroadcastHatStart {
|
|
110
|
-
message : String
|
|
111
|
-
start_block : String
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
pub(all) struct CompareNumericGuard {
|
|
115
|
-
owner_kind : Int
|
|
116
|
-
variable_id : String
|
|
117
|
-
slot : Int?
|
|
118
|
-
}
|
|
119
|
-
pub impl Eq for CompareNumericGuard
|
|
120
|
-
pub impl Show for CompareNumericGuard
|
|
121
|
-
|
|
122
|
-
pub(all) struct ControlFrame {
|
|
123
|
-
kind : ControlFrameKind
|
|
124
|
-
mut remaining : Int
|
|
125
|
-
substack : Int?
|
|
126
|
-
after : Int?
|
|
127
|
-
}
|
|
128
|
-
pub impl Eq for ControlFrame
|
|
129
|
-
pub impl Show for ControlFrame
|
|
130
|
-
pub impl ToJson for ControlFrame
|
|
131
|
-
|
|
132
|
-
pub enum ControlFrameKind {
|
|
133
|
-
Repeat
|
|
134
|
-
Forever
|
|
135
|
-
}
|
|
136
|
-
pub impl Eq for ControlFrameKind
|
|
137
|
-
pub impl Show for ControlFrameKind
|
|
138
|
-
pub impl ToJson for ControlFrameKind
|
|
139
|
-
|
|
140
|
-
pub(all) struct CostumeImage {
|
|
141
|
-
name : String
|
|
142
|
-
asset_id : String
|
|
143
|
-
bitmap_resolution : Int
|
|
144
|
-
rotation_center_x : Double
|
|
145
|
-
rotation_center_y : Double
|
|
146
|
-
width : Int
|
|
147
|
-
height : Int
|
|
148
|
-
pixels : Array[Byte]
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
pub(all) struct FrameReport {
|
|
152
|
-
active_threads : Int
|
|
153
|
-
tick_count : Int
|
|
154
|
-
op_count : Int
|
|
155
|
-
emitted_effects : Int
|
|
156
|
-
stop_reason : String
|
|
157
|
-
should_render : Bool
|
|
158
|
-
is_in_warp : Bool
|
|
159
|
-
}
|
|
160
|
-
pub impl Eq for FrameReport
|
|
161
|
-
pub impl Show for FrameReport
|
|
162
|
-
pub impl ToJson for FrameReport
|
|
163
|
-
|
|
164
|
-
pub enum HostEffect {
|
|
165
|
-
PlaySound(String, String)
|
|
166
|
-
PlayNote(String, Int, Double, Int, Double)
|
|
167
|
-
PlayDrum(String, Int, Double, Double)
|
|
168
|
-
TextToSpeech(String, String, String, String, String)
|
|
169
|
-
TranslateRequest(String, String)
|
|
170
|
-
StopAllSounds
|
|
171
|
-
Say(String, String)
|
|
172
|
-
Think(String, String)
|
|
173
|
-
Ask(String)
|
|
174
|
-
Broadcast(String)
|
|
175
|
-
Log(String, String)
|
|
176
|
-
}
|
|
177
|
-
pub impl Eq for HostEffect
|
|
178
|
-
pub impl Show for HostEffect
|
|
179
|
-
pub impl ToJson for HostEffect
|
|
180
|
-
|
|
181
|
-
pub(all) struct KeyPressedHatStart {
|
|
182
|
-
key_option : String
|
|
183
|
-
start_block : String
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
pub(all) enum NumericReporterOp {
|
|
187
|
-
PushConst(Double)
|
|
188
|
-
LoadVariable(String, String)
|
|
189
|
-
LoadVariableByRef(Int, String, Int?)
|
|
190
|
-
Add
|
|
191
|
-
Subtract
|
|
192
|
-
Multiply
|
|
193
|
-
Divide
|
|
194
|
-
Mod
|
|
195
|
-
Round
|
|
196
|
-
MathOp(String)
|
|
197
|
-
LoadXPosition
|
|
198
|
-
LoadYPosition
|
|
199
|
-
LoadDirection
|
|
200
|
-
LoadSize
|
|
201
|
-
LoadVolume
|
|
202
|
-
LoadTempo
|
|
203
|
-
LoadTimer
|
|
204
|
-
LoadMouseX
|
|
205
|
-
LoadMouseY
|
|
206
|
-
LoadControlCounter
|
|
207
|
-
}
|
|
208
|
-
pub impl Eq for NumericReporterOp
|
|
209
|
-
pub impl Show for NumericReporterOp
|
|
210
|
-
|
|
211
|
-
pub(all) struct NumericReporterProgram {
|
|
212
|
-
ops : Array[NumericReporterOp]
|
|
213
|
-
}
|
|
214
|
-
pub impl Eq for NumericReporterProgram
|
|
215
|
-
pub impl Show for NumericReporterProgram
|
|
216
|
-
|
|
217
|
-
pub(all) enum OpcodeTag {
|
|
218
|
-
Unknown
|
|
219
|
-
MotionChangeXBy
|
|
220
|
-
MotionChangeYBy
|
|
221
|
-
MotionSetY
|
|
222
|
-
PenPenDown
|
|
223
|
-
PenPenUp
|
|
224
|
-
ControlRepeat
|
|
225
|
-
ControlRepeatUntil
|
|
226
|
-
ControlIf
|
|
227
|
-
DataSetVariableTo
|
|
228
|
-
DataChangeVariableBy
|
|
229
|
-
}
|
|
230
|
-
pub impl Eq for OpcodeTag
|
|
231
|
-
pub impl Show for OpcodeTag
|
|
232
|
-
pub impl ToJson for OpcodeTag
|
|
233
|
-
|
|
234
|
-
pub(all) struct PenVectorStroke {
|
|
235
|
-
x0 : Double
|
|
236
|
-
y0 : Double
|
|
237
|
-
x1 : Double
|
|
238
|
-
y1 : Double
|
|
239
|
-
diameter : Double
|
|
240
|
-
offset : Double
|
|
241
|
-
r : Int
|
|
242
|
-
g : Int
|
|
243
|
-
b : Int
|
|
244
|
-
a : Int
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
pub(all) struct PrecompiledProject {
|
|
248
|
-
targets : Array[TargetState]
|
|
249
|
-
stage_index : Int
|
|
250
|
-
assets : Map[String, Json]
|
|
251
|
-
mut initial_opaque_backdrops : Map[String, Array[Byte]]
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
pub(all) enum PredicateHatKind {
|
|
255
|
-
WhenGreaterThan
|
|
256
|
-
WhenTouchingObject
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
pub(all) struct PredicateHatStart {
|
|
260
|
-
kind : PredicateHatKind
|
|
261
|
-
hat_id : String
|
|
262
|
-
menu : String
|
|
263
|
-
start_block : String
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
pub(all) struct ProcedureFrame {
|
|
267
|
-
return_pc : Int?
|
|
268
|
-
control_depth : Int
|
|
269
|
-
params : Map[String, Json]
|
|
270
|
-
proccode : String
|
|
271
|
-
mut warp_mode : Bool
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
pub(all) struct ProcedureSpec {
|
|
275
|
-
start_block : String
|
|
276
|
-
param_names : Array[String]
|
|
277
|
-
param_ids : Array[String]
|
|
278
|
-
param_defaults : Array[Json]
|
|
279
|
-
warp_mode : Bool
|
|
280
|
-
}
|
|
281
|
-
pub impl Eq for ProcedureSpec
|
|
282
|
-
pub impl Show for ProcedureSpec
|
|
283
|
-
|
|
284
|
-
pub(all) struct ProjectBundle {
|
|
285
|
-
project_json : String
|
|
286
|
-
assets : Map[String, Json]
|
|
287
|
-
}
|
|
288
|
-
pub impl Eq for ProjectBundle
|
|
289
|
-
pub impl Show for ProjectBundle
|
|
290
|
-
pub impl ToJson for ProjectBundle
|
|
291
|
-
|
|
292
|
-
pub(all) struct RenderFrame {
|
|
293
|
-
width : Int
|
|
294
|
-
height : Int
|
|
295
|
-
pixels : Array[Byte]
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
pub(all) struct ScratchBlock {
|
|
299
|
-
id : String
|
|
300
|
-
opcode : String
|
|
301
|
-
opcode_tag : OpcodeTag
|
|
302
|
-
next : String?
|
|
303
|
-
parent : String?
|
|
304
|
-
inputs : Map[String, Json]
|
|
305
|
-
const_number_inputs : Map[String, Double]
|
|
306
|
-
input_block_ids : Map[String, String]
|
|
307
|
-
fields : Map[String, Json]
|
|
308
|
-
mutation : Map[String, Json]
|
|
309
|
-
top_level : Bool
|
|
310
|
-
}
|
|
311
|
-
pub impl Eq for ScratchBlock
|
|
312
|
-
pub impl Show for ScratchBlock
|
|
313
|
-
pub impl ToJson for ScratchBlock
|
|
314
|
-
|
|
315
|
-
pub(all) struct TargetState {
|
|
316
|
-
id : String
|
|
317
|
-
name : String
|
|
318
|
-
is_stage : Bool
|
|
319
|
-
is_original : Bool
|
|
320
|
-
mut deleted : Bool
|
|
321
|
-
mut x : Double
|
|
322
|
-
mut y : Double
|
|
323
|
-
mut direction : Double
|
|
324
|
-
mut size : Double
|
|
325
|
-
mut volume : Double
|
|
326
|
-
mut music_instrument : Int
|
|
327
|
-
mut tts_voice : String
|
|
328
|
-
mut visible : Bool
|
|
329
|
-
mut current_costume : Int
|
|
330
|
-
costume_names : Array[String]
|
|
331
|
-
costumes : Array[CostumeImage]
|
|
332
|
-
mut pen_down : Bool
|
|
333
|
-
mut pen_color : Double
|
|
334
|
-
mut pen_saturation : Double
|
|
335
|
-
mut pen_brightness : Double
|
|
336
|
-
mut pen_transparency : Double
|
|
337
|
-
mut pen_size : Double
|
|
338
|
-
mut pen_legacy_shade : Double
|
|
339
|
-
mut looks_effect_color : Double
|
|
340
|
-
mut looks_effect_fisheye : Double
|
|
341
|
-
mut looks_effect_whirl : Double
|
|
342
|
-
mut looks_effect_pixelate : Double
|
|
343
|
-
mut looks_effect_mosaic : Double
|
|
344
|
-
mut looks_effect_brightness : Double
|
|
345
|
-
mut looks_effect_ghost : Double
|
|
346
|
-
variables : Map[String, Json]
|
|
347
|
-
variable_names : Map[String, String]
|
|
348
|
-
variable_slot_by_id : Map[String, Int]
|
|
349
|
-
variable_slot_by_name : Map[String, Int]
|
|
350
|
-
variable_id_by_slot : Array[String]
|
|
351
|
-
mut variable_values : Array[Json]
|
|
352
|
-
mut variable_numeric_flags : Array[Bool]
|
|
353
|
-
lists : Map[String, Array[Json]]
|
|
354
|
-
list_names : Map[String, String]
|
|
355
|
-
list_slot_by_id : Map[String, Int]
|
|
356
|
-
list_slot_by_name : Map[String, Int]
|
|
357
|
-
list_id_by_slot : Array[String]
|
|
358
|
-
mut list_values : Array[Array[Json]]
|
|
359
|
-
blocks : Map[String, ScratchBlock]
|
|
360
|
-
const_number_block_values : Map[String, Double]
|
|
361
|
-
procedures : Map[String, ProcedureSpec]
|
|
362
|
-
block_pc_by_id : Map[String, Int]
|
|
363
|
-
blocks_by_pc : Array[ScratchBlock]
|
|
364
|
-
block_fast_meta_by_pc : Array[BlockFastMeta]
|
|
365
|
-
mut numeric_program_cache : Map[String, NumericReporterProgram]
|
|
366
|
-
mut numeric_program_compile_failed : Map[String, Bool]
|
|
367
|
-
mut bool_program_cache : Map[String, BoolReporterProgram]
|
|
368
|
-
mut bool_program_compile_failed : Map[String, Bool]
|
|
369
|
-
top_level_hats : Array[String]
|
|
370
|
-
green_flag_starts : Array[String]
|
|
371
|
-
stage_clicked_starts : Array[String]
|
|
372
|
-
sprite_clicked_starts : Array[String]
|
|
373
|
-
clone_start_starts : Array[String]
|
|
374
|
-
key_pressed_hats : Array[KeyPressedHatStart]
|
|
375
|
-
broadcast_hats : Array[BroadcastHatStart]
|
|
376
|
-
backdrop_hats : Array[BackdropHatStart]
|
|
377
|
-
predicate_hats : Array[PredicateHatStart]
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
pub(all) struct Thread {
|
|
381
|
-
id : Int
|
|
382
|
-
target_index : Int
|
|
383
|
-
mut pc : Int?
|
|
384
|
-
mut wait_until_ms : Int?
|
|
385
|
-
mut wait_for_input : String?
|
|
386
|
-
mut done : Bool
|
|
387
|
-
mut warp_mode : Bool
|
|
388
|
-
mut warp_started_ms : Int
|
|
389
|
-
mut stack : Array[ControlFrame]
|
|
390
|
-
mut loop_counters : Map[String, Int]
|
|
391
|
-
parent_waiter : Int?
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
pub(all) struct Vm {
|
|
395
|
-
targets : Array[TargetState]
|
|
396
|
-
stage_index : Int
|
|
397
|
-
assets : Map[String, Json]
|
|
398
|
-
options : VmOptions
|
|
399
|
-
pen_width : Int
|
|
400
|
-
pen_height : Int
|
|
401
|
-
mut pen_pixels : Array[Byte]
|
|
402
|
-
mut pen_vectors : Array[PenVectorStroke]
|
|
403
|
-
mut render_revision : Int
|
|
404
|
-
mut render_cache_valid : Bool
|
|
405
|
-
mut render_cache_revision : Int
|
|
406
|
-
mut render_cache_pixels : Array[Byte]
|
|
407
|
-
mut pen_bounds_valid : Bool
|
|
408
|
-
mut pen_min_x : Int
|
|
409
|
-
mut pen_min_y : Int
|
|
410
|
-
mut pen_max_x : Int
|
|
411
|
-
mut pen_max_y : Int
|
|
412
|
-
mut backdrop_cache_valid : Bool
|
|
413
|
-
mut backdrop_cache_pixels : Array[Byte]
|
|
414
|
-
mut backdrop_cache_width : Int
|
|
415
|
-
mut backdrop_cache_height : Int
|
|
416
|
-
mut backdrop_cache_stage_index : Int
|
|
417
|
-
mut backdrop_cache_stage_costume_index : Int
|
|
418
|
-
mut backdrop_cache_effect_color : Double
|
|
419
|
-
mut backdrop_cache_effect_fisheye : Double
|
|
420
|
-
mut backdrop_cache_effect_whirl : Double
|
|
421
|
-
mut backdrop_cache_effect_pixelate : Double
|
|
422
|
-
mut backdrop_cache_effect_mosaic : Double
|
|
423
|
-
mut backdrop_cache_effect_brightness : Double
|
|
424
|
-
mut backdrop_cache_effect_ghost : Double
|
|
425
|
-
mut threads : Array[Thread]
|
|
426
|
-
mut next_thread_id : Int
|
|
427
|
-
mut run_id : Int
|
|
428
|
-
mut now_ms : Int
|
|
429
|
-
mut running : Bool
|
|
430
|
-
mut answer : String
|
|
431
|
-
mut effects : Array[HostEffect]
|
|
432
|
-
mut io_state : Map[String, Json]
|
|
433
|
-
mut io_prev_state : Map[String, Json]
|
|
434
|
-
mut waiting_children : Map[Int, Int]
|
|
435
|
-
mut rng_state : Int
|
|
436
|
-
mut control_counter : Int
|
|
437
|
-
mut hot_op_counts : Map[String, Int]
|
|
438
|
-
mut next_clone_id : Int
|
|
439
|
-
mut hat_predicates : Map[String, Bool]
|
|
440
|
-
mut timer_start_ms : Int
|
|
441
|
-
mut music_tempo : Double
|
|
442
|
-
mut tts_language : String
|
|
443
|
-
mut procedure_frames : Map[Int, Array[ProcedureFrame]]
|
|
444
|
-
mut pending_translate_requests : Map[String, Bool]
|
|
445
|
-
mut redraw_requested : Bool
|
|
446
|
-
mut redraw_requested_while_warp : Bool
|
|
447
|
-
mut current_thread_id : Int?
|
|
448
|
-
mut mathop_sin_cache_valid : Bool
|
|
449
|
-
mut mathop_sin_cache_input : Double
|
|
450
|
-
mut mathop_sin_cache_output : Double
|
|
451
|
-
mut mathop_cos_cache_valid : Bool
|
|
452
|
-
mut mathop_cos_cache_input : Double
|
|
453
|
-
mut mathop_cos_cache_output : Double
|
|
454
|
-
mut aot_commands : Array[AotCommand]
|
|
455
|
-
mut aot_pending : Bool
|
|
456
|
-
mut aot_full_green_flag_starts : Map[Int, Array[Int]]
|
|
457
|
-
mut aot_use_full_exec : Bool
|
|
458
|
-
mut aot_wasm_only : Bool
|
|
459
|
-
mut frame_override : FrameReport?
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
pub(all) struct VmOptions {
|
|
463
|
-
mut turbo : Bool
|
|
464
|
-
mut compatibility_30tps : Bool
|
|
465
|
-
mut max_clones : Int
|
|
466
|
-
mut deterministic : Bool
|
|
467
|
-
mut seed : Int
|
|
468
|
-
mut pen_width : Int
|
|
469
|
-
mut pen_height : Int
|
|
470
|
-
mut step_timeout_ticks : Int
|
|
471
|
-
}
|
|
472
|
-
pub impl Eq for VmOptions
|
|
473
|
-
pub impl Show for VmOptions
|
|
474
|
-
pub impl ToJson for VmOptions
|
|
475
|
-
|
|
476
|
-
// Type aliases
|
|
477
|
-
|
|
478
|
-
// Traits
|
|
479
|
-
|