-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlens.s
3602 lines (3103 loc) · 67.9 KB
/
lens.s
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
GENERATE_OFFSMAP equ false
GENERATE_EYES equ false
SKIP_LINES_TOP equ 1
SKIP_LINES_BOTTOM equ 2
AFTER_EFFECT_WAITER equ 40
; what we got in detail:
; 0. cinema scope bars opening
; 1. fullscreen 320x200 picture scrolling in vertically from below
; - add elastic bounce?
; 2. lens effect comes in from above
; 3. lens moves around a bit
IFD DEMOSYSTEM
IFD STANDALONE
ELSE
STANDALONE equ 1
ENDC
ELSE
STANDALONE equ 0
ENDC
IFEQ STANDALONE
TRUE equ 0
FALSE equ 1
true equ 0
false equ 1
SHOW_CPU equ 0
USE_MYM_DUMP equ 1
LENS_AFTER_EFFECT_FADEWAITER equ 90
FRAMECOUNT equ 0
loadmusic equ FALSE
PLAYMUSIC equ true
playmusicinvbl equ true
useblitter equ 1
ENDC
incdir gfx
incdir lib
incdir msx
incdir res/smfx
section DATA
include macro.s
IFEQ STANDALONE
initAndRun standalone_init
standalone_init
jsr init_effect
jsr init_lens
rts
init_effect
move.l #membase+65536,d0 ; 1
sub.w d0,d0 ;
move.l d0,screenpointer ;
move.l d0,screen1
add.l #$10000,d0
move.l d0,screenpointer2
move.l d0,screen2
rts
ENDC
herp equ 1500
scrubMem
move.w #herp-1,d7
add.w #(1700-herp)*4,a0
moveq #0,d0
.s
REPT 100
move.l d0,(a0)+
ENDR
dbra d7,.s
rts
init_lens
move.l screen1,a0
jsr scrubMem
jsr initlensPointers
move.l screen1,screenpointer
move.l screen2,screenpointer2
lea flarecrk,a0
move.l directoryPointer,a1
jsr cranker
move.l directoryPointer,a0
move.l a0,d0
sub.l #2,d0
REPT 16
add.l d0,(a0)+
ENDR
; lea directory,a0
; move.l #directory,d0
; sub.l #2,d0
; REPT 16
; add.l d0,(a0)+
; ENDR
; jsr testEye
move.w #0,leftEyeOffset
move.w #0,chunkyEyeOffset
tst.w musicInit
bne .skipMusicInit
IFEQ STANDALONE
IFEQ USE_MYM_DUMP
initMusic musicmyv,musicmys,musicmysend
ENDC
ENDC
move.w #-1,musicInit
.skipMusicInit
IFEQ USE_MYM_DUMP
IFEQ STANDALONE
move.l #.noMusicVBL,$70
lea replayroutine,a0
jsr findEntryAndExitCode
move.w #14*50,d7 ;19600
jsr dumpMymFrames
ENDC
ENDC
IFEQ GENERATE_OFFSMAP
jsr generateOffsetMap ; generate offset map from tga
ELSE
lea offsetsrc,a0
move.l offsetsPointer,a1
jsr cranker
ENDC
; jsr prepAni
jsr unpackExplode
; move.l explodepic_pointer,a0
; add.l #200*160
move.l explodepic_pointer,a0
add.l #200*160+128,a0
; lea explode_pic+128,a0
lea haxEye,a1
add.w #88*160,a0
.y set 11*8
REPT 10
.x set .y
REPT 2
move.l .x(a0),(a1)+
move.l .x+4(a0),(a1)+
.x set .x+8
ENDR
.y set .y+160
ENDR
jsr genScroller
jsr init_explode_scrollin
jsr init_explode_lens_effect
.xx
tst.w _times
bge .xx
; move.w #100,_times
;.y
; wait_for_vbl
; move.l screenpointer2,a0
; move.l a0,usp
; jsr changeBuffer
; subq.w #1,_times
; bge .y
jsr run_explode_lens_effect
move.l screenpointer,a0
move.l screenpointer2,a1
move.w #200-1,d7
moveq #0,d0
.cl
REPT 20
move.l d0,(a0)+
move.l d0,(a0)+
move.l d0,(a1)+
move.l d0,(a1)+
ENDR
dbra d7,.cl
rts
.noMusicVBL
addq.w #1,$466.w
addq.w #1,cummulativeCount
rte
.waitvbls dc.w 80
;;;;;;;;;;;;;;;;;;;; REAL DEMOCODE STARTS HERE
; 19 20 21 22 23
; 17 18 2 3 4 24 25
; 40 16 1 5 6 26
; 39 15 0 7 27
; 38 14 13 9 8 28
; 37 36 12 11 10 30 29
; 35 34 33 32 31
; screenXOff 0..79
; yoffset -62..200
; 262
;
; 8 0-20 21
; 15 21-59 38
; 17 60-100 40
; 20 101-162 63
; 17 162-202 40
; 15 203-241 38
; 8 242-262 21 -->
initlensPointers
move.l screen1,d0
move.l d0,d1
add.l #$8000+5600,d1
move.l d1,leftEyeChunky1Pointer
add.l #9020,d1
move.l d1,leftEyeChunky2Pointer
add.l #9020,d1
add.l #$10000,d0 ; 2
move.l d0,d1
add.l #$8000+5600,d1
move.l d1,rightEyeChunky1Pointer
add.l #9020,d1
move.l d1,rightEyeChunky2Pointer
add.l #9020,d1
move.l d1,animationPointer
add.l #$10000,d0 ; 3
move.l d0,tab1px_1p
move.l d0,d1
add.l #16384,d1
move.l d1,offsetsPointer
add.l #12288,d1
move.l d1,unrolledCodePointer1
add.l #29208,d1 ;7600 left
move.l d1,leftEyeBufferPointer
add.l #7216,d1
add.l #$10000,d0 ; 4
move.l d0,tab1px_2p
move.l d0,d1
add.l #16384,d1
move.l d1,unrolledCodePointer2
add.l #28330+2,d1
move.l d1,scrollerPointer
add.l #8000,d1
add.l #63*2,d1
move.l d1,ytablePointer
add.l #200*2,d1
move.l d1,clearPointer
add.l #800,d1 ;11550 left
move.l d1,rightEyeBufferPointer ;6560
add.l #6560,d1
move.l d1,xPositionTabPointer
add.l #800,d1 ; 4134 left
move.l d1,eyeSpritesPointer
add.l #3000,d1
move.l d1,xeyesYPointer
add.l #600,d1
add.l #$10000,d0 ; 5
move.l d0,tab1px_3p
move.l d0,d1
add.l #16384,d1
move.l d1,leftEyeChunky3Pointer
add.l #9020,d1
move.l d1,rightEyeChunky3Pointer
add.l #9020,d1
move.l d1,canvasPointer
add.l #600,d1
move.l d1,xeyesLeftXPointer
add.l #1200,d1
move.l d1,xeyesRightXPointer
add.l #1200,d1 ; 28112 left
move.l d1,directoryPointer
add.l #12000,d1
move.l d1,rightEyeBufferPointer ;6560
add.l #6560,d1
IFEQ STANDALONE
move.l d1,musicBufferPointer
ENDC
add.l #$18000,d0 ; 6 6*65536 + 354816
move.l d0,explodepic_pointer
add.l #$10000,d0
add.l #$10000,d0
move.l d0,chunkyPicEvenPointer
add.l #118272-28672+4480,d0 ;94080
move.l d0,chunkyPicUnEvenPointer
add.l #118272-28672+4480,d0
move.l d0,chunkyPicUnEvenPointer2
add.l #118272-28672+4480,d0 ; 748032-72576 total
move.w #$4e75,initlensPointers
rts
unpackExplode
lea explode_src,a0
; lea explode_pic,a1
move.l explodepic_pointer,a1
jsr cranker
move.w #$4e75,unpackExplode
rts
xeyesYdefs
dc.b 46
dc.b 42
dc.b 30
dc.b 18
dc.b 30
dc.b 42
dc.b 62 ;600
xeyesLeftXdefs
dc.b 41*2
dc.b 10*2
dc.b 13*2
dc.b 6*2
dc.b 13*2
dc.b 10*2
dc.b 30*2 ;600
xeyesRightXdefs
dc.b 51*2
dc.b 14*2
dc.b 13*2
dc.b 6*2
dc.b 13*2
dc.b 50*2 ;600
even
genxeyesY
move.l xeyesYPointer,a0
moveq #0,d0
moveq #7-1,d7
lea xeyesYdefs,a6
.ol
moveq #0,d6
move.b (a6)+,d6
.il
move.w d0,(a0)+
dbra d6,.il
add.w #14,d0
dbra d7,.ol
move.l xeyesLeftXPointer,a0
moveq #0,d0
lea xeyesLeftXdefs,a6
moveq #7-1,d7
.ol2
moveq #0,d6
move.b (a6)+,d6
.il2
move.w d0,(a0)+
dbra d6,.il2
addq.w #2,d0
dbra d7,.ol2
move.l xeyesRightXPointer,a0
moveq #0,d0
lea xeyesRightXdefs,a6
moveq #7-1,d7
.ol3
moveq #0,d6
move.b (a6)+,d6
.il3
move.w d0,(a0)+
dbra d6,.il3
addq.w #2,d0
dbra d7,.ol3
rts
; 0..79
;
; 8 0-5
; 15 6-17
; 17 18-31
; 20 32-47
; 17 48-61
; 15 62-73
; 8 74-79
; start 48 ==> 80
; end 240
; eye = 140
; 0 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
movementOffsets
dc.w 0, 1, 2, 2, 2, 3, 4
dc.w 5, 6, 7, 8, 9,10,11
dc.w 12,13,14,20,15,16,17
dc.w 18,19,20,20,20,21,22
dc.w 23,24,25,20,26,27,28
dc.w 29,30,31,32,33,34,35
dc.w 36,37,38,38,38,39,40
movementOff dc.w 0
movementLeft
dc.w 7,10 ;0
dc.w 8,10 ;1
dc.w 9,10 ;2
dc.w 10,10 ;3
dc.w 11,10 ;4
dc.w 6,11 ;5
dc.w 7,11 ;6
dc.w 8,11 ;7
dc.w 9,11 ;8
dc.w 10,11 ;9
dc.w 11,11 ;10
dc.w 12,11 ;11
dc.w 6,12 ;12
dc.w 7,12 ;13
dc.w 8,12 ;14
dc.w 10,12 ;15
dc.w 11,12 ;16
dc.w 12,12 ;17
dc.w 6,13 ;18
dc.w 7,13 ;19
dc.w 9,13 ;20
dc.w 11,13 ;21
dc.w 12,13 ;22
dc.w 6,14 ;23
dc.w 7,14 ;24
dc.w 8,14 ;25
dc.w 10,14 ;26
dc.w 11,14 ;27
dc.w 12,14 ;28
dc.w 6,15 ;29
dc.w 7,15 ;30
dc.w 8,15 ;31
dc.w 9,15 ;32
dc.w 10,15 ;33
dc.w 11,15 ;34
dc.w 12,15 ;35
dc.w 7,16 ;36
dc.w 8,16 ;37
dc.w 9,16 ;38
dc.w 10,16 ;39
dc.w 11,16 ;40
init_explode_lens_effect
jsr generatexPositionTab
jsr genUnrolledCode1
jsr genUnrolledCode2
jsr genTables
jsr genClears
jsr calc1pxTab_upper_new
jsr generateChunkyFromPic_new ; generate chunkyPics from picture
lea animation,a0
move.l animationPointer,a1
jsr cranker
IFEQ GENERATE_EYES
jsr prepExplodeEyes
ENDC
jsr genxeyesY
jsr initEyeGenLeft
jsr initEyeGenRight
move.w #0,chunkyEyeOffset
move.w #0,leftEyeOffset
move.w #0,rightEyeOffset
move.w #$4e75,init_explode_lens_effect
rts
logoAnimation
tst.w aniUp
beq .up
move.l usp,a1
add.w #187*160+136,a1
moveq #0,d0
move.l d0,d1
move.l d0,d2
move.l d0,d3
move.l d0,d4
move.l d0,d5
move.w #13-1,d7
.dl
movem.l d0-d5,(a1)
add.w #160,a1
dbra d7,.dl
.up
; lea animation,a0
move.l animationPointer,a0
add.w animationOff,a0
subq.w #1,aniWaiter
bge .okkk
move.w #1,aniWaiter
add.w #3*8*13,animationOff
cmp.w #20*3*8*13,animationOff
bne .okkk
move.w #0,animationOff
.okkk
move.l usp,a1
add.w #(187)*160,a1
move.w aniVertOff,d0
add.w d0,d0 ;2
move.w d0,d1 ;2
add.w d0,d0 ;4
add.w d0,d0 ;8
add.w d0,d1 ;10
jmp .drawCode(pc,d1)
.drawCode
.x set 136
REPT 13
movem.l (a0)+,d0-d5 ;13*6*4 108/60/60 ;4
movem.l d0-d5,.x(a1) ;6 --> 10
.x set .x+160
ENDR
tst.w aniUp
bne .down
subq.w #1,aniVertOffWater
bge .cont
move.w #3,aniVertOffWater
subq.w #2,aniVertOff
bge .cont
move.w #0,aniVertOff
.cont
rts
.down
subq.w #1,aniVertOffWater
bge .cont
move.w #3,aniVertOffWater
addq.w #2,aniVertOff
cmp.w #13,aniVertOff
ble .cont
move.w #13,aniVertOff
rts
aniVertOffWater dc.w 50
aniUp dc.w 0
animationOff dc.w 0
aniWaiter dc.w 2
aniVertOff dc.w 13
fixTopLine
; move.l screenpointer2,a0
subq.w #1,.times
bge .ok
move.w #$4e75,fixTopLine
.ok
move.l usp,a0
moveq #0,d1
move.l d1,d0 ;1
move.l d1,d2 ;2
move.l d1,d3 ;3
move.l d1,d4 ;4
move.l d1,d5 ;5
move.l d1,d6 ;6
move.l d1,d7 ;6
move.l d1,a1 ;7
move.l d1,a2 ;8
move.l d1,a3 ;9
.x set 16
REPT 3
movem.l d0-d7/a1-a3,.x(a0) ;400+36 = 436 ;4*8 = 32 3*11
.x set .x+44
ENDR
rts
.times dc.w 110
movePosition macro
lea spiral,a0
add.w spiralOff,a0
move.w (a0)+,d1
move.w d1,xPosition
move.w (a0)+,d2
move.w d2,yoffset
move.w xPositionOld,d0
sub.w d1,d0
bgt .right
.left
move.w #-1,xdir
jmp .cont2
.right
move.w #1,xdir
.cont2
move.w xdirOld,xdirOlder
move.w xdir,xdirOld
move.w xPosition,xPositionOld
;;---------
move.w yoffsetOld,d0
sub.w d2,d0
bge .up
.down
move.w #1,ydir
jmp .cont
.up
move.w #-1,ydir
.cont
add.w #4,spiralOff
cmp.w #202,yoffset
blt .done
moveq #0,d0
move.w effect_frames,d0
; move.b #0,$ffffc123
move.w #-1,lens_effect_done
move.w #1,aniUp
move.w #40,aniVertOffWater
.done
endm
spiralOff dc.w 0
lens_out_vbl
addq.w #1,$466.w
addq.w #1,cummulativeCount
move.l screenpointer2,$ffff8200
subq.w #1,_times
pushall
clr.b $fffffa1b.w
bset #0,$fffffa07.w
bset #0,$fffffa13.w
move.l #timer_b_cinema,$120 ; schedule timer b to open lower
move.b #1,$fffffa21.w
bclr #3,$fffffa17.w
move.b #8,$fffffa1b.w
IFEQ USE_MYM_DUMP
jsr replayMymDump
ELSE
IFNE STANDALONE
jsr musicPlayer+8
ENDC
ENDC
tst.w lensFadeActive
beq .ok
subq.w #1,fadeDelay
bge .ok
lea lens_fadeTab,a0
add.w lens_fadeOff,a0
movem.l (a0),d0-d7
movem.l d0-d7,$ffff8240
move.w #0,$ffff8240
swap d0
move.w d0,timer_b_cinema+2
subq.w #1,.waiter
bge .ok
move.w #1,.waiter
add.w #16*2,lens_fadeOff
cmp.w #16*2*16,lens_fadeOff
bne .ok
move.w #16*2*15,lens_fadeOff
move.w #0,lensFadeOutDone
.ok
move.l screenpointer2,a0
move.l a0,usp
jsr logoAnimation ; logo animation
tst.w lensFadeActive
bne .skipeye
lea finEyeOffset,a0
add.w finEyesOff,a0
move.w (a0)+,rightEyeOffset
move.w (a0)+,leftEyeOffset
jsr fixEyes
tst.w finEyesOff
bne .nohax
move.l screenpointer2,a0
lea haxEye,a1
add.w #88*160,a0
.yy set 11*8
REPT 10
.xx set .yy
REPT 2
move.l (a1)+,.xx(a0)
move.l (a1)+,.xx+4(a0)
.xx set .xx+8
ENDR
.yy set .yy+160
ENDR
.nohax
subq.w #1,.eyewaiter
bge .skipeye
move.w #7,.eyewaiter
subq.w #4,finEyesOff
bge .skipeye
move.w #0,finEyesOff
.skipeye
swapscreens
popall
rte
.eyewaiter dc.w 25
.waiter dc.w 1
run_explode_lens_effect
move.w #1,ydir
move.w #-62,yoffset
move.w #$2700,sr
move.l #lens_vbl,$70
move.w #$2300,sr
clr.w $466
.mainloop
wait_for_vbl
move.w #0,$ffff8240
addq.w #1,effect_frames
IFEQ SHOW_CPU
move.w #$007,$ffff8240
ENDC
tst.w lens_effect_done
beq .mainloop
move.w #LENS_AFTER_EFFECT_FADEWAITER,_times
; here change to new vbl
move.l #lens_out_vbl,$70
.waiters
wait_for_vbl
jsr init_tunnel_pointers
jsr precalc_tunnel1
tst.w _times
bge .waiters
move.w #-1,lensFadeActive
.fadeout
wait_for_vbl
jsr precalc_tunnel2
tst.w lensFadeOutDone
bne .fadeout
.next
rts
fadeDelay dc.w 32 AFTER_EFFECT_WAITER+90
effect_frames dc.w 0
lensFadeOutDone dc.w -1
lens_effect_done dc.w 0
lensFadeActive dc.w 0
finEyeOffset ;right ;left
dc.w 20*10*16,20*11*16
dc.w 32*10*16,32*11*16
dc.w 38*10*16,38*11*16
finEyesOff
dc.w 8
;38,32;20
lens_fadeTab
dc.w $777,$201,$411,$621,$632,$743,$754,$765,$000,$666,$655,$555,$444,$332,$222,$211
dc.w $777,$312,$522,$732,$743,$754,$765,$776,$111,$666,$766,$666,$555,$443,$333,$322
dc.w $777,$423,$633,$743,$754,$765,$776,$777,$222,$777,$777,$777,$666,$554,$444,$433
dc.w $777,$534,$744,$754,$765,$776,$777,$777,$333,$777,$777,$777,$777,$665,$555,$544
dc.w $777,$645,$755,$765,$776,$777,$777,$777,$444,$777,$777,$777,$777,$776,$666,$655
dc.w $777,$756,$766,$776,$777,$777,$777,$777,$555,$777,$777,$777,$777,$777,$777,$766
dc.w $777,$767,$777,$777,$777,$777,$777,$777,$666,$777,$777,$777,$777,$777,$777,$777
dc.w $777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777
dc.w $777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777
dc.w $777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777
dc.w $777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777
dc.w $777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777
dc.w $777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777
dc.w $777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777
dc.w $777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777
dc.w $777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777,$777
dc.w $766,$766,$766,$766,$766,$766,$766,$766,$766,$766,$766,$766,$766,$766,$766,$766
dc.w $655,$655,$655,$655,$655,$655,$655,$655,$655,$655,$655,$655,$655,$655,$655,$655
dc.w $544,$544,$544,$544,$544,$544,$544,$544,$544,$544,$544,$544,$544,$544,$544,$544
dc.w $433,$433,$433,$433,$433,$433,$433,$433,$433,$433,$433,$433,$433,$433,$433,$433
dc.w $322,$322,$322,$322,$322,$322,$322,$322,$322,$322,$322,$322,$322,$322,$322,$322
dc.w $211,$211,$211,$211,$211,$211,$211,$211,$211,$211,$211,$211,$211,$211,$211,$211
dc.w $100,$100,$100,$100,$100,$100,$100,$100,$100,$100,$100,$100,$100,$100,$100,$100
dc.w $000,$000,$000,$000,$000,$000,$000,$000,$000,$000,$000,$000,$000,$000,$000,$000
lens_fadeOff dc.w 0
xPositionOld dc.w 0
putFlare
move.w xPosition,d0
add.w #12,d0
add.w d0,d0
add.w d0,d0
move.l xPositionTabPointer,a2
add.w d0,a2
and.w #$f*4,d0
; lea directory,a1
move.l directoryPointer,a1
add.w d0,a1
move.l (a1),a0
move.l screenpointer2,a1
move.l a1,usp
add.w (a2),a1
add.w #1760+24,a1
move.w yoffset,d0
move.w d0,d1
lsl.w #5,d0 ;
move.w d0,d2 ;32
add.w d0,d0
add.w d0,d0
add.w d2,d0
add.w d0,a1
jmp (a0)
fixTopBot macro
; now fix top and bottom
; a5 is sorted, we copy 2 lines top and 2 lines below
move.l a5,a1
move.l usp,a2
sub.l a2,a5 ; x and y offset
; lea explode_pic+128,a0
move.l explodepic_pointer,a0
add.l #128+200*160,a0
add.l a5,a0 ; add offset to explode
; now copy stuff, top and bottom
tst.w ydir
blt .boty
.topy
.y set 0
REPT 8
.x set .y
REPT 1
movem.l -160+.x(a0),d0-d7/a2-a5 ; 32 px
movem.l d0-d7/a2-a5,-160+.x(a1)
.x set .x+8
ENDR
.y set .y-160
ENDR
jmp .conty
.boty
.y set -480
REPT 8
.x set .y
REPT 1
movem.l 64*160+.x(a0),d0-d7/a2-a5 ; 32 px
movem.l d0-d7/a2-a5,64*160+.x(a1)
.x set .x+8
ENDR
.y set .y+160
ENDR
.conty
endm
lens_vbl
pushall
addq.w #1,$466.w
addq.w #1,cummulativeCount
move.l screenpointer2,$ffff8200
clr.b $fffffa1b.w
bset #0,$fffffa07.w
bset #0,$fffffa13.w
move.l #timer_b_cinema,$120 ; schedule timer b to open lower
move.b #1,$fffffa21.w
bclr #3,$fffffa17.w
move.b #8,$fffffa1b.w
IFEQ USE_MYM_DUMP
jsr replayMymDump
ELSE
IFNE STANDALONE
jsr musicPlayer+8
ENDC
ENDC
move.l screenpointer2,a0
move.l a0,usp
jsr logoAnimation ; logo animation
tst.w lens_effect_done
bne .skip
jsr restoreThing ; restore the screen
jsr changeBuffer ; change the buffer
jsr c2p_1to1_indirect_offset_upper_highres_optimized_new ; do effect
jsr putFlare
fixTopBot ; because bugs?
movePosition
move.w xPosition,d0
move.l xPositionTabPointer,a0
add.w d0,d0
add.w d0,d0
add.w d0,a0
move.w (a0)+,screenXOff
move.w (a0)+,chunkyMapOffset
jsr fixTopLine ; fix top line
.skip
swapscreens
move.w #$0,$ffff8240 ; set black background
popall
rte
timer_b_cinema
move.w #$777,$ffff8240
clr.b $fffffa1b.w
move.l #timer_b_cinema_bot,$120 ; schedule timer b to open lower
move.b #199,$fffffa21.w
move.b #8,$fffffa1b.w
rte
timer_b_cinema_bot
move.w #0,$ffff8240
clr.b $fffffa1b.w
rte
IFEQ GENERATE_OFFSMAP
generateOffsetMap
lea tga+18,a0 ; this is a 160x100 picture