-
Notifications
You must be signed in to change notification settings - Fork 3
/
BytePusher.txt
558 lines (540 loc) · 7.68 KB
/
BytePusher.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
//----- Variables -----------------------------------------------------------------------------------------------------
*OAMDMA# = 0
*OAMDMAS = 0
,c = 0
,joypad = 0
-keyRandom = 0
-LCDC = 0
-LCDS = 0
-LY = 0
-LYC = 0
-LYmask = 0
-scx = 0
-SCXMOD8 = 0
-STATUS = 0
-windowWasDrawn? = 0
-WLY = 0
-wx = 0
.DIV2 = 0
.DIVCYCLES = 0
.DMAenable = 0
.DMAend = 0
.DMAlength = 0
.DMAstart = 0
.DMAtype = 0
.GBC? = 0
.HDMAenable = 0
.IME = 0
.instr = 0
.instrID = 0
.Mpri = 0
.soundEnable = 0
.SPEED = 0
.Spri = 0
.spriteattributes = 0
.spriteCpal = 0
.spritesize = 0
.TAC1 = 0
.TAC2 = 0
.TACFLAG = 0
.tileB = 0
.timenable = 0
.vbank = 0
.windowflag = 0
@PAL = 0
@PIX = 0
a = 256
arm7.pc = 0
arm7.read_return = 0
arm9.pc = 0
arm9.read_return = 0
bg_mode = 0
bytepusher = 256
c8.Load/Save_Quirk = 0
c8.Shift_quirk = 0
c8scrnsize = 0
calc.char = 0
calc.return = 0
calc.temp = 0
calc.temp2 = 0
chip8.audio toggle = 0
chip8.audio_buffer = 0
chip8.delay_timer = 0
chip8.drawflag = 0
chip8.drawmode = 0
chip8.drawplane = 0
chip8.drawvariety = 0
chip8.dummy = 0
chip8.dummy2 = 0
chip8.dummy3 = 0
chip8.dummy4 = 0
chip8.dummy5 = 0
chip8.fx0aflag = 0
chip8.HPSFlag = 0
chip8.I = 0
chip8.pc = 0
chip8.pitch = 0
chip8.rand = 0
chip8.return = 0
chip8.screenheight = 0
chip8.screenwidth = 0
chip8.sound_timer = 0
chip8.spritewidth = 0
chip8m.collisioncolor = 0
core.byte_return = 0
core.condition_test = 0
core.dummy = 0
core.dummy2 = 0
core.dummy_op = 0
core.instruction_format = 0
core.little_endian = 0
core.op.dummy = 0
core.op.dummy2 = 0
core.read_return = 0
core.rotate_return = 0
core.shift_return = 0
CPF = 0
fftlast = 0
flags.met = 0
FPS = 0
g = 0
Game Boy: _HALT = 0
Game Boy: _PC = 0
Game Boy: _SP = 0
h = 0
i = 0
i = 54696
j = 65536
k = 0
k = 0
l = 0
loop = 0
m = 0
n = 10
op.opcode = 0
op.pos = 0
op.temp = 0
p = 0
program.done = 0
read.return = 0
read.single.return = 0
render = 0
scanX = 0
scanY = 0
SF2091! fix = 0
storage.byte = 0
T1 = 0
T2 = 0
T3 = 0
T4 = 0
T4.1 = 0
T4.2 = 0
T5 = 0
T6 = 0
T7 = 0
T8 = 0
T9 = 0
T10 = 0
T11 = 0
target frames = 0
tile_mode = 0
time1 = 0
time2 = 0
v = 0
VIP jumps = 0
x = 0
z = 0
_A = 0
_B = 0
_current bank = 0
_frames = 0
_frameskip = 0
_id = 0
_IEindex = 0
_IFindex = 0
_INTRdest = 0
_lineCyc = 0
_MBCnumber = 0
_pitch = 0
_PIXEL# = 0
_R = 0
_RE = 0
_rom size = 0
_S = 0
_SIZE = 0
_STATcond1 = 0
_STATcond2 = 0
_T = 0
_X = 0
_XSHIFT = 0
_YSHIFT = 0
_Z = 0
//----- Lists ---------------------------------------------------------------------------------------------------------
$A = { }
$B = { }
$C = { }
*OAMidx = { }
*OAMx = { }
*OAMy = { }
*palette = { }
.addr2ptr = { }
.AND = { }
.OR = { }
.pointerStart = { }
.ptr = { }
.ptr index = { }
.vals = { }
.XOR = { }
2^x = { }
arm7.registers = { }
arm9.flags = { }
arm9.registers = { }
bin = { }
Boot-128 = { }
bytepusher = { }
byteStack = { }
c = {
aewq321x
vfr4czds
}
chip8.keyboard = { }
chip8.memory = { }
chip8.registers = { }
chip8.screen = { }
chip8.screen2 = { }
chip8.stack = { }
dat = { }
Flag bits = { }
p = {
51
102
153
204
255
13056
13107
13158
13209
13260
13311
26112
26163
26214
26265
26316
26367
39168
39219
39270
39321
39372
39423
52224
52275
52326
52377
52428
52479
65280
65331
65382
65433
65484
65535
3342336
3342387
3342438
3342489
3342540
3342591
3355392
3355443
3355494
3355545
3355596
3355647
3368448
3368499
3368550
3368601
3368652
3368703
3381504
3381555
3381606
3381657
3381708
3381759
3394560
3394611
3394662
3394713
3394764
3394815
3407616
3407667
3407718
3407769
3407820
3407871
6684672
6684723
6684774
6684825
6684876
6684927
6697728
6697779
6697830
6697881
6697932
6697983
6710784
6710835
6710886
6710937
6710988
6711039
6723840
6723891
6723942
6723993
6724044
6724095
6736896
6736947
6736998
6737049
6737100
6737151
6749952
6750003
6750054
6750105
6750156
6750207
10027008
10027059
10027110
10027161
10027212
10027263
10040064
10040115
10040166
10040217
10040268
10040319
10053120
10053171
10053222
10053273
10053324
10053375
10066176
10066227
10066278
10066329
10066380
10066431
10079232
10079283
10079334
10079385
10079436
10079487
10092288
10092339
10092390
10092441
10092492
10092543
13369344
13369395
13369446
13369497
13369548
13369599
13382400
13382451
13382502
13382553
13382604
13382655
13395456
13395507
13395558
13395609
13395660
13395711
13408512
13408563
13408614
13408665
13408716
13408767
13421568
13421619
13421670
13421721
13421772
13421823
13434624
13434675
13434726
13434777
13434828
13434879
16711680
16711731
16711782
16711833
16711884
16711935
16724736
16724787
16724838
16724889
16724940
16724991
16737792
16737843
16737894
16737945
16737996
16738047
16750848
16750899
16750950
16751001
16751052
16751103
16763904
16763955
16764006
16764057
16764108
16764159
16776960
16777011
16777062
16777113
16777164
16777215
0
51
102
153
204
255
13056
13107
13158
13209
13260
13311
26112
26163
26214
26265
26316
26367
39168
39219
39270
39321
39372
39423
52224
52275
52326
52377
52428
52479
65280
65331
65382
65433
65484
65535
3342336
3342387
3342438
3342489
3342540
}
schip8.font = { }
schip8.RPL = { }
t = { }
_cartridge stuff = { }
_DMGPALETTE = { }
_GBCPALETTELOOKUP = { }
_instrIDs = { }
_instrParam = { }
_PALETTE RAM = { }
_pix = { }
_RAM = { }
_REGISTERS = { }
_ROM = { }
_soundregs = { }
//----- Broadcast received events -------------------------------------------------------------------------------------
WhenBroadcastReceived(BytePusher)
{
Call init;
Event.BroadcastAndWait("un-needed broadcast");
Forever
{
Call CPU;
Call Draw bp;
}
}
WhenBroadcastReceived(exit emulator)
{
Stop(other scripts in sprite);
}
WhenBroadcastReceived(Nuke all lists)
{
List.DeleteAll(_rom);
List.DeleteAll(_registers);
Event.Broadcast("Project not saving fix");
}
WhenBroadcastReceived(Project not saving fix)
{
List.DeleteAll(bytepusher);
List.DeleteAll(t);
}
//----- Custom blocks -------------------------------------------------------------------------------------------------
Define CPU (warp=true)
{
control_for_each ?? - probably legacy function from Scratch 2.0;
i = ((_rom[3] * 65536) + ((_rom[4] * 256) + _rom[5]));
Repeat (65536)
{
List.DeleteAll(t);
p = 0;
control_for_each ?? - probably legacy function from Scratch 2.0;
List.ReplaceItem(_rom, (t[2] + 1), _rom[(t[1] + 1)]);
i = t[3];
}
j = 0;
}
Define Draw bp (warp=true)
{
control_for_each ?? - probably legacy function from Scratch 2.0;
}
Define init (warp=true)
{
List.DeleteAll(bytepusher);
i = 33554432;
Repeat ((16777216 - List.Length(_rom)))
{
List.Add(_rom, 0);
}
Repeat (65536)
{
List.Add(bytepusher, "");
i += 1;
}
}
//----- Costumes ------------------------------------------------------------------------------------------------------
costume2.svg