-
Notifications
You must be signed in to change notification settings - Fork 3
/
p_move.gas
2583 lines (2248 loc) · 39.1 KB
/
p_move.gas
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
.long
.dc.l codeend-_p_move_start
_p_move_start::
.gpu
.org $f1b140
S_LE .ccdef $14 ; PL
U_LE .ccdef $04 ; CC
S_GT .ccdef $18 ; MI
U_GT .ccdef $08 ; CS
S_LT .ccdef $15 ; PL+NE
U_LT .ccdef $05 ; CC+NE
FP .equr r14
scratch .equr r10
scratch2 .equr r11
RETURNVALUE .equr r29
RETURNPOINT .equr r28
MATH_A .equr r27
MATH_B .equr r26
MATH_C .equr r25
MATH_RTS .equr r24
MATH_SIGN .equr r23
movei #codestart,scratch
jump T,(scratch)
nop
GPU_IMUL:
move MATH_A,MATH_SIGN
xor MATH_B,MATH_SIGN
abs MATH_A
abs MATH_B
move MATH_A,MATH_C
mult MATH_B,MATH_C
move MATH_B,scratch2
shrq #16,scratch2
mult MATH_A,scratch2
shlq #16,scratch2
add scratch2,MATH_C
move MATH_A,scratch2
shrq #16,scratch2
mult MATH_B,scratch2
shlq #16,scratch2
add scratch2, MATH_C
btst #31,MATH_SIGN
jump EQ,(MATH_RTS)
nop
jump T,(MATH_RTS)
neg MATH_C
;=============================================================================
_PM_PointInSubsector:: ; subsector_t * (fixed_t x, fixed_t y)
;=============================================================================
.extern _nodes, _numnodes, _subsectors
pi_node .equr r15
pi_x .equr r16
pi_y .equr r17
pi_side .equr r18
pi_nodebase .equr r19
pi_nodex .equr r20
pi_nodey .equr r21
pi_nodedx .equr r22
pi_nodedy .equr r23
load (FP),pi_x
load (FP+1),pi_y
movei #_nodes,pi_nodebase
load (pi_nodebase),pi_nodebase
movei #_numnodes,pi_node
load (pi_node),pi_node
subq #1,pi_node ; nodenum = numnodes-1
nodeloop:
btst #15,pi_node
jr EQ,notsubsec
nop
bclr #15,pi_node
moveq #12,scratch
mult scratch,pi_node
movei #_subsectors,RETURNVALUE
load (RETURNVALUE),RETURNVALUE
jump T,(RETURNPOINT)
add pi_node,RETURNVALUE ; delay slot
notsubsec:
movei #56,scratch
mult scratch,pi_node
add pi_nodebase,pi_node
;
; pi_side = pointonnodeside (x,y,node)
;
load (pi_node),pi_nodex
load (pi_node+1),pi_nodey
load (pi_node+2),pi_nodedx
load (pi_node+3),pi_nodedy
move pi_x,scratch
sub pi_nodex,scratch
move pi_y,scratch2
sub pi_nodey,scratch2
sharq #16,scratch
sharq #16,scratch2
sharq #16,pi_nodedx
sharq #16,pi_nodedy
imult pi_nodedy,scratch
imult pi_nodedx,scratch2
cmp scratch2,scratch
jr S_GT,backside
nop
movei #48,scratch
jr T,gotside
nop
backside:
movei #52,scratch
gotside:
; got a subsector, return &subsectors[nodenum&~NF_SUBSECTOR];
;
; nodenum = node->children[side]
;
add scratch,pi_node
movei #nodeloop,scratch
jump T,(scratch)
load (pi_node),pi_node
;==============================================================================
_PM_UnsetThingPosition::
;==============================================================================
us_thing .equr r15
us_blockx .equr r16
us_blocky .equr r17
us_next .equr r18
us_prev .equr r19
load (FP),us_thing
load (us_thing+6),us_next ; thing->snext
load (us_thing+7),us_prev ; thing->sprev
or us_next,us_next
jr EQ,nosnext
nop
moveq #7*4,scratch
add us_next,scratch ; thing->snext->sprev
load (scratch),r31 ; DSP BUG
store us_prev,(scratch)
nosnext:
or us_prev,us_prev
jr EQ,nosprev
nop
moveq #6*4,scratch
add us_prev,scratch ; thing->sprev->snext
load (scratch),r31 ; DSP BUG
store us_next,(scratch)
jr T,slinksdone
nop
nosprev:
load (us_thing+13),scratch ; thing->subsector
load (scratch),scratch ; thing->subsector->sector
movei #20*4,scratch2
add scratch2,scratch ; thing->subsector->sector->thinglist
load (scratch),r31 ; DSP BUG
store us_next,(scratch)
slinksdone:
load (us_thing+25),scratch ; thing->flags
btst #4,scratch ; MF_NOBLOCKMAP
jump NE,(RETURNPOINT)
nop
;
; block links
;
load (us_thing+11),us_next
load (us_thing+12),us_prev
or us_next,us_next
jr EQ,nobnext
nop
movei #12*4,scratch
add us_next,scratch ; thing->bnext->bprev
load (scratch),r31 ; DSP BUG
store us_prev,(scratch)
nobnext:
or us_prev,us_prev
jr EQ,nobprev
nop
movei #11*4,scratch
add us_prev,scratch
load (scratch),r31 ; DSP BUG
store us_next,(scratch)
jump T,(RETURNPOINT)
nop
nobprev:
load (us_thing+3),us_blockx
movei #_bmaporgx,scratch
load (scratch),scratch
sub scratch,us_blockx
shrq #23,us_blockx
load (us_thing+4),us_blocky
movei #_bmaporgy,scratch
load (scratch),scratch
sub scratch,us_blocky
shrq #23,us_blocky
movei #_bmapwidth,scratch
load (scratch),scratch
mult scratch,us_blocky
add us_blockx,us_blocky
shlq #2,us_blocky ; int width table
movei #_blocklinks,scratch
load (scratch),scratch
add us_blocky,scratch
load (scratch),r31 ; DSP BUG
store us_next,(scratch)
jump T,(RETURNPOINT)
nop
codestart:
; unfuckdsp output -- add loads before external dsp stores
;====================
_P_TryMove2::
;3 dag registers 0 register variables
;localoffset:4 regoffset:4 argoffset:20
;====================
subq #20,FP
movei #_trymove2,r0
moveq #0,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_floatok,r0
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_oldx,r0
movei #_tmthing,r1
load (r1),r1
move r1,r2
addq #12,r2
load (r2),r2
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r2,(r0)
movei #_oldy,r0
addq #16,r1
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_PM_CheckPosition,r0
store r28,(FP+1) ; push ;(RETURNPOINT)
movei #L86,RETURNPOINT
jump T,(r0)
nop ; delay slot
L86:
load (FP+1), RETURNPOINT ; pop
movei #_checkposonly,r0
load (r0),r0
moveq #0,r1
cmp r0,r1
movei #L72,scratch
jump EQ,(scratch)
nop
movei #_checkposonly,r0
moveq #0,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #L71,r0
jump T,(r0)
nop
L72:
movei #_trymove2,r0
load (r0),r0
moveq #0,r1
cmp r0,r1
movei #L74,scratch
jump NE,(scratch)
nop
movei #L71,r0
jump T,(r0)
nop
L74:
movei #_tmthing,r0
load (r0),r0
movei #100,r1
add r1,r0
load (r0),r0
movei #4096,r1
and r1,r0
moveq #0,r1
cmp r0,r1
movei #L76,scratch
jump NE,(scratch)
nop
movei #_trymove2,r0
moveq #0,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmceilingz,r0
load (r0),r0
movei #_tmfloorz,r1
load (r1),r1
sub r1,r0
movei #_tmthing,r1
load (r1),r1
movei #68,r2
add r2,r1
load (r1),r1
cmp r0,r1
movei #L78,scratch
jump EQ,(scratch)
nop
jump MI,(scratch)
nop
movei #L71,r0
jump T,(r0)
nop
L78:
movei #_floatok,r0
moveq #1,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmthing,r0
load (r0),r0
movei #100,r1
move r0,r2
add r1,r2
load (r2),r1
movei #32768,r2
and r2,r1
moveq #0,r2
cmp r1,r2
movei #L80,scratch
jump NE,(scratch)
nop
movei #_tmceilingz,r1
load (r1),r1
move r0,r2
addq #20,r2
load (r2),r2
sub r2,r1
movei #68,r2
add r2,r0
load (r0),r0
cmp r1,r0
movei #L80,scratch
jump EQ,(scratch)
nop
jump MI,(scratch)
nop
movei #L71,r0
jump T,(r0)
nop
L80:
movei #_tmthing,r0
load (r0),r0
movei #100,r1
move r0,r2
add r1,r2
load (r2),r1
movei #32768,r2
and r2,r1
moveq #0,r2
cmp r1,r2
movei #L82,scratch
jump NE,(scratch)
nop
movei #_tmfloorz,r1
load (r1),r1
addq #20,r0
load (r0),r0
sub r0,r1
movei #1572864,r0
cmp r1,r0
movei #L82,scratch
jump PL,(scratch)
nop
movei #L71,r0
jump T,(r0)
nop
L82:
movei #_tmthing,r0
load (r0),r0
movei #100,r1
add r1,r0
load (r0),r0
movei #17408,r1
and r1,r0
moveq #0,r1
cmp r0,r1
movei #L84,scratch
jump NE,(scratch)
nop
movei #_tmfloorz,r0
load (r0),r0
movei #_tmdropoffz,r1
load (r1),r1
sub r1,r0
movei #1572864,r1
cmp r0,r1
movei #L84,scratch
jump PL,(scratch)
nop
movei #L71,r0
jump T,(r0)
nop
L84:
L76:
movei #_tmthing,r0
load (r0),r0
store r0,(FP) ; arg[]
movei #_PM_UnsetThingPosition,r0
store r28,(FP+1) ; push ;(RETURNPOINT)
movei #L87,RETURNPOINT
jump T,(r0)
nop ; delay slot
L87:
load (FP+1), RETURNPOINT ; pop
movei #_tmthing,r0
load (r0),r0
movei #56,r1
add r1,r0
movei #_tmfloorz,r1
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmthing,r0
load (r0),r0
movei #60,r1
add r1,r0
movei #_tmceilingz,r1
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmthing,r0
load (r0),r0
addq #12,r0
movei #_tmx,r1
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmthing,r0
load (r0),r0
addq #16,r0
movei #_tmy,r1
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmthing,r0
load (r0),r0
store r0,(FP) ; arg[]
movei #_PM_SetThingPosition,r0
store r28,(FP+1) ; push ;(RETURNPOINT)
movei #L88,RETURNPOINT
jump T,(r0)
nop ; delay slot
L88:
load (FP+1), RETURNPOINT ; pop
movei #_trymove2,r0
moveq #1,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
L71:
jump T,(RETURNPOINT)
addq #20,FP ; delay slot
;====================
_PM_PointOnLineSide::
;6 dag registers 0 register variables
;localoffset:0 regoffset:16 argoffset:16
;====================
subq #16,FP
move FP,r0 ; &dx
load (FP+4),r1 ; local x
load (FP+6),r2 ; local line
load (r2),r3
load (r3),r3
sub r3,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
move FP,r1
addq #4,r1 ; &dy
load (FP+5),r3 ; local y
load (r2),r4
addq #4,r4
load (r4),r4
sub r4,r3
load (r1),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r3,(r1)
move FP,r3
addq #8,r3 ; &left
move r2,r4
addq #12,r4
load (r4),r4
moveq #16,r5
sha r5,r4
load (r0),r0
sha r5,r0
move r4,MATH_A
movei #L92,MATH_RTS
movei #GPU_IMUL,scratch
jump T,(scratch)
move r0,MATH_B ; delay slot
L92:
move MATH_C,r4
load (r3),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r4,(r3)
move FP,r0
addq #12,r0 ; &right
load (r1),r1
sha r5,r1
addq #8,r2
load (r2),r2
sha r5,r2
move r1,MATH_A
movei #L93,MATH_RTS
movei #GPU_IMUL,scratch
jump T,(scratch)
move r2,MATH_B ; delay slot
L93:
move MATH_C,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
load (r0),r0
load (r3),r1
cmp r0,r1
movei #L90,scratch
jump EQ,(scratch)
nop
jump MI,(scratch)
nop
moveq #0,r0
move r0,RETURNVALUE
movei #L89,r0
jump T,(r0)
nop
L90:
moveq #1,r0
move r0,RETURNVALUE
L89:
jump T,(RETURNPOINT)
addq #16,FP ; delay slot
;====================
_PM_SetThingPosition::
;5 dag registers 0 register variables
;localoffset:0 regoffset:20 argoffset:20
;====================
subq #20,FP
move FP,r0
addq #12,r0 ; &ss
movei #_newsubsec,r1
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
load (FP+5),r0 ; local thing
movei #52,r2
add r2,r0
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
load (FP+5),r0 ; local thing
movei #100,r1
add r1,r0
load (r0),r0
moveq #8,r1
and r1,r0
moveq #0,r1
cmp r0,r1
movei #L95,scratch
jump NE,(scratch)
nop
move FP,r0 ; &sec
load (FP+3),r1 ; local ss
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
load (FP+5),r0 ; local thing
addq #28,r0
moveq #0,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
load (FP+5),r0 ; local thing
addq #24,r0
load (FP),r1 ; local sec
movei #80,r2
add r2,r1
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
load (FP),r0 ; local sec
movei #80,r1
add r1,r0
load (r0),r0
moveq #0,r1
cmp r0,r1
movei #L97,scratch
jump EQ,(scratch)
nop
load (FP),r0 ; local sec
movei #80,r1
add r1,r0
load (r0),r0
addq #28,r0
load (FP+5),r1 ; local thing
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
L97:
load (FP),r0 ; local sec
movei #80,r1
add r1,r0
load (FP+5),r1 ; local thing
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
L95:
load (FP+5),r0 ; local thing
movei #100,r1
add r1,r0
load (r0),r0
moveq #16,r1
and r1,r0
moveq #0,r1
cmp r0,r1
movei #L99,scratch
jump NE,(scratch)
nop
move FP,r0
addq #4,r0 ; &blockx
load (FP+5),r1 ; local thing
move r1,r2
addq #12,r2
load (r2),r2
movei #_bmaporgx,r3
load (r3),r3
sub r3,r2
moveq #23,r3
sha r3,r2
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r2,(r0)
move FP,r2
addq #8,r2 ; &blocky
addq #16,r1
load (r1),r1
movei #_bmaporgy,r4
load (r4),r4
sub r4,r1
sha r3,r1
load (r2),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r2)
load (r0),r0
moveq #0,r1
cmp r0,r1
movei #L101,scratch
jump S_LT,(scratch)
nop
movei #_bmapwidth,r3
load (r3),r3
cmp r0,r3
movei #L101,scratch
jump EQ,(scratch)
nop
jump MI,(scratch)
nop
load (r2),r0
cmp r0,r1
movei #L101,scratch
jump S_LT,(scratch)
nop
movei #_bmapheight,r1
load (r1),r1
cmp r0,r1
movei #L101,scratch
jump EQ,(scratch)
nop
jump MI,(scratch)
nop
move FP,r0
addq #16,r0 ; &link
load (FP+2),r1 ; local blocky
movei #_bmapwidth,r2
load (r2),r2
move r1,MATH_A
movei #L105,MATH_RTS
movei #GPU_IMUL,scratch
jump T,(scratch)
move r2,MATH_B ; delay slot
L105:
move MATH_C,r1
load (FP+1),r2 ; local blockx
add r2,r1
shlq #2,r1
movei #_blocklinks,r2
load (r2),r2
add r2,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
load (FP+5),r0 ; local thing
movei #48,r1
add r1,r0
moveq #0,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
load (FP+5),r0 ; local thing
movei #44,r1
add r1,r0
load (FP+4),r1 ; local link
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
load (FP+4),r0 ; local link
load (r0),r0
moveq #0,r1
cmp r0,r1
movei #L103,scratch
jump EQ,(scratch)
nop
load (FP+4),r0 ; local link
load (r0),r0
movei #48,r1
add r1,r0
load (FP+5),r1 ; local thing
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
L103:
load (FP+4),r0 ; local link
load (FP+5),r1 ; local thing
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #L102,r0
jump T,(r0)
nop
L101:
load (FP+5),r0 ; local thing
movei #48,r1
move r0,r2
add r1,r2
moveq #0,r1
load (r2),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r2)
movei #44,r2
add r2,r0
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
L102:
L99:
L94:
jump T,(RETURNPOINT)
addq #20,FP ; delay slot
;====================
_PM_CheckPosition::
;5 dag registers 6 register variables
;localoffset:8 regoffset:8 argoffset:56
;====================
movei #56,scratch
sub scratch,FP
movei #_tmflags,r0
movei #_tmthing,r1
load (r1),r1
movei #100,r2
move r1,r3
add r2,r3
load (r3),r2
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r2,(r0)
movei #_tmbbox,r0
movei #_tmy,r2
load (r2),r2
movei #64,r3
add r3,r1
load (r1),r3
move r2,r4
add r3,r4
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r4,(r0)
movei #_tmbbox+4,r0
load (r1),r1
sub r1,r2
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r2,(r0)
movei #_tmbbox+12,r0
movei #_tmx,r1
load (r1),r1
movei #_tmthing,r2
load (r2),r2
movei #64,r3
add r3,r2
load (r2),r2
add r2,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmbbox+8,r0
movei #_tmx,r1
load (r1),r1
movei #_tmthing,r2
load (r2),r2
movei #64,r3
add r3,r2
load (r2),r2
sub r2,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmx,r0
load (r0),r0
store r0,(FP) ; arg[]
movei #_tmy,r0
load (r0),r0
or r0,scratch ; scoreboard bug
store r0,(FP+1) ; arg[]
movei #_PM_PointInSubsector,r0
store r28,(FP+2) ; push ;(RETURNPOINT)
store r20,(FP+3) ; push ;(xl)
store r19,(FP+4) ; push ;(yl)
store r18,(FP+5) ; push ;(xh)
store r17,(FP+6) ; push ;(yh)
store r16,(FP+7) ; push ;(bx)
movei #L154,RETURNPOINT
jump T,(r0)
store r15,(FP+8) ; delay slot push ;(by)
L154:
load (FP+3),r20 ; pop ;(xl)
load (FP+4),r19 ; pop ;(yl)
load (FP+5),r18 ; pop ;(xh)
load (FP+6),r17 ; pop ;(yh)
load (FP+7),r16 ; pop ;(bx)
load (FP+8),r15 ; pop ;(by)
load (FP+2), RETURNPOINT ; pop
movei #_newsubsec,r0
move r29,r1 ;(RETURNVALUE)
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmdropoffz,r0
movei #_newsubsec,r1
load (r1),r1
load (r1),r2
load (r2),r2
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r2,(r0)
movei #_tmfloorz,r0
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r2,(r0)
movei #_tmceilingz,r0
load (r1),r1
addq #4,r1
load (r1),r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_validcount,r0
load (r0),r1
addq #1,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_movething,r0
moveq #0,r1
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_blockline,r0
load (r0),r30 ; FUCKING dsp!
or r30,r30 ; FUCKING dsp!
store r1,(r0)
movei #_tmflags,r0
load (r0),r0
movei #4096,r1