-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
GlobalSymbols.cpp
1702 lines (1660 loc) · 62.9 KB
/
GlobalSymbols.cpp
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
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "SymbolDefs.h"
const int32_t radsperdeg = 572958;
GlobalSymbols GlobalSymbols::singleton;
static AccessorTable GlobalTable[] =
{
// name, tag, rettype, var, funcFlags, params,optparams
{ "Quit", 0, ZTID_VOID, -1, 0, {},{} },
{ "QuitNoKill", 0, ZTID_VOID, -1, 0, {},{} },
{ "Waitframe", 0, ZTID_VOID, -1, 0, {},{} },
{ "Waitframes", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT },{} },
{ "Waitdraw", 0, ZTID_VOID, -1, 0, {},{} },
{ "WaitTo", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT, ZTID_BOOL },{ 0 } },
{ "WaitEvent", 0, ZTID_FLOAT, -1, 0, {},{} },
{ "Trace", 0, ZTID_VOID, -1, 0, { ZTID_UNTYPED },{} },
{ "Trace", 1, ZTID_VOID, -1, 0, { ZTID_LONG },{} },
{ "TraceB", 0, ZTID_VOID, -1, 0, { ZTID_BOOL },{} },
{ "TraceS", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT },{} },
{ "TraceNL", 0, ZTID_VOID, -1, 0, {},{} },
{ "ClearTrace", 0, ZTID_VOID, -1, 0, {},{} },
{ "TraceToBase", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
{ "Sin", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "Cos", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "Tan", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "ArcTan", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "ArcSin", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "ArcCos", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "RadianSin", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "RadianCos", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "RadianTan", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "Pow", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "LPow", 0, ZTID_LONG, -1, 0, { ZTID_LONG, ZTID_LONG },{} },
{ "InvPow", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "Factorial", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "Abs", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "Log10", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "Ln", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "Sqrt", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "CopyTile", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "SwapTile", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "ClearTile", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT },{} },
{ "SizeOfArray", 0, ZTID_FLOAT, -1, 0, { ZTID_UNTYPED },{} },
{ "ResizeArray", 0, ZTID_VOID, -1, 0, { ZTID_UNTYPED, ZTID_FLOAT },{} },
{ "OwnArray", 0, ZTID_VOID, -1, 0, { ZTID_UNTYPED },{} },
{ "DestroyArray", 0, ZTID_VOID, -1, 0, { ZTID_UNTYPED },{} },
{ "OwnObject", 0, ZTID_VOID, -1, 0, { ZTID_UNTYPED },{} },
{ "GlobalObject", 0, ZTID_VOID, -1, 0, { ZTID_UNTYPED },{} },
{ "OverlayTile", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "Floor", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "Ceiling", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "GetSystemTime", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "Distance", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
{ "Distance", 1, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
{ "LongDistance", 0, ZTID_LONG, -1, 0, { ZTID_LONG, ZTID_LONG, ZTID_LONG, ZTID_LONG },{} },
{ "LongDistance", 1, ZTID_LONG, -1, 0, { ZTID_LONG, ZTID_LONG, ZTID_LONG, ZTID_LONG, ZTID_LONG },{} },
{ "strcmp", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "strncmp", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
{ "stricmp", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "strnicmp", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
{ "strcpy", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "itoacat", 0, ZTID_VOID, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "ArrayCopy", 0, ZTID_VOID, -1, 0, { ZTID_UNTYPED, ZTID_UNTYPED },{} },
{ "strlen", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "atoi", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "ilen", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "utol", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "ltou", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "convcase", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "itoa", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "xtoa", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "xtoi", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "SaveSRAM", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "LoadSRAM", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "strcat", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "strchr", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "strcspn", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "strspn", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "strstr", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "strrchr", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "IsValidArray", 0, ZTID_BOOL, -1, 0, { ZTID_UNTYPED },{} },
{ "DegtoRad", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "RadtoDeg", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "printf", 0, ZTID_VOID, -1, FL_VARG, { ZTID_CHAR },{} },
{ "sprintf", 0, ZTID_FLOAT, -1, FL_VARG, { ZTID_CHAR, ZTID_CHAR },{} },
{ "printfa", 0, ZTID_VOID, -1, 0, { ZTID_CHAR, ZTID_UNTYPED },{} },
{ "sprintfa", 0, ZTID_FLOAT, -1, 0, { ZTID_CHAR, ZTID_CHAR, ZTID_UNTYPED },{} },
{ "Max", 0, ZTID_UNTYPED, -1, FL_VARG, { ZTID_UNTYPED, ZTID_UNTYPED },{},2 },
{ "Min", 0, ZTID_UNTYPED, -1, FL_VARG, { ZTID_UNTYPED, ZTID_UNTYPED },{},2 },
{ "Choose", 0, ZTID_UNTYPED, -1, FL_VARG, { ZTID_UNTYPED },{},1 },
{ "ArrayPushBack", 0, ZTID_BOOL, -1, 0, { ZTID_UNTYPED, ZTID_UNTYPED },{} },
{ "ArrayPushFront", 0, ZTID_BOOL, -1, 0, { ZTID_UNTYPED, ZTID_UNTYPED },{} },
{ "ArrayPushAt", 0, ZTID_BOOL, -1, 0, { ZTID_UNTYPED, ZTID_UNTYPED, ZTID_FLOAT },{} },
{ "ArrayPopBack", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "ArrayPopFront", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "ArrayPopAt", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED, ZTID_FLOAT },{} },
//Undocumented intentionally - compat only
{ "Rand", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
{ "SRand", 0, ZTID_VOID, -1, 0, { ZTID_LONG },{} },
{ "SRand", 1, ZTID_LONG, -1, 0, {},{} },
{ "Untype", 0, ZTID_UNTYPED, -1, FL_DEPR, { ZTID_UNTYPED },{},0,"Use casting '<untyped>(var)' instead!" },
{ "Byte", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "Int8", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "SignedByte", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "Word", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "Int16", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "Short", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "Integer", 0, ZTID_UNTYPED, -1, 0, { ZTID_UNTYPED },{} },
{ "GetScriptRAM", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_FLOAT },{} },
{ "SetScriptRAM", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "GetGlobalRAM", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_FLOAT },{} },
{ "SetGlobalRAM", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_FLOAT, ZTID_FLOAT },{} },
{ "SetColorBuffer", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
{ "SetDepthBuffer", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
{ "GetColorBuffer", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
{ "GetDepthBuffer", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
{ "EngineDegtoRad", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_FLOAT },{},0,"Use 'DegtoRad()' instead!" },
{ "EngineRadtoDeg", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_FLOAT },{},0,"Use 'RadtoDeg()' instead!" },
{ "TraceLWeapon", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_LWPN },{},0,"Use 'Trace()' instead!" },
{ "TraceEWeapon", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_EWPN },{},0,"Use 'Trace()' instead!" },
{ "TraceNPC", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_NPC },{},0,"Use 'Trace()' instead!" },
{ "TraceFFC", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_FFC },{},0,"Use 'Trace()' instead!" },
{ "TraceItem", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_ITEM },{},0,"Use 'Trace()' instead!" },
{ "TraceItemData", 0, ZTID_VOID, -1, FL_DEPR, { ZTID_ITEMCLASS },{},0,"Use 'Trace()' instead!" },
{ "SizeOfArrayBool", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_BOOL },{},0,"Use 'SizeOfArray()' instead!" },
{ "SizeOfArrayFFC", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_FFC },{},0,"Use 'SizeOfArray()' instead!" },
{ "SizeOfArrayItem", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_ITEM },{},0,"Use 'SizeOfArray()' instead!" },
{ "SizeOfArrayLWeapon", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_LWPN },{},0,"Use 'SizeOfArray()' instead!" },
{ "SizeOfArrayEWeapon", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_EWPN },{},0,"Use 'SizeOfArray()' instead!" },
{ "SizeOfArrayNPC", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_NPC },{},0,"Use 'SizeOfArray()' instead!" },
{ "SizeOfArrayItemdata", 0, ZTID_FLOAT, -1, FL_DEPR, { ZTID_ITEMCLASS },{},0,"Use 'SizeOfArray()' instead!" },
{ "", 0, ZTID_VOID, -1, 0, {},{} }
//Unused old junk
//overload, 2 args
// { "atoi", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
// { "xtoi", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
//overload, 2 args
// { "xtoi", 1, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
// { "xlen", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT },{} },
//overload, 2 args
// { "xlen", 1, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
// { "xtoa", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
//overload, 2 args
// { "ilen", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT },{} },
// { "CalculateSpline", 0, ZTID_FLOAT, -1, 0, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
// { "CollisionRect", 0, ZTID_BOOL, -1, 0, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
// { "CollisionBox", 0, ZTID_BOOL, -1, 0, { ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT, ZTID_FLOAT },{} },
};
GlobalSymbols::GlobalSymbols()
{
table = GlobalTable;
refVar = NUL;
hasPrefixType = false;
}
void GlobalSymbols::generateCode()
{
//no input, one return
/*
//untyped NULL()(global)
{
Function* function = getFunction("NULL");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop pointer, and ignore it
ASSERT_NUL();
addOpcode2 (code, new OSetImmediate(new VarArgument(EXP1), new LiteralArgument(0)));
LABELBACK(label);
RETURN();
function->giveCode(code);
}
*/
//one input, one return
//untyped Untype(untype)
{
Function* function = getFunction("Untype");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop pointer, and ignore it
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
/*
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);*/
//addOpcode2 (code, new OSetImmediate(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN(); //Just return it?
function->giveCode(code);
}
//float Distance(game, int32_t, int32_t, int32_t, int32_t)
{
Function* function = getFunction("Distance",0);
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop off the params
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX2)));
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX)));
addOpcode2 (code, new OPopRegister(new VarArgument(SFTEMP)));
addOpcode2 (code, new OSetRegister(new VarArgument(EXP1), new VarArgument(DISTANCE)));
RETURN();
function->giveCode(code);
}
//float Distance(game, int32_t, int32_t, int32_t, int32_t, int32_t)
{
Function* function = getFunction("Distance", 1);
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop off the params
addOpcode2 (code, new OPopRegister(new VarArgument(WHAT_NO_7)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX2)));
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX)));
addOpcode2 (code, new OPopRegister(new VarArgument(SFTEMP)));
addOpcode2 (code, new OSetRegister(new VarArgument(EXP1), new VarArgument(DISTANCESCALE)));
RETURN();
function->giveCode(code);
}
//int32_t LongDistance(game, int32_t, int32_t, int32_t, int32_t)
{
Function* function = getFunction("LongDistance");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop off the params
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX2)));
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX)));
addOpcode2 (code, new OPopRegister(new VarArgument(SFTEMP)));
addOpcode2 (code, new OSetRegister(new VarArgument(EXP1), new VarArgument(LONGDISTANCE)));
RETURN();
function->giveCode(code);
}
//int32_t LongDistance(game, int32_t, int32_t, int32_t, int32_t, int32_t)
{
Function* function = getFunction("LongDistance", 1);
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop off the params
addOpcode2 (code, new OPopRegister(new VarArgument(WHAT_NO_7)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX2)));
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX)));
addOpcode2 (code, new OPopRegister(new VarArgument(SFTEMP)));
addOpcode2 (code, new OSetRegister(new VarArgument(EXP1), new VarArgument(LONGDISTANCESCALE)));
RETURN();
function->giveCode(code);
}
//int32_t Rand(int32_t maxval)
{
Function* function = getFunction("Rand");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop maxval
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new ORandRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int_full SRand(int_full seed)
{
Function* function = getFunction("SRand");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop seed
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OSRandRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int_full SRand()
{
Function* function = getFunction("SRand", 1);
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OSRandRand(new VarArgument(EXP1)));
LABELBACK(label);
RETURN();
function->giveCode(code);
}
//bool IsValidArray(untyped)
{
Function* function = getFunction("IsValidArray");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//Pop array ptr
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OIsValidArray(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//int32_t GetSystemTime(int32_t category)
{
Function* function = getFunction("GetSystemTime");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OGetSystemRTCRegister(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//void Quit()
{
Function* function = getFunction("Quit");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OQuit());
LABELBACK(label);
function->giveCode(code);
}
//void QuitNoKill()
{
Function* function = getFunction("QuitNoKill");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OQuitNoDealloc());
LABELBACK(label);
function->giveCode(code);
}
//void Waitframe()
{
Function* function = getFunction("Waitframe");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OWaitframe());
LABELBACK(label);
RETURN();
function->giveCode(code);
}
//void Waitframes(int count)
{
Function* function = getFunction("Waitframes");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OWaitframes(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//void Waitdraw()
{
Function* function = getFunction("Waitdraw");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OWaitdraw());
LABELBACK(label);
RETURN();
function->giveCode(code);
}
//void WaitTo(int32_t, bool)
{
Function* function = getFunction("WaitTo");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OWaitTo(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int WaitEvent()
{
Function* function = getFunction("WaitEvent");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OWaitEvent());
LABELBACK(label);
RETURN();
function->giveCode(code);
}
//void Trace(untyped val)
{
Function* function = getFunction("Trace");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTraceRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void Trace(long val)
{
Function* function = getFunction("Trace",1);
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTraceLRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("TraceLWeapon");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTraceRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("TraceEWeapon");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTraceRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("TraceNPC");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTraceRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("TraceFFC");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTraceRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("TraceItem");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTraceRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("TraceItemData");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTraceRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void TraceB(bool val)
{
Function* function = getFunction("TraceB");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTrace2Register(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void TraceS(bool val)
{
Function* function = getFunction("TraceS");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTrace6Register(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void TraceNL()
{
Function* function = getFunction("TraceNL");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OTrace3());
LABELBACK(label);
RETURN();
function->giveCode(code);
}
//void ClearTrace()
{
Function* function = getFunction("ClearTrace");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OTrace4());
LABELBACK(label);
RETURN();
function->giveCode(code);
}
//void TraceToBase(float, float, float)
{
Function* function = getFunction("TraceToBase");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OTrace5Register());
LABELBACK(label);
POP_ARGS(3, NUL);
RETURN();
function->giveCode(code);
}
//int32_t Sin(int32_t val)
{
Function* function = getFunction("Sin");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OSinRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t RadianSin(int32_t val)
{
Function* function = getFunction("RadianSin");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OMultImmediate(new VarArgument(EXP2), new LiteralArgument(radsperdeg)));
addOpcode2 (code, new OSinRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t ArcSin(int32_t val)
{
Function* function = getFunction("ArcSin");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OArcSinRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t Cos(int32_t val)
{
Function* function = getFunction("Cos");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OCosRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t RadianCos(int32_t val)
{
Function* function = getFunction("RadianCos");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OMultImmediate(new VarArgument(EXP2), new LiteralArgument(radsperdeg)));
addOpcode2 (code, new OCosRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t ArcCos(int32_t val)
{
Function* function = getFunction("ArcCos");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OArcCosRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t Tan(int32_t val)
{
Function* function = getFunction("Tan");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OTanRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t ArcTan(int32_t X, int32_t Y)
{
Function* function = getFunction("ArcTan");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX)));
addOpcode2 (code, new OATanRegister(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//int32_t RadianTan(int32_t val)
{
Function* function = getFunction("RadianTan");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OMultImmediate(new VarArgument(EXP2), new LiteralArgument(radsperdeg)));
addOpcode2 (code, new OTanRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t Pow(int32_t first, int32_t second)
{
Function* function = getFunction("Pow");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OPowRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t LPow(int32_t first, int32_t second)
{
Function* function = getFunction("LPow");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OLPowRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t InvPow(int32_t first, int32_t second)
{
Function* function = getFunction("InvPow");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OInvPowRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t Factorial(int32_t val)
{
Function* function = getFunction("Factorial");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OFactorial(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//int32_t Abs(int32_t val)
{
Function* function = getFunction("Abs");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OAbsRegister(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//int32_t Log10(int32_t val)
{
Function* function = getFunction("Log10");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OLog10Register(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//int32_t Ln(int32_t val)
{
Function* function = getFunction("Ln");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OLogERegister(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//int32_t Sqrt(int32_t val)
{
Function* function = getFunction("Sqrt");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OSqrtRegister(new VarArgument(EXP1), new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//int32_t CopyTile(int32_t source, int32_t dest)
{
Function* function = getFunction("CopyTile");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OCopyTileRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t SwapTile(int32_t first, int32_t second)
{
Function* function = getFunction("SwapTile");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OSwapTileRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t OverlayTile(int32_t first, int32_t second)
{
Function* function = getFunction("OverlayTile");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OOverlayTileRegister(new VarArgument(EXP1), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void ClearTile(int32_t tile)
{
Function* function = getFunction("ClearTile");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OClearTileRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void GetGlobalRAM(int32_t)
{
Function* function = getFunction("GetGlobalRAM");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop off the params
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX)));
LABELBACK(label);
addOpcode2 (code, new OSetRegister(new VarArgument(EXP1), new VarArgument(GLOBALRAMD)));
RETURN();
function->giveCode(code);
}
//void SetGlobalRAM(int32_t, int32_t)
{
Function* function = getFunction("SetGlobalRAM");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop off the params
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX)));
addOpcode2 (code, new OSetRegister(new VarArgument(GLOBALRAMD), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void GetScriptRAM(int32_t)
{
Function* function = getFunction("GetScriptRAM");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop off the params
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX)));
LABELBACK(label);
//addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OSetRegister(new VarArgument(EXP1), new VarArgument(SCRIPTRAMD)));
RETURN();
function->giveCode(code);
}
//void SetScriptRAM(int32_t, int32_t)
{
Function* function = getFunction("SetScriptRAM");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
//pop off the params
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(INDEX)));
addOpcode2 (code, new OSetRegister(new VarArgument(SCRIPTRAMD), new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void SetColorBuffer(int32_t amount, int32_t offset, int32_t stride, int32_t *ptr)
{
Function* function = getFunction("SetColorBuffer");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OSetColorBufferRegister());
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void SetDepthBuffer(int32_t amount, int32_t offset, int32_t stride, int32_t *ptr)
{
Function* function = getFunction("SetDepthBuffer");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OSetDepthBufferRegister());
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void GetColorBuffer(int32_t amount, int32_t offset, int32_t stride, int32_t *ptr)
{
Function* function = getFunction("GetColorBuffer");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OGetColorBufferRegister());
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void GetDepthBuffer(int32_t amount, int32_t offset, int32_t stride, int32_t *ptr)
{
Function* function = getFunction("GetDepthBuffer");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OGetDepthBufferRegister());
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//int32_t SizeOfArray(int32_t val)
{
Function* function = getFunction("SizeOfArray");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OArraySize(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//void ResizeArray(untyped ptr, int sz)
{
Function* function = getFunction("ResizeArray");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP2)));
LABELBACK(label);
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
addOpcode2 (code, new OResizeArrayRegister(new VarArgument(EXP1),new VarArgument(EXP2)));
RETURN();
function->giveCode(code);
}
//void OwnArray(untyped ptr)
{
Function* function = getFunction("OwnArray");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OOwnArrayRegister(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//void OwnObject(untyped ptr)
{
Function* function = getFunction("OwnObject");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OOwnObject(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//void GlobalObject(untyped ptr)
{
Function* function = getFunction("GlobalObject");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OGlobalObject(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
//void DestroyArray(untyped ptr)
{
Function* function = getFunction("DestroyArray");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new ODestroyArrayRegister(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("Byte");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OByte(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("Int8");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OByte(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("SignedByte");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OSByte(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("Word");
int32_t label = function->getLabel();
vector<shared_ptr<Opcode>> code;
addOpcode2 (code, new OPopRegister(new VarArgument(EXP1)));
LABELBACK(label);
addOpcode2 (code, new OWord(new VarArgument(EXP1)));
RETURN();
function->giveCode(code);
}
{
Function* function = getFunction("Int16");