-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathddegspr.asm
1234 lines (1132 loc) · 24.8 KB
/
ddegspr.asm
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
;
;should be all ega handling routines for the game !
;
cseg segment public 'code'
;put all the sprite routines in here (
extrn pnum:near
public draw_sprtega,undraw_sprtega
public player1_rout,player2_rout,enemy1_rout,roper_rout
public babobo_rout,gabobo_rout
public enemy2_rout,enemy3_rout,enemy4_rout
public make_table
public vgaplayer2_rout,vgaghost_rout,vgaroper_rout
assume cs:cseg, ds:dseg,es:buff_seg
d_scrn_w equ 36 ;144/4
gap equ 6 ;24/4
include ddeqfile
; fuckin ace 8086 programming discovery !!
;rep movs byte ptr es:[si],byte ptr es:[di]
; fuckin ace 8086 programming discovery !!
shift macro
rept 4
rcl bx,1 ;you cannot be serious adc ! why not rcl bx,1
rcr al,1
rcl bx,1
rcr ah,1
rcl bx,1
rcr dl,1
rcl bx,1
rcr dh,1
endm
rcl bx,1 ;???
endm
ega_mac_2 macro
mov al,[bp+8192] ;10?
mov ah,[bp] ;load from screen;10?
stosw ;buffer the screen ! ;10?
and ax,bx ;3
or ax,cx ;2 bit planes at once;3
mov [bp+8192],al ;10
mov [bp],ah ;10
mov al,[bp+24576] ;10
mov ah,[bp+16384] ;load from screen;10
stosw ;buffer the scrn ! ;10
and ax,bx ;3
or ax,dx ;2 bit planes at once;3
mov [bp+24576],al ;10
mov [bp+16384],ah ;10 =112
endm
lowd_planes macro
lodsw
mov dx,ax
;xchg cl,ch
lodsw
xchg ah,dl
xchg al,dh
mov cx,ax
endm ;must change this ?!
lowd_planesf macro
push bx
mov bx,offset flip_tab
lodsw
mov bl,al
mov dl,es:[bx]
mov bl,ah
mov dh,es:[bx]
lodsw
mov bl,al
mov cl,es:[bx]
mov bl,ah
mov ch,es:[bx]
pop bx
mov ax,cx
xchg ch,dl
mov ax,cx
;mov ch,al
;xchg ch,dl
;mov ax,cx
;lodsw ;mov dx,ax ;lodsw ;xchg ah,dl ;mov cx,ax
endm ;must change this ?!
sp_ega_macf macro
; new version that fips the data first then saves to screen
lowd_planesf
;flip_data
or ax,dx
or al,ah
mov bl,al
mov bh,bl
not bx
ega_mac_2
endm
cmask macro
mov bx,cx
or bx,dx
or bl,bh
mov bh,bl
not bx
endm
;simple non-recolouring routine
sp_ega_mac macro ;a subrotuine ?!?!? never!!
;put a byte of ega sprite onto dummy
;
lowd_planes
or ax,dx
or al,ah
mov bl,al
mov bh,bl
not bx
ega_mac_2
endm
;
; player 2 recolouring code.
;
; r-ch g-cl b-dh i-dl
; Change --bi hmm could do --b- to r--- all blues to reds?
; to r--i
; grey pl2 means --b- to ---i
sp_ega_macc2 macro ;recolours blue into red (eventually!)
lowd_planes
;not al ;assumes ax=cx/dx contain colour data
;not dh ; ignore the al?
;and ax,dx
;and al,ah ;and off all planes
;not dh ;restore the notting !
; hmmm it isnt quite as easy as this is it? yellow=? g/b
;xor dl,dh ;change these bits ;good grief?
;xor dh,dh ;for 0011 to 1001 want 0010 to 0001 ?
not dx
not al
and ax,dx
and al,ah ;created the mask thing
not dx ;restore!
xor dl,al ;swap intensity
xor ch,al ;swap blue
mov ax,cx
not dh
not al
and ax,dx
and al,ah
not dh
xor cl,al
xor dl,al
xor dh,al ; christ thats a lot
cmask
ega_mac_2
endm
recol_babobo macro ; make this the ghost !!
; changes colours to magenta
; at first just the blue to magenta.
not al
not dh
and ah,dh
and al,ah
not dh
xor dh,al
endm
recol_roper macro
; do the blue to green recolour !
; recolour all blue to greens.??
not al
not dh
and ah,dh ;ignore dl ! ie intensity.
and al,ah ;chooses er dark blue
xor cl,al
xor ch,al
not dh ;mistake city !
; that should be it
endm
;not al ;red
;not dh ;green
;and ax,dx
;and al,ah ;and off all planes
;not dh ;restore the notting !
;xor ch,al ;change these bits
;xor cl,al ;for 1001 to 0101
;bgri to
;mov ax,cx
;not ah
;and ax,dx
;and al,ah ;this for changing yellow to grey
;xor cl,al
;xor dh,al
recol_vgapl2 macro
; blues to greys
;
mov ax,dx
not cl
and ah,cl
and al,ah
not cl
xor dh,al
xor cl,al
; that should be it
endm
sp_ega_maccvg3 macro ;recolours blue into GREEN and yellow to grey
;put a byte of ega sprite onto dummy for roper !
;may not use pop !!!!!
; r-ch g-cl b-dh i-dl
;
; Change r--i
; to -g-i
lowd_planes
recol_vgapl2
cmask
ega_mac_2
endm
sp_ega_macc3 macro ;recolours blue into GREEN and yellow to grey
;put a byte of ega sprite onto dummy for roper !
;may not use pop !!!!!
; r-ch g-cl b-dh i-dl
;
; Change r--i
; to -g-i
lowd_planes
recol_roper
cmask
ega_mac_2
endm
recol_vgaghost macro
; do the blue to green recolour !
; recolour all blue to greens.??
mov ax,dx
not cl
and ah,cl
and al,ah
not cl
xor dh,al
xor cl,al
; that should be it
endm
sp_ega_maccvg4 macro ;recolours blue into GREEN and yellow to grey
;put a byte of ega sprite onto dummy for roper !
;may not use pop !!!!!
; r-ch g-cl b-dh i-dl
;
; Change r--i
; to -g-i
lowd_planes
recol_vgaghost
cmask
ega_mac_2
endm
recol_vgaroper macro
; 110x to 100x brill recolour this !
mov ax,dx
not cl
and al,cl
and al,ah
not cl
xor dh,al
; that should be it
endm
sp_ega_maccvg5 macro ;recolours blue into GREEN and yellow to grey
;put a byte of ega sprite onto dummy for roper !
;may not use pop !!!!!
; r-ch g-cl b-dh i-dl
;
; Change r--i
; to -g-i
lowd_planes
recol_vgaroper
cmask
ega_mac_2
endm
sp_ega_macc4 macro ;recolours blue into red (eventually!)
;put a byte of ega sprite onto dummy
;may not use pop !!!!!
; r-ch äg-cl b-dh i-dl
;
; Change r--i
; to -g-i
lowd_planes
recol_babobo
cmask
ega_mac_2
endm
recol_gabobo macro
;recolour routine for black abobo
;now bright red to dark grey dl 1 rest 0
;bgri
not ax ;
and al,ah ;skip the intenstity !
and al,dh ;select ANY red
;change to equiv green.
xor cl,al ;swap green (put to one )
xor dh,al ;kill the red implies light black
;change white dark grey
; b-cl g-ch r-dh i-dl
; 1111 to 1110
mov ax,cx
and ax,dx
and al,ah
xor cl,al
xor ch,al
xor dh,al
endm
sp_ega_macc5 macro ;recolours for green abobo
;put a byte of ega sprite onto dummy
;may not use pop !!!!!
; r-ch g-cl b-dh i-dl
;
; Change r--i
; to -g-i
lowd_planes
recol_gabobo
cmask
ega_mac_2
endm
make_table:
; make the flip table
push ds
push es
mov ax,seg flip_tab
mov es,ax
mov cx,0
mov ax,offset flip_tab
mov di,ax ;big waste of memory to make sure on boundary
cld
mk_lp:
mov ah,cl
rept 8
shl ah,1
rcr al,1
endm
stosb
inc cx
cmp cx,256
jne mk_lp
pop es
pop ds
ret
flip_spr:
; Sprite version no recolouring and no shifting
; BUT that flips the sprite horizontally
; oh good grief
push bp
push cx
push dx
push di
push bx
push ds
mov ax,ss_save
mov ds,ax ;ds is the sprite data dippo !
mov di,offset new_spr ;4k for the sprite ?
; use di=buff-area ?
;destination of new sprite.
mov bx,offset flip_tab ;try this one !
mov es:spr_rows,dx
mov bp,cx
shl bp,1
shl bp,1 ;4 bytes per x col
row_lp:
add di,bp ;move to right of this row ?!
push cx
byte_lp:
sub di,4
lodsw
mov bl,al
mov al,es:[bx]
mov bl,ah
mov ah,es:[bx]
mov es:[di],ax
lodsw
mov bl,al
mov al,es:[bx]
mov bl,ah
mov ah,es:[bx]
mov es:[di+2],ax
loop byte_lp
pop cx
add di,bp ;make up for last times subtractions ?!?
dec es:spr_rows
jne row_lp
pop ds
mov ax,seg new_spr
mov ss_save,ax
mov si,offset new_spr ;will it ever work ??
pop bx
pop di
pop dx
pop cx
pop bp
;mov si,di ; the sprite is in save area (hmm is that feasable?)
ret
draw_sprtega:
mov di, offset sprt_x
movsw
movsw
movsw
movsw
movsw
movsw
movsw
push si
;si is pointer to sprite data table (why is it pushed).
;1 get a screen_addr
push es
mov bled_bkgd_ptr,48000 ;dummy value for no spr
;mov si,person_on ;my setup doesnt use si
;mov al,byte ptr [si+4]
;mov ddd,al
call setup_sprt
jNc Noff
JMP OFFSCREEN
NOFF:
MOV bled_bkgd_ptr,di ;save for restbackground.
mov bp,di ;this is WRONG !
and bp,8191
MOV di,save_ptr
MOV si,data_ptr ;get sprite data addr
MOV DX,sprt_rows
MOV CX,sprt_cols
MOV AX,SEG SAVE_AREA
MOV ES,AX
mov word ptr ES:[shftflg],0 ;set up for shifting routine.
mov bx,colr_map ;in ega should be addr of spriterout
cmp bx,offset player1_rout
je zz1
cmp bx,offset player2_rout
je zz1
cmp bx,offset roper_rout
je zz1
cmp bx,offset babobo_rout ; for ghosts !
je zz1
cmp bx,offset vgaplayer2_rout
je zz1
cmp bx,offset vgaroper_rout
je zz1
cmp bx,offset vgaghost_rout
je zz1
;cmp bx,offset gabobo_rout
;je zz1
mov bx,offset player1_rout ;dam I'd forgot this !
zz1:
;cmp bx,offset player1_rout
;jne okei ;frigg for the moment only shift for player1
;if shifted sprt_cols must be increased.
test word ptr sprt_x,1 ;odd or even byte
jz okei
add sprt_cols,2 ;hmmmm
mov word ptr ES:[shftflg],1 ;set up for shifting routine.
okei:
inc cx ;
shr cx,1 ;
; ******************************
; cx=sprt_cols | dx=row_loop
; ******************************
test flip_dir,left ;direction,left
jz no_flip
;
call flip_spr
no_flip:
mov ax,ss_save
mov ds,ax ;ds is the sprite data dippo !
MOV ES:[sp_cols],CX ;sprt_cols variable !
MOV ES:[rw_loop],DX ;row_loop counter
mov dx,d_scrn_w
sub DX,CX
border 8+2
; use bx thats been set earlier on !
jmp bx ;always use player_rout
player1_rout:
cmp word ptr Es:[shftflg],1
jne nshif
jmp shiftrout
nshif:
MOV ES:[dl_var],DX
;cmp word ptr es:[flip_flg],1
;jne nflip ;christ sake !?
;jmp flip_rout
nflip:
ROW_LOOP:
MOV ax,ES:[sp_cols] ;sprt_cols
or ax,ax
jne nt
border 15
nt:
mov es:[col_lp],ax
COL_LOOP:
sp_ega_mac ;long winded !
inc bp
and bp,8191 ;move and WRAP
dec word ptr es:[col_lp] ;loop COL_LOOP
jne col_loop ;interesting why crash ?
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JNE ROW_LOOP ;inefficient or what !
mov ax,seg dseg
mov ds,ax
offscreen:
POP ES
pop di
MOV AX,SEG DSEG
MOV DS,AX
mov ax,sprt_x ;store for rebuffing
mov bled_x,ax
mov si,offset bled_x
mov cx,9
rep movsw
ret
shiftrout:
;the player 1 shift routine
MOV ES:[dl_var],DX
ROW_LOOPs: MOV CX,ES:[sp_cols] ;sprt_cols
mov Es:[sh_cntr],cx ;put into loop counter
mov word ptr Es:[shiftn],0 ;blank the shift in
COL_LOOPs: lodsw
mov dx,ax
lodsw ;shift here using
xchg al,dh
xchg ah,dl
mov bx,Es:[shiftn] ;the shift thingy
clc
shift
;bx is the 4 pixels in 4 planes of shift
mov Es:[shiftn],bx
mov cx,ax
or ax,dx
or al,ah
mov bl,al
mov bh,bl
not bx
ega_mac_2
inc bp
and bp,8191 ;move and WRAP !
dec word ptr Es:[sh_cntr]
je skipjump
jmp col_loops
skipjump:
;the data here should be that which was shifted out from earlier
mov bx,Es:[shiftn] ;the shift thingy
xor ax,ax
mov dx,ax ;zero as all data here is shifted in.
; clc ;should have been cleared by the zor
shift ;shifts from bx into al/h and dl/h
;bx is the 4 pixels in 4 planes of shift
; mov Es:[shiftn],bx ;dont bother
;mov ax,cx
mov cx,ax
or ax,dx
or al,ah
mov bl,al
mov bh,bl
not bx
ega_mac_2
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JE nrolp ;ROW_LOOPs inefficient or what !
jmp row_loops
nrolp: mov ax,seg dseg
mov ds,ax
jmp offscreen
; *****************************************************
; *****************************************************
player2_rout:
cmp word ptr ES:[shftflg],1
jp_e shiftrout2
MOV ES:[dl_var],DX
ROW_LOOP2: MOV CX,ES:[sp_cols] ;sprt_cols
COL_LOOP2:
push cx
sp_ega_macc2 ;long winded !
inc bp
and bp,8191 ;move and WRAP !
pop cx
LOOP COL_LOOP2
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JNE ROW_LOOP2 ;inefficient or what !
mov ax,seg dseg
mov ds,ax
jmp offscreen
; *****************************************************
shiftrout2: MOV ES:[dl_var],DX
ROW_LOOPs2: MOV CX,ES:[sp_cols] ;sprt_cols
mov ES:[sh_cntr],cx ;put into loop counter
mov word ptr ES:[shiftn],0 ;blank the shift in
COL_LOOPs2: lodsw
mov dx,ax
lodsw ;shift here using
xchg al,dh ; this just copied from other piece
xchg ah,dl ;
mov bx,ES:[shiftn] ;the shift thingy
clc
shift
;bx is the 4 pixels in 4 planes of shift
mov ES:[shiftn],bx
mov cx,ax
; not al ;assumes ax=cx/dx contain colour data
; not dh
; and ax,dx
; and al,ah ;and off all planes
; not dh ;restore the notting !
; xor ch,al ;change these bits
; xor dh,al ;for 0011 to 1001
not dx
not al
and ax,dx
and al,ah ;created the mask thing
not dx ;restore!
xor dl,al ;swap intensity
xor ch,al ;swap blue
mov ax,cx
not dh
not al
and ax,dx
and al,ah
not dh
xor cl,al
xor dl,al
xor dh,al ; christ thats a lot
cmask ;create mask macro
ega_mac_2
inc bp
and bp,8191 ;move and WRAP !
dec word ptr ES:[sh_cntr]
je skipjump2
jmp col_loops2
skipjump2:
;the data here should be that which was shifted out from earlier
mov bx,ES:[shiftn] ;the shift thingy
xor ax,ax
mov dx,ax ;zero as all data here is shifted in.
; clc ;should have been cleared by the zor
shift ;shifts from bx into al/h and dl/h
;bx is the 4 pixels in 4 planes of shift
; mov ES:[shiftn],bx ;dont bother
;mov ax,cx
mov cx,ax
not al ;assumes ax=cx/dx contain colour data
not dh
and ax,dx
and al,ah ;and off all planes
not dh ;restore the notting !
xor ch,al ;change these bits
xor dh,al ;for 0011 to 1001
cmask ;create mask macro
ega_mac_2
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JE nrolp2 ;ROW_LOOPs inefficient or what !
jmp row_loops2
nrolp2: mov ax,seg dseg
mov ds,ax
jmp offscreen
; *****************************************************
enemy1_rout:
roper_rout: ;a recolouring routine for a badguy (recolour white to red?)
cmp word ptr ES:[shftflg],1
je shiftrout3 ;DELETEDJune 19, 1989 caused bug 7:55 PM August 27, 1989
MOV ES:[dl_var],DX
ROW_LOOP3: MOV CX,ES:[sp_cols] ;sprt_cols
COL_LOOP3:
push cx
sp_ega_macc3 ;long winded !
inc bp
and bp,8191 ;move and WRAP !
pop cx
LOOP COL_LOOP3
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JNE ROW_LOOP3 ;inefficient or what !
mov ax,seg dseg
mov ds,ax
jmp offscreen
shiftrout3: MOV ES:[dl_var],DX
ROW_LOOPs3: MOV CX,ES:[sp_cols] ;sprt_cols
mov ES:[sh_cntr],cx ;put into loop counter
mov word ptr ES:[shiftn],0 ;blank the shift in
COL_LOOPs3: lodsw
mov dx,ax
lodsw ;shift here using
xchg al,dh ; this just copied from other piece
xchg ah,dl ;
mov bx,ES:[shiftn] ;the shift thingy
clc
shift
mov ES:[shiftn],bx
mov cx,ax
recol_roper
cmask ;create mask macro
ega_mac_2
inc bp
and bp,8191 ;move and WRAP !
dec word ptr ES:[sh_cntr]
je skipjump3
jmp col_loops3
skipjump3:
mov bx,ES:[shiftn] ;the shift thingy
xor ax,ax
mov dx,ax ;zero as all data here is shifted in.
shift ;shifts from bx into al/h and dl/h
mov cx,ax
recol_roper
cmask ;create mask macro
ega_mac_2
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JE nrolp3 ;ROW_LOOPs inefficient or what !
jmp row_loops3
nrolp3: mov ax,seg dseg
mov ds,ax
jmp offscreen
vgaghost_rout:
vgaplayer2_rout:
cmp word ptr ES:[shftflg],1
je shiftroutvg4
MOV ES:[dl_var],DX
ROW_LOOPvg4: MOV CX,ES:[sp_cols] ;sprt_cols
COL_LOOPvg4:
push cx
sp_ega_maccvg4 ;long winded !
inc bp
and bp,8191 ;move and WRAP !
pop cx
LOOP COL_LOOPvg4
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JNE ROW_LOOPvg4 ;inefficient or what !
mov ax,seg dseg
mov ds,ax
jmp offscreen
shiftroutvg4: MOV ES:[dl_var],DX
ROW_LOOPsvg4: MOV CX,ES:[sp_cols] ;sprt_cols
mov ES:[sh_cntr],cx ;put into loop counter
mov word ptr ES:[shiftn],0 ;blank the shift in
COL_LOOPsvg4: lodsw
mov dx,ax
lodsw ;shift here using
xchg al,dh ; this just copied from other piece
xchg ah,dl ;
mov bx,ES:[shiftn] ;the shift thingy
clc
shift
mov ES:[shiftn],bx
mov cx,ax
recol_vgaghost
cmask ;create mask macro
ega_mac_2
inc bp
and bp,8191 ;move and WRAP !
dec word ptr ES:[sh_cntr]
je skipjumpvg4
jmp col_loopsvg4
skipjumpvg4:
mov bx,ES:[shiftn] ;the shift thingy
xor ax,ax
mov dx,ax ;zero as all data here is shifted in.
shift ;shifts from bx into al/h and dl/h
mov cx,ax
recol_vgaghost
cmask ;create mask macro
ega_mac_2
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JE nrolpvg4 ;ROW_LOOPs inefficient or what !
jmp row_loopsvg4
nrolpvg4: mov ax,seg dseg
mov ds,ax
jmp offscreen
vgaroper_rout:
cmp word ptr ES:[shftflg],1
je shiftroutvg5
MOV ES:[dl_var],DX
ROW_LOOPvg5: MOV CX,ES:[sp_cols] ;sprt_cols
COL_LOOPvg5:
push cx
sp_ega_maccvg5 ;long winded !
inc bp
and bp,8191 ;move and WRAP !
pop cx
LOOP COL_LOOPvg5
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JNE ROW_LOOPvg5 ;inefficient or what !
mov ax,seg dseg
mov ds,ax
jmp offscreen
shiftroutvg5: MOV ES:[dl_var],DX
ROW_LOOPsvg5: MOV CX,ES:[sp_cols] ;sprt_cols
mov ES:[sh_cntr],cx ;put into loop counter
mov word ptr ES:[shiftn],0 ;blank the shift in
COL_LOOPsvg5: lodsw
mov dx,ax
lodsw ;shift here using
xchg al,dh ; this just copied from other piece
xchg ah,dl ;
mov bx,ES:[shiftn] ;the shift thingy
clc
shift
mov ES:[shiftn],bx
mov cx,ax
recol_vgaroper
cmask ;create mask macro
ega_mac_2
inc bp
and bp,8191 ;move and WRAP !
dec word ptr ES:[sh_cntr]
je skipjumpvg5
jmp col_loopsvg5
skipjumpvg5:
mov bx,ES:[shiftn] ;the shift thingy
xor ax,ax
mov dx,ax ;zero as all data here is shifted in.
shift ;shifts from bx into al/h and dl/h
mov cx,ax
recol_vgaroper
cmask ;create mask macro
ega_mac_2
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JE nrolpvg5 ;ROW_LOOPs inefficient or what !
jmp row_loopsvg5
nrolpvg5: mov ax,seg dseg
mov ds,ax
jmp offscreen
;vgaplayer2_rout:
; a new recolour routine
; jeez needs much more fucking code as well !
cmp word ptr ES:[shftflg],1
je shiftroutvg3
MOV ES:[dl_var],DX
ROW_LOOPvg3: MOV CX,ES:[sp_cols] ;sprt_cols
COL_LOOPvg3:
push cx
sp_ega_maccvg3 ;long winded !
inc bp
and bp,8191 ;move and WRAP !
pop cx
LOOP COL_LOOPvg3
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JNE ROW_LOOPvg3 ;inefficient or what !
mov ax,seg dseg
mov ds,ax
jmp offscreen
shiftroutvg3: MOV ES:[dl_var],DX
ROW_LOOPsvg3: MOV CX,ES:[sp_cols] ;sprt_cols
mov ES:[sh_cntr],cx ;put into loop counter
mov word ptr ES:[shiftn],0 ;blank the shift in
COL_LOOPsvg3: lodsw
mov dx,ax
lodsw ;shift here using
xchg al,dh ; this just copied from other piece
xchg ah,dl ;
mov bx,ES:[shiftn] ;the shift thingy
clc
shift
mov ES:[shiftn],bx
mov cx,ax
recol_vgapl2
cmask ;create mask macro
ega_mac_2
inc bp
and bp,8191 ;move and WRAP !
dec word ptr ES:[sh_cntr]
je skipjumpvg3
jmp col_loopsvg3
skipjumpvg3:
mov bx,ES:[shiftn] ;the shift thingy
xor ax,ax
mov dx,ax ;zero as all data here is shifted in.
shift ;shifts from bx into al/h and dl/h
mov cx,ax
recol_vgapl2
cmask ;create mask macro
ega_mac_2
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JE nrolpvg3 ;ROW_LOOPs inefficient or what !
jmp row_loopsvg3
nrolpvg3: mov ax,seg dseg
mov ds,ax
jmp offscreen
enemy4_rout:
enemy3_rout:
enemy2_rout:
babobo_rout: ;abobo becomes BLACK or rather dark red ?
cmp word ptr ES:[shftflg],1
je shiftrout4
MOV ES:[dl_var],DX
ROW_LOOP4: MOV CX,ES:[sp_cols] ;sprt_cols
COL_LOOP4:
push cx
sp_ega_macc4 ;long winded !
inc bp
and bp,8191 ;move and WRAP !
pop cx
LOOP COL_LOOP4
add bp,ES:[dl_var] ;back due to words alr mved
and bp,8191
DEC WORD PTR ES:[rw_loop] ;inefficient or what !
JNE ROW_LOOP4 ;inefficient or what !
mov ax,seg dseg
mov ds,ax
jmp offscreen
shiftrout4: MOV ES:[dl_var],DX
ROW_LOOPs4: MOV CX,ES:[sp_cols] ;sprt_cols
mov ES:[sh_cntr],cx ;put into loop counter
mov word ptr ES:[shiftn],0 ;blank the shift in
COL_LOOPs4: lodsw
mov dx,ax
lodsw ;shift here using
xchg al,dh ; this just copied from other piece
xchg ah,dl ;
mov bx,ES:[shiftn] ;the shift thingy
clc
shift
mov ES:[shiftn],bx
mov cx,ax
recol_babobo
cmask