/[projet1]/users/chema/Blakes7/Sources/auxiliar.s
Defence Force logotype

Contents of /users/chema/Blakes7/Sources/auxiliar.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1460 - (show annotations)
Mon Apr 9 01:09:49 2018 UTC (18 months, 1 week ago) by laurentd75
File size: 26446 byte(s)
svn commit -m "BLAKES7_v1.3-RC1_laurentd75: 
* Added French translation/version for the game
+ French version of the Blakes 7 font
+ corrections to Spanish and English text 
+ new osdk_build_for_lang.bat script to automatically generate language.h for the target language passed in as an argument or defined in the B7_LANG environment variable (valid values: ENGLISH, SPANISH, FRENCH)

1
2
3 #define via_portb $0300
4 #define via_porta $0300
5 #define via_ddrb $0302
6 #define via_ddra $0303
7 #define via_t1cl $0304
8 #define via_t1ch $0305
9 #define via_t1ll $0306
10 #define via_t1lh $0307
11 #define via_t2ll $0308
12 #define via_t2lh $0309
13 #define via_sr $030A
14 #define via_acr $030b
15 #define via_pcr $030c
16 #define via_ifr $030D
17 #define via_ier $030E
18 #define via_porta $030f
19
20 #define via_bit_t1 6
21 #define via_irq_t1 (1<<via_bit_t1)
22 #define via_mask_t1 ($7f ^ via_irq_t1)
23
24
25 //#define USE_VSYNC_AUTO_TEXT
26
27 #define A_TEXT60 24
28 #define A_TEXT50 26
29 #define A_HIRES60 28
30 #define A_HIRES50 30
31
32
33 #ifdef USE_VSYNC_AUTO_TEXT
34 #define A_50HZ A_TEXT50
35 #define A_60HZ A_TEXT60
36 #define line_adr(x) $bb80+(5*x)
37 #else
38 #define A_50HZ A_HIRES50
39 #define A_60HZ A_HIRES60
40 #define line_adr(x) $a000+(40*x)
41 #endif
42
43 #include "params.h"
44 #include "language.h"
45
46 *=$2000
47
48 jsr _GenerateExtraTables
49 jsr _SequenceDefenceForceLogo
50 DetectIJK
51 php
52 sei
53 ;ensure printer strobe is set to output
54 lda #%10110111
55 sta via_ddrb
56
57 ;set strobe low
58 lda #%00000000
59 sta via_portb
60
61 ;set top two bits of porta to output and rest as input
62 lda #%11000000
63 sta via_ddra
64 ;lda #%11000000
65 sta via_porta
66
67 lda via_porta
68 and #%00100000
69 beq ijkPresent
70 ; IJK Joystick is not present
71 lda #0
72 beq storeijkflag
73 ijkPresent
74 ; Copy bit table to $bfe0 (32 bytes)
75 .(
76 ldx #31
77 loop
78 lda GenericIJKBits,x
79 sta $bfe0,x
80 dex
81 bpl loop
82 .)
83 ; Store flag indicating IJK is present
84 lda #1
85 storeijkflag
86 sta $0100
87
88 ;restore via porta state
89 lda #%11111111
90 sta via_ddra
91 plp
92 cli
93
94 #ifdef LOADING_MSG
95 lda #<loading_msg
96 sta $0101
97 lda #>loading_msg
98 sta $0102
99 #endif
100
101
102 _vsync_auto
103 php
104 sei
105 tya
106 pha
107
108 ; Setup DDRA, DDRB and ACR
109 lda #%11111111
110 sta via_ddra
111 lda #%11110111 ; PB0-2 outputs, PB3 input.
112 sta via_ddrb
113 lda #%1000000
114 sta via_acr
115
116
117 ; start T1 with 50Hz period
118 lda _isr_period
119 sta via_t1cl
120 lda _isr_period+1
121 sta via_t1ch
122
123 ; establish 50Hz graphics mode
124 lda #A_50HZ
125 sta line_adr(0)
126
127 ; wait at least a frame
128 .(
129 ldx #4
130 lda #via_irq_t1
131 wait
132 bit via_ifr
133 beq wait
134 bit via_t1cl
135 dex
136 bne wait
137 .)
138
139 ; write 60Hz to line address 0, wait 7168 cycles (112 lines)
140 __1
141 .(
142 lda #A_60HZ
143 sta line_adr(0)
144
145 ldy #5
146 wait_y
147 ldx #0
148 wait_x
149 dex
150 bne wait_x
151 dey
152 bne wait_y
153
154 ldx #146
155 wait_xx
156 dex
157 bne wait_xx
158 .)
159 __11
160
161
162 ; write 50Hz to line address 0, wait 16896 cycles (264 lines)
163 __2
164 .(
165 lda #A_50HZ
166 sta line_adr(0)
167
168 ldy #13
169 wait_y
170 ldx #0
171 wait_x
172 dex
173 bne wait_x
174 dey
175 bne wait_y
176
177 ldx #34
178 wait_xx
179 dex
180 bne wait_xx
181 .)
182 __21
183
184
185 ; write 60Hz to line address 0, wait 7168 cycles (112 lines)
186 __3
187 .(
188 lda #A_60HZ
189 sta line_adr(0)
190
191 ldy #5
192 wait_y
193 ldx #0
194 wait_x
195 dex
196 bne wait_x
197 dey
198 bne wait_y
199
200 ldx #146
201 wait_xx
202 dex
203 bne wait_xx
204 .)
205 __31
206
207
208 ; write 50Hz to line address 0, wait 16896 cycles (264 lines)
209 __4
210 .(
211 lda #A_50HZ
212 sta line_adr(0)
213
214 ldy #13
215 wait_y
216 ldx #0
217 wait_x
218 dex
219 bne wait_x
220 dey
221 bne wait_y
222
223 ldx #34
224 wait_xx
225 dex
226 bne wait_xx
227 .)
228 __41
229
230 ; (you have now eliminated lines 200..311 as possibilities, pushing anyone that was there into 0..111)
231
232 ; write 60Hz to line address 48, wait 3072 cycles (48 lines)
233 __5
234 .(
235 lda #A_60HZ
236 sta line_adr(48)
237
238 ldy #2
239 wait_y
240 ldx #0
241 wait_x
242 dex
243 bne wait_x
244 dey
245 bne wait_y
246
247 ldx #98
248 wait_xx
249 dex
250 bne wait_xx
251 nop
252 .)
253 __51
254
255
256 ; write 50Hz to line address 48, wait 16896 cycles (264 lines)
257 __6
258 .(
259 lda #A_50HZ
260 sta line_adr(48)
261
262 ldy #13
263 wait_y
264 ldx #0
265 wait_x
266 dex
267 bne wait_x
268 dey
269 bne wait_y
270
271 ldx #34
272 wait_xx
273 dex
274 bne wait_xx
275 .)
276 __61
277
278 ; (you have now also eliminated lines 0..47 as possibilities)
279
280 ; write 60Hz to line address 96, wait 3072 cycles (48 lines)
281 __7
282 .(
283 lda #A_60HZ
284 sta line_adr(96)
285
286 ldy #2
287 wait_y
288 ldx #0
289 wait_x
290 dex
291 bne wait_x
292 dey
293 bne wait_y
294
295 ldx #98
296 wait_xx
297 dex
298 bne wait_xx
299 nop
300 .)
301 __71
302
303 ; write 50Hz to line address 96, wait 16896 cycles (264 lines)
304 __8
305 .(
306 lda #A_50HZ
307 sta line_adr(96)
308
309 ldy #13
310 wait_y
311 ldx #0
312 wait_x
313 dex
314 bne wait_x
315 dey
316 bne wait_y
317
318 ldx #34
319 wait_xx
320 dex
321 bne wait_xx
322 .)
323 __81
324
325
326 ; (you have now also eliminated lines 48..95 as possibilities)
327
328 ; write 60Hz to line address 144, wait 3072 cycles (48 lines)
329 __9
330 .(
331 lda #A_60HZ
332 sta line_adr(144)
333
334 ldy #2
335 wait_y
336 ldx #0
337 wait_x
338 dex
339 bne wait_x
340 dey
341 bne wait_y
342
343 ldx #98
344 wait_xx
345 dex
346 bne wait_xx
347 nop
348 .)
349 __91
350
351
352 ; write 50Hz to line address 144, wait 16896 cycles (264 lines)
353 __A
354 .(
355 lda #A_50HZ
356 sta line_adr(144)
357
358 ldy #13
359 wait_y
360 ldx #0
361 wait_x
362 dex
363 bne wait_x
364 dey
365 bne wait_y
366
367 ldx #34
368 wait_xx
369 dex
370 bne wait_xx
371 .)
372 __A1
373
374
375 ; (you have now also eliminated lines 96..143 as possibilities, put potentially repopulated the range 200..207 (?))
376
377 ; write 60Hz to line address 200, wait 3072 cycles (48 lines)
378 __B
379 .(
380 lda #A_60HZ
381 sta line_adr(200)
382
383 ldy #2
384 wait_y
385 ldx #0
386 wait_x
387 dex
388 bne wait_x
389 dey
390 bne wait_y
391
392 ldx #98
393 wait_xx
394 dex
395 bne wait_xx
396 nop
397 .)
398 __B1
399
400
401 ; write 50Hz to line address 200, wait 16896 cycles (264 lines)
402 __C
403 .(
404 lda #A_50HZ
405 sta line_adr(200)
406
407 ldy #13
408 wait_y
409 ldx #0
410 wait_x
411 dex
412 bne wait_x
413 dey
414 bne wait_y
415
416 ldx #34
417 wait_xx
418 dex
419 bne wait_xx
420 .)
421 __C1
422
423 ; (you have now eliminated [pixel parts of] lines 144..199 as possibilities, but repopulated 208..251 (?))
424 ; start a 19968 cycle period interrupt timer.
425 lda _isr_period
426 sta via_t1cl
427 lda _isr_period+1
428 sta via_t1ch
429
430 pla
431 tay
432 plp
433
434 rts
435
436 _isr_period .word 19966
437
438 GenericIJKBits
439 .byt 0,2,1,3,32,34,33,0,8,10,9,0,40,42,41,0
440 .byt 16,18,17,0,48,50,49,0,0,0,0,0,0,0,0,0
441
442
443 #ifdef LOADING_MSG
444 ; Loading strings
445
446 loading_msg
447 #ifdef ENGLISH
448 .asc A_FWMAGENTA+A_FWCYAN*8+128,"V1.3- Loading game data.. please wait",0
449 #endif
450
451 #ifdef SPANISH
452 .asc A_FWMAGENTA+A_FWCYAN*8+128,"V1.3- Cargando el juego... un segundo",0
453 #endif
454
455 #ifdef FRENCH
456 .asc A_FWMAGENTA+A_FWCYAN*8+128,"V1.3- Chargement du jeu... Patientez",0
457 #endif
458
459 #ifdef IJK_SUPPORT
460 Joy_msg
461 #ifdef ENGLISH
462 .asc A_FWMAGENTA+A_FWCYAN*8+128,"IJK Joystick detected.",0
463 #endif
464
465 #ifdef SPANISH
466 .asc A_FWMAGENTA+A_FWCYAN*8+128,"Detectado joystick IJK",0
467 #endif
468
469 #ifdef FRENCH
470 .asc A_FWMAGENTA+A_FWCYAN*8+128,"Joystick IJK d","Z"+2,"tect","Z"+2,". ",0 ; "Joystick IJK détecté. "
471 #endif
472
473 #endif
474
475 #endif
476
477
478 /***********************************************/
479
480
481 _TableMod6 .dsb 256
482 _TableDiv6b .dsb 256
483
484 .zero
485 *=0
486 tmp0 .dsb 2
487 tmp1 .dsb 2
488 tmp2 .dsb 2
489 tmp3 .dsb 2
490 tmp4 .dsb 2
491 tmp5 .dsb 2
492 tmp6 .dsb 2
493 tmp7 .dsb 2
494 op1 .dsb 2
495 op2 .dsb 2
496 tmp .dsb 2
497 reg0 .dsb 2
498 reg1 .dsb 2
499 reg2 .dsb 2
500
501 .text
502
503 ; Packed source data adress
504 #define ptr_source tmp0
505
506 ; Destination adress where we depack
507 #define ptr_destination tmp1
508
509 ; Point on the end of the depacked stuff
510 #define ptr_destination_end tmp2
511
512 ; Temporary used to hold a pointer on depacked stuff
513 #define ptr_source_back tmp3
514
515 ; Temporary
516 #define offset tmp4
517
518 #define mask_value reg0
519 #define nb_src reg1
520 #define nb_dst reg2
521
522
523 _SequenceDefenceForceLogo
524 .(
525 ;jsr _clr_all
526
527 lda #<_BufferUnpack
528 sta ptr_destination
529 lda #>_BufferUnpack
530 sta ptr_destination+1
531 lda #<_LabelPictureDefenceForce
532 sta ptr_source
533 lda #>_LabelPictureDefenceForce
534 sta ptr_source+1
535
536 jsr _FileUnpack
537
538
539 jsr _DisplayPaperSet
540 jsr _DisplayMakeShiftedLogos
541 jsr _DisplayDefenceForceFrame
542
543 lda #150
544 sta tmp5
545 loop
546 jsr _DisplayScrappIt
547 dec tmp5
548 bne loop
549
550 ;jmp _clr_all
551 ;rts
552 .)
553
554 _clr_all
555 .(
556 lda #<$a000
557 sta tmp
558 lda #>$a000
559 sta tmp+1
560
561 lda #200
562 sta tmp0
563 loop2
564 ldy #39
565 lda #$40
566 loop
567 sta (tmp),y
568 dey
569 bpl loop
570
571 lda tmp
572 clc
573 adc #40
574 sta tmp
575 bcc nocarry
576 inc tmp+1
577 nocarry
578 dec tmp0
579 bne loop2
580
581 rts
582 .)
583
584
585
586
587
588 #define ADDR_LOGO $a000+40*60
589 #define ADDR_LOGO_LETTERS $a000+40*71+5
590
591 #define _BufferUnpackTemp _BufferUnpack
592
593 _LabelPicture1 = _BufferUnpackTemp+2010*1
594 _LabelPicture2 = _BufferUnpackTemp+2010*2
595 _LabelPicture3 = _BufferUnpackTemp+2010*3
596 _LabelPicture4 = _BufferUnpackTemp+2010*4
597 _LabelPicture5 = _BufferUnpackTemp+2010*5
598
599
600 TempX .byt 0
601 TempY .byt 0
602 TempOffset .byt 0
603 TempColor .byt 0
604
605 DiplayAngle1 .byt 0
606 DiplayAngle2 .byt 0
607 DisplayPosX .byt 0
608 DisplayMemoX .byt 0
609
610 OldByte .byt 0
611 blablabla .byt 0
612
613 ; Non signed values, from 0 to 255
614 _CosTable ; Used by the DF logo
615 .byt 254
616 .byt 253
617 .byt 253
618 .byt 253
619 .byt 253
620 .byt 253
621 .byt 252
622 .byt 252
623 .byt 251
624 .byt 250
625 .byt 250
626 .byt 249
627 .byt 248
628 .byt 247
629 .byt 246
630 .byt 245
631 .byt 244
632 .byt 243
633 .byt 241
634 .byt 240
635 .byt 239
636 .byt 237
637 .byt 235
638 .byt 234
639 .byt 232
640 .byt 230
641 .byt 229
642 .byt 227
643 .byt 225
644 .byt 223
645 .byt 221
646 .byt 218
647 .byt 216
648 .byt 214
649 .byt 212
650 .byt 209
651 .byt 207
652 .byt 205
653 .byt 202
654 .byt 200
655 .byt 197
656 .byt 194
657 .byt 192
658 .byt 189
659 .byt 186
660 .byt 184
661 .byt 181
662 .byt 178
663 .byt 175
664 .byt 172
665 .byt 169
666 .byt 166
667 .byt 163
668 .byt 160
669 .byt 157
670 .byt 154
671 .byt 151
672 .byt 148
673 .byt 145
674 .byt 142
675 .byt 139
676 .byt 136
677 .byt 133
678 .byt 130
679 .byt 127
680 .byt 124
681 .byt 121
682 .byt 118
683 .byt 115
684 .byt 112
685 .byt 109
686 .byt 106
687 .byt 103
688 .byt 100
689 .byt 97
690 .byt 94
691 .byt 91
692 .byt 88
693 .byt 85
694 .byt 82
695 .byt 79
696 .byt 76
697 .byt 73
698 .byt 70
699 .byt 68
700 .byt 65
701 .byt 62
702 .byt 60
703 .byt 57
704 .byt 54
705 .byt 52
706 .byt 49
707 .byt 47
708 .byt 45
709 .byt 42
710 .byt 40
711 .byt 38
712 .byt 36
713 .byt 33
714 .byt 31
715 .byt 29
716 .byt 27
717 .byt 25
718 .byt 24
719 .byt 22
720 .byt 20
721 .byt 19
722 .byt 17
723 .byt 15
724 .byt 14
725 .byt 13
726 .byt 11
727 .byt 10
728 .byt 9
729 .byt 8
730 .byt 7
731 .byt 6
732 .byt 5
733 .byt 4
734 .byt 4
735 .byt 3
736 .byt 2
737 .byt 2
738 .byt 1
739 .byt 1
740 .byt 1
741 .byt 1
742 .byt 1
743 .byt 0
744 .byt 1
745 .byt 1
746 .byt 1
747 .byt 1
748 .byt 1
749 .byt 2
750 .byt 2
751 .byt 3
752 .byt 4
753 .byt 4
754 .byt 5
755 .byt 6
756 .byt 7
757 .byt 8
758 .byt 9
759 .byt 10
760 .byt 11
761 .byt 13
762 .byt 14
763 .byt 15
764 .byt 17
765 .byt 19
766 .byt 20
767 .byt 22
768 .byt 24
769 .byt 25
770 .byt 27
771 .byt 29
772 .byt 31
773 .byt 33
774 .byt 36
775 .byt 38
776 .byt 40
777 .byt 42
778 .byt 45
779 .byt 47
780 .byt 49
781 .byt 52
782 .byt 54
783 .byt 57
784 .byt 60
785 .byt 62
786 .byt 65
787 .byt 68
788 .byt 70
789 .byt 73
790 .byt 76
791 .byt 79
792 .byt 82
793 .byt 85
794 .byt 88
795 .byt 91
796 .byt 94
797 .byt 97
798 .byt 100
799 .byt 103
800 .byt 106
801 .byt 109
802 .byt 112
803 .byt 115
804 .byt 118
805 .byt 121
806 .byt 124
807 .byt 127
808 .byt 130
809 .byt 133
810 .byt 136
811 .byt 139
812 .byt 142
813 .byt 145
814 .byt 148
815 .byt 151
816 .byt 154
817 .byt 157
818 .byt 160
819 .byt 163
820 .byt 166
821 .byt 169
822 .byt 172
823 .byt 175
824 .byt 178
825 .byt 181
826 .byt 184
827 .byt 186
828 .byt 189
829 .byt 192
830 .byt 194
831 .byt 197
832 .byt 200
833 .byt 202
834 .byt 205
835 .byt 207
836 .byt 209
837 .byt 212
838 .byt 214
839 .byt 216
840 .byt 218
841 .byt 221
842 .byt 223
843 .byt 225
844 .byt 227
845 .byt 229
846 .byt 230
847 .byt 232
848 .byt 234
849 .byt 235
850 .byt 237
851 .byt 239
852 .byt 240
853 .byt 241
854 .byt 243
855 .byt 244
856 .byt 245
857 .byt 246
858 .byt 247
859 .byt 248
860 .byt 249
861 .byt 250
862 .byt 250
863 .byt 251
864 .byt 252
865 .byt 252
866 .byt 253
867 .byt 253
868 .byt 253
869 .byt 253
870 .byt 253
871
872 DisplayParamBlackFrameTop
873 .byt 10 ; Count
874 .byt 2 ,64+1+2 ; Black pixels
875 .byt 2+40,64+1+2 ; Black pixels
876 .byt 3 ,16+0 ; Black paper
877 .byt 3+40,16+0 ; Black paper
878 .byt 36 ,0 ; Black ink
879 .byt 36+40 ,0 ; Black ink
880 .byt 37 ,64+1+2 ; Black pixels
881 .byt 37+40,64+1+2 ; Black pixels
882 .byt 38 ,16+7 ; White paper
883 .byt 38+40,16+7 ; White paper
884
885 DisplayParamBlueFrame
886 .byt 12
887 .byt 2 ,64+1+2 ; Black pixels
888 .byt 2+40 ,64+1+2 ; Black pixels
889 .byt 3 ,16+4 ; Blue paper
890 .byt 3+40 ,16+6 ; Cyan paper
891 .byt 4 ,3 ; Yellow ink
892 .byt 4+40 ,1 ; Red ink
893 .byt 36 ,0 ; Black ink
894 .byt 36+40 ,0 ; Black ink
895 .byt 37 ,64+1+2 ; Black pixels
896 .byt 37+40,64+1+2 ; Black pixels
897 .byt 38 ,16+7 ; White paper
898 .byt 38+40,16+7 ; White paper
899
900 DisplayParamBlueFrameShadow
901 .byt 14
902 .byt 2 ,64+1+2 ; Black pixels
903 .byt 2+40 ,64+1+2 ; Black pixels
904 .byt 3 ,16+4 ; Blue paper
905 .byt 3+40 ,16+6 ; Cyan paper
906 .byt 4 ,3 ; Yellow ink
907 .byt 4+40 ,1 ; Red ink
908 .byt 36 ,0 ; Black ink
909 .byt 36+40 ,0 ; Black ink
910 .byt 37 ,64+1+2 ; Black pixels
911 .byt 37+40,64+1+2 ; Black pixels
912 .byt 38 ,16+0 ; Black paper
913 .byt 38+40,16+0 ; Black paper
914 .byt 39 ,16+7 ; White paper
915 .byt 39+40,16+7 ; White paper
916
917 DisplayParamBlackFrameBottom
918 .byt 12 ; Count
919 .byt 2 ,64+1+2 ; Black pixels
920 .byt 2+40,64+1+2 ; Black pixels
921 .byt 3 ,16+0 ; Black paper
922 .byt 3+40,16+0 ; Black paper
923 .byt 36 ,0 ; Black ink
924 .byt 36+40 ,0 ; Black ink
925 .byt 37 ,64+1+2 ; Black pixels
926 .byt 37+40,64+1+2 ; Black pixels
927 .byt 38 ,16+0 ; Black paper
928 .byt 38+40,16+0 ; Black paper
929 .byt 39 ,16+7 ; White paper
930 .byt 39+40,16+7 ; White paper
931
932 DisplayParamBlackFrameBottomShadow
933 .byt 6 ; Count
934 .byt 4 ,16+0 ; Black paper
935 .byt 4+40,16+0 ; Black paper
936 .byt 38 ,16+0 ; Black paper
937 .byt 38+40,16+0 ; Black paper
938 .byt 39 ,16+7 ; White paper
939 .byt 39+40,16+7 ; White paper
940
941
942
943 DisplayNextLine
944 clc
945 lda tmp1
946 adc #80
947 sta tmp1
948 bcc skip_display_rasters
949 inc tmp1+1
950 skip_display_rasters
951 rts
952
953
954
955 DisplayScanLine
956 stx TempX
957
958 LoopDisplayScanLineOuter
959 ldy #0
960 lda (tmp0),y
961 iny
962 tax
963
964 LoopDisplayScanLine
965 lda (tmp0),y // Get offset
966 sta TempOffset
967 iny
968 lda (tmp0),y // Get color
969 sta TempColor
970 iny
971 sty TempY
972
973 ldy TempOffset
974 lda TempColor
975 sta (tmp1),y
976
977 ldy TempY
978
979 dex
980 bne LoopDisplayScanLine
981
982 jsr DisplayNextLine
983
984 dec TempX
985 bne LoopDisplayScanLineOuter
986
987 rts
988
989
990
991 _DisplayDefenceForceFrame
992 lda #<ADDR_LOGO
993 sta tmp1+0
994 lda #>ADDR_LOGO
995 sta tmp1+1
996
997 ;
998 lda #<DisplayParamBlackFrameTop
999 sta tmp0+0
1000 lda #>DisplayParamBlackFrameTop
1001 sta tmp0+1
1002
1003 ldx #1
1004 jsr DisplayScanLine
1005
1006 ;
1007 lda #<DisplayParamBlueFrame
1008 sta tmp0+0
1009 lda #>DisplayParamBlueFrame
1010 sta tmp0+1
1011
1012 ldx #3
1013 jsr DisplayScanLine
1014
1015 ;
1016 lda #<DisplayParamBlueFrameShadow
1017 sta tmp0+0
1018 lda #>DisplayParamBlueFrameShadow
1019 sta tmp0+1
1020
1021 ldx #40
1022 jsr DisplayScanLine
1023
1024 ;
1025 lda #<DisplayParamBlackFrameBottom
1026 sta tmp0+0
1027 lda #>DisplayParamBlackFrameBottom
1028 sta tmp0+1
1029
1030 ldx #1
1031 jsr DisplayScanLine
1032
1033 ;
1034 lda #<DisplayParamBlackFrameBottomShadow
1035 sta tmp0+0
1036 lda #>DisplayParamBlackFrameBottomShadow
1037 sta tmp0+1
1038
1039 ldx #3
1040 jsr DisplayScanLine
1041
1042 rts
1043
1044
1045
1046
1047
1048
1049 DisplayMakeShiftedLogo
1050 ldx #67
1051 LoopDisplayMakeShiftedLogo_Y
1052
1053 lda #0
1054 sta OldByte
1055 ldy #0
1056 LoopDisplayMakeShiftedLogo_X
1057 lda (tmp0),y
1058 sta blablabla
1059 ;pha
1060 and #63
1061 lsr
1062 ora OldByte
1063 ora #64
1064 sta (tmp1),y
1065
1066 lda blablabla
1067 ;pla
1068 and #1
1069 asl
1070 asl
1071 asl
1072 asl
1073 asl
1074 sta OldByte
1075
1076 iny
1077 cpy #30
1078 bne LoopDisplayMakeShiftedLogo_X
1079
1080 clc
1081 lda tmp0
1082 adc #30
1083 sta tmp0
1084 bcc skip_src
1085 inc tmp0+1
1086 clc
1087 skip_src
1088
1089 lda tmp1
1090 adc #30
1091 sta tmp1
1092 bcc skip_dst
1093 inc tmp1+1
1094 skip_dst
1095
1096 dex
1097 bne LoopDisplayMakeShiftedLogo_Y
1098 rts
1099
1100
1101 _DisplayMakeShiftedLogos
1102 ; 0
1103 lda #<_BufferUnpackTemp
1104 sta tmp0
1105 lda #>_BufferUnpackTemp
1106 sta tmp0+1
1107 lda #<_LabelPicture1
1108 sta tmp1
1109 lda #>_LabelPicture1
1110 sta tmp1+1
1111 jsr DisplayMakeShiftedLogo
1112
1113 ; 1
1114 lda #<_LabelPicture1
1115 sta tmp0
1116 lda #>_LabelPicture1
1117 sta tmp0+1
1118 lda #<_LabelPicture2
1119 sta tmp1
1120 lda #>_LabelPicture2
1121 sta tmp1+1
1122 jsr DisplayMakeShiftedLogo
1123
1124 ; 2
1125 lda #<_LabelPicture2
1126 sta tmp0
1127 lda #>_LabelPicture2
1128 sta tmp0+1
1129 lda #<_LabelPicture3
1130 sta tmp1
1131 lda #>_LabelPicture3
1132 sta tmp1+1
1133 jsr DisplayMakeShiftedLogo
1134
1135 ; 3
1136 lda #<_LabelPicture3
1137 sta tmp0
1138 lda #>_LabelPicture3
1139 sta tmp0+1
1140 lda #<_LabelPicture4
1141 sta tmp1
1142 lda #>_LabelPicture4
1143 sta tmp1+1
1144 jsr DisplayMakeShiftedLogo
1145
1146 ; 4
1147 lda #<_LabelPicture4
1148 sta tmp0
1149 lda #>_LabelPicture4
1150 sta tmp0+1
1151 lda #<_LabelPicture5
1152 sta tmp1
1153 lda #>_LabelPicture5
1154 sta tmp1+1
1155 jsr DisplayMakeShiftedLogo
1156 rts
1157
1158
1159 DisplayTableLogoLow
1160 .byt <_BufferUnpackTemp
1161 .byt <_LabelPicture1
1162 .byt <_LabelPicture2
1163 .byt <_LabelPicture3
1164 .byt <_LabelPicture4
1165 .byt <_LabelPicture5
1166
1167 DisplayTableLogoHigh
1168 .byt >_BufferUnpackTemp
1169 .byt >_LabelPicture1
1170 .byt >_LabelPicture2
1171 .byt >_LabelPicture3
1172 .byt >_LabelPicture4
1173 .byt >_LabelPicture5
1174
1175
1176
1177 _DisplayScrappIt
1178 clc
1179 lda DiplayAngle1
1180 sta tmp4
1181 adc #2
1182 sta DiplayAngle1
1183
1184 clc
1185 lda DiplayAngle2
1186 sta reg1
1187 adc #5
1188 sta DiplayAngle2
1189
1190 ; Offset source
1191 lda #<0
1192 sta tmp0
1193 lda #>0
1194 sta tmp0+1
1195
1196 ; Screen address
1197 lda #<ADDR_LOGO_LETTERS
1198 sta tmp1
1199 lda #>ADDR_LOGO_LETTERS
1200 sta tmp1+1
1201
1202 ldx #67
1203 LoopDisplayScrappItY
1204 stx DisplayMemoX
1205
1206 ; pos_x=(int)CosTable[angle_1];
1207 ; pos_x+=(int)CosTable[angle_2];
1208 ; pos_x=(pos_x*12)/(256*2);
1209 clc
1210 ldx tmp4
1211 lda _CosTable,x
1212 ldx reg1
1213 adc _CosTable,x
1214 tax
1215
1216 ; Increment angles
1217 inc tmp4
1218
1219 clc
1220 lda reg1
1221 adc #5
1222 sta reg1
1223
1224 ; Compute src adress
1225 lda _TableMod6,x
1226 tay
1227 clc
1228 lda DisplayTableLogoLow,y
1229 adc tmp0
1230 sta tmp2
1231 lda DisplayTableLogoHigh,y
1232 adc tmp0+1
1233 sta tmp2+1
1234
1235
1236 ; Compute dst adress
1237 clc
1238 lda _TableDiv6b,x
1239 adc tmp1
1240 sta tmp3
1241 lda tmp1+1
1242 adc #0
1243 sta tmp3+1
1244
1245 ldy #0
1246 LoopDisplayScrappItX
1247 lda (tmp2),y
1248 sta (tmp3),y
1249 iny
1250
1251 lda (tmp2),y
1252 sta (tmp3),y
1253 iny
1254
1255 lda (tmp2),y
1256 sta (tmp3),y
1257 iny
1258
1259 lda (tmp2),y
1260 sta (tmp3),y
1261 iny
1262
1263 lda (tmp2),y
1264 sta (tmp3),y
1265 iny
1266
1267 lda (tmp2),y
1268 sta (tmp3),y
1269 iny
1270
1271 lda (tmp2),y
1272 sta (tmp3),y
1273 iny
1274
1275 lda (tmp2),y
1276 sta (tmp3),y
1277 iny
1278
1279 lda (tmp2),y
1280 sta (tmp3),y
1281 iny
1282
1283 lda (tmp2),y
1284 sta (tmp3),y
1285 iny
1286
1287 cpy #30
1288 bne LoopDisplayScrappItX
1289
1290 clc
1291 lda tmp0
1292 adc #30
1293 sta tmp0
1294 bcc display_skip_src
1295 inc tmp0+1
1296 clc
1297 display_skip_src
1298
1299 lda tmp1
1300 adc #40
1301 sta tmp1
1302 bcc display_skip_dst
1303 inc tmp1+1
1304 display_skip_dst
1305
1306 ldx DisplayMemoX
1307
1308 dex
1309 beq DisplayScrappItYEnd
1310 jmp LoopDisplayScrappItY
1311
1312 DisplayScrappItYEnd
1313 rts
1314
1315
1316 _DisplayPaperSet
1317 lda #$00
1318 sta tmp0
1319 lda #$a0
1320 sta tmp0+1
1321
1322 ldx #200
1323 LoopDisplayPaperSet
1324 ldy #0
1325 lda #16+7
1326 sta (tmp0),y
1327 iny
1328 lda #0
1329 sta (tmp0),y
1330
1331 lda tmp0
1332 clc
1333 adc #40
1334 sta tmp0
1335 bcc skipbla
1336 inc tmp0+1
1337 skipbla
1338
1339 dex
1340 bne LoopDisplayPaperSet
1341 rts
1342
1343
1344 _GenerateExtraTables
1345 .(
1346
1347 .(
1348 ; Cosine table
1349 ldx #0
1350 loop
1351 clc
1352 lda _CosTable,x
1353 adc _CosTable,x
1354 sta reg0+0 ; x2
1355 lda #0
1356 adc #0 ; Just to get the carry
1357 sta reg0+1
1358
1359 clc
1360 lda reg0+0
1361 adc reg0+0
1362 sta reg1+0 ; x4
1363 lda reg0+1
1364 adc reg0+1
1365 sta reg1+1 ; x4
1366
1367 clc
1368 lda reg0+0
1369 adc reg1+0
1370 sta reg1+0 ; x6
1371 lda reg0+1
1372 adc reg1+1
1373 sta reg1+1 ; x6
1374
1375 lda reg1+1
1376 sta _CosTable,x
1377 inx
1378 bne loop
1379
1380 .)
1381
1382 ; Generate multiple of 6 data table
1383 .(
1384 lda #0 ; cur div
1385 tay ; cur mod
1386 tax
1387 loop
1388 sta _TableDiv6b,x
1389 pha
1390 tya
1391 sta _TableMod6,x
1392 pla
1393 iny
1394 cpy #6
1395 bne skip_mod
1396 ldy #0
1397 adc #0 ; carry = 1!
1398 skip_mod
1399
1400 inx
1401 bne loop
1402 .)
1403
1404 rts
1405 .)
1406
1407 _FileUnpack
1408 .(
1409
1410 ; Get the unpacked size, and add it to the destination
1411 ; adress in order to get the end adress.
1412 ldy #4
1413 clc
1414 lda ptr_destination
1415 adc (ptr_source),y
1416 sta ptr_destination_end+0
1417 iny
1418 lda ptr_destination+1
1419 adc (ptr_source),y
1420 sta ptr_destination_end+1
1421
1422
1423 ; Move the source pointer ahead to point on packed data (+0)
1424 clc
1425 lda ptr_source
1426 adc #8
1427 sta ptr_source
1428 lda ptr_source+1
1429 adc #0
1430 sta ptr_source+1
1431
1432
1433 ; Initialise variables
1434 ; We try to keep "y" null during all the code,
1435 ; so the block copy routine has to be sure that
1436 ; y is null on exit
1437 ldy #0
1438 lda #1
1439 sta mask_value
1440
1441 unpack_loop
1442 ; Handle bit mask
1443 lsr mask_value
1444 bne end_reload_mask
1445
1446 ; Read from source stream
1447 lda (ptr_source),y
1448
1449 .(
1450 ; Move stream pointer (one byte)
1451 inc ptr_source
1452 bne skip
1453 inc ptr_source+1
1454 skip
1455 .)
1456 ror
1457 sta mask_value
1458 end_reload_mask
1459 bcc back_copy
1460
1461 write_byte
1462 ; Copy one byte from the source stream
1463 lda (ptr_source),y
1464 sta (ptr_destination),y
1465
1466 .(
1467 ; Move stream pointer (one byte)
1468 inc ptr_source
1469 bne skip
1470 inc ptr_source+1
1471 skip
1472 .)
1473
1474 lda #1
1475 sta nb_dst
1476
1477
1478
1479 _UnpackEndLoop
1480 ;// We increase the current destination pointer,
1481 ;// by a given value, white checking if we reach
1482 ;// the end of the buffer.
1483 clc
1484 lda ptr_destination
1485 adc nb_dst
1486 sta ptr_destination
1487
1488 .(
1489 bcc skip
1490 inc ptr_destination+1
1491 skip
1492 .)
1493 cmp ptr_destination_end
1494 lda ptr_destination+1
1495 sbc ptr_destination_end+1
1496 bcc unpack_loop
1497 rts
1498
1499
1500 back_copy
1501 ;BreakPoint jmp BreakPoint
1502 ; Copy a number of bytes from the already unpacked stream
1503 ; Here we know that y is null. So no need for clearing it.
1504 ; Just be sure it's still null at the end.
1505 ; At this point, the source pointer points to a two byte
1506 ; value that actually contains a 4 bits counter, and a
1507 ; 12 bit offset to point back into the depacked stream.
1508 ; The counter is in the 4 high order bits.
1509 ;clc <== No need, since we access this routie from a BCC
1510 lda (ptr_source),y
1511 adc #1
1512 sta offset
1513 iny
1514 lda (ptr_source),y
1515 tax
1516 and #$0f
1517 adc #0
1518 sta offset+1
1519
1520 txa
1521 lsr
1522 lsr
1523 lsr
1524 lsr
1525 clc
1526 adc #3
1527 sta nb_dst
1528
1529 sec
1530 lda ptr_destination
1531 sbc offset
1532 sta ptr_source_back
1533 lda ptr_destination+1
1534 sbc offset+1
1535 sta ptr_source_back+1
1536
1537 ; Beware, in that loop, the direction is important
1538 ; since RLE like depacking is done by recopying the
1539 ; very same byte just copied... Do not make it a
1540 ; reverse loop to achieve some speed gain...
1541 ; Y was equal to 1 after the offset computation,
1542 ; a simple decrement is ok to make it null again.
1543 dey
1544 .(
1545 copy_loop
1546 lda (ptr_source_back),y ; Read from already unpacked stream
1547 sta (ptr_destination),y ; Write to destination buffer
1548 iny
1549 cpy nb_dst
1550 bne copy_loop
1551 .)
1552 ldy #0
1553
1554 ;// C=1 here
1555 lda ptr_source
1556 adc #1
1557 sta ptr_source
1558 bcc _UnpackEndLoop
1559 inc ptr_source+1
1560 bne _UnpackEndLoop
1561 rts
1562 .)
1563
1564
1565
1566
1567
1568 _LabelPictureDefenceForce
1569 .byt $4c,$5a,$37,$37,$da,$07,$4b,$03,$d9,$40,$00,$f0,$0e,$00,$41,$78
1570 .byt $13,$30,$4f,$7f,$ff,$7c,$40,$41,$7f,$7f,$7e,$47,$7f,$ff,$7f,$78
1571 .byt $5f,$7f,$7f,$61,$7e,$40,$7f,$43,$7e,$40,$40,$5f,$7f,$60,$10,$10
1572 .byt $fd,$40,$15,$00,$40,$40,$7f,$7f,$7f,$43,$ff,$7f,$7f,$7c,$4f,$7f
1573 .byt $7f,$70,$7f,$97,$70,$43,$7f,$2e,$10,$78,$10,$10,$3b,$00,$7f,$79
1574 .byt $70,$0c,$10,$3b,$00,$60,$5f,$7f,$7e,$52,$00,$a9,$43,$02,$00,$4c
1575 .byt $30,$60,$3b,$10,$78,$3b,$a0,$7c,$90,$3b,$00,$66,$00,$4c,$20,$3b
1576 .byt $10,$7c,$3b,$90,$77,$00,$78,$4f,$40,$4f,$7c,$43,$77,$10,$3b,$20
1577 .byt $7f,$77,$a0,$e1,$7e,$77,$00,$9e,$00,$42,$00,$77,$10,$60,$41,$7e
1578 .byt $3f,$41,$7c,$40,$40,$47,$70,$a9,$00,$ca,$00,$43,$7f,$60,$77,$00
1579 .byt $a8,$00,$10,$20,$62,$20,$60,$b3,$90,$63,$7f,$63,$4b,$20,$ba,$00
1580 .byt $3b,$20,$40,$7c,$3b,$a0,$47,$70,$43,$78,$4b,$10,$3b,$40,$a3,$00
1581 .byt $70,$bb,$00,$7a,$03,$11,$4f,$21,$01,$7f,$7f,$73,$7f,$22,$00,$79
1582 .byt $40,$14,$21,$77,$e0,$7d,$78,$4b,$78,$f1,$00,$ae,$3b,$60,$41,$7f
1583 .byt $78,$2b,$31,$78,$77,$30,$7f,$f2,$3b,$00,$60,$3b,$00,$77,$40,$7e
1584 .byt $41,$7d,$7f,$f7,$7c,$47,$77,$2b,$01,$5f,$7f,$41,$7c,$af,$7e,$47
1585 .byt $78,$43,$ae,$20,$77,$5f,$00,$47,$03,$7c,$40,$3b,$e0,$69,$01,$3b
1586 .byt $70,$85,$00,$67,$21,$99,$01,$0e,$fa,$00,$7f,$43,$78,$ea,$50,$67
1587 .byt $01,$3b,$f0,$3b,$d0,$8e,$2b,$81,$7c,$5f,$73,$3b,$40,$ef,$30,$3b
1588 .byt $f0,$41,$9c,$77,$90,$67,$a1,$7c,$4f,$79,$ef,$c0,$2b,$a1,$67,$f4
1589 .byt $ef,$50,$2b,$31,$43,$67,$a1,$7c,$43,$7e,$78,$d5,$43,$67,$81,$47
1590 .byt $67,$b1,$61,$ef,$11,$78,$41,$95,$60,$67,$31,$63,$0a,$00,$7c,$93
1591 .byt $02,$df,$11,$4f,$fb,$7f,$61,$58,$11,$40,$7e,$5e,$47,$40,$03,$47
1592 .byt $73,$93,$32,$1b,$32,$a3,$11,$93,$12,$ec,$01,$1b,$12,$8e,$93,$42
1593 .byt $6f,$7f,$60,$93,$22,$1b,$12,$2b,$11,$40,$43,$5f,$78,$39,$12,$2b
1594 .byt $41,$e9,$02,$3b,$b0,$4f,$93,$22,$50,$5e,$02,$cf,$22,$0b,$23,$3b
1595 .byt $80,$47,$25,$03,$5f,$3b,$70,$94,$cf,$32,$77,$60,$47,$3b,$80,$48
1596 .byt $53,$13,$66,$03,$44,$0a,$6a,$03,$50,$0a,$20,$43,$74,$33,$10,$10
1597 .byt $29,$13,$65,$13,$9b,$7f,$47,$5b,$23,$7f,$71,$a3,$10,$58,$13,$70
1598 .byt $00,$76,$03,$7c,$12,$00,$f0,$00,$f0,$00,$f0,$00,$f0,$00,$f0,$00
1599 .byt $f0,$00,$00,$f0,$00,$f0,$00,$f0,$00,$f0,$d0,$20,$19,$03,$84,$03
1600 .byt $ee,$13,$00,$f8,$03,$0c,$14,$27,$13,$2a,$30,$1d,$20,$3c,$01,$4c
1601 .byt $04,$6b,$04,$21,$47,$67,$04,$2f,$20,$3b,$60,$2a,$24,$70,$5d,$04
1602 .byt $c9,$03,$00,$2a,$23,$26,$10,$3b,$80,$47,$13,$b9,$21,$80,$14,$d0
1603 .byt $13,$3b,$a0,$36,$0c,$14,$40,$7e,$6f,$24,$67,$78,$3b,$e0,$c9,$04
1604 .byt $05,$7e,$2f,$14,$60,$b8,$04,$48,$24,$f6,$64,$36,$04,$e0,$02,$3e
1605 .byt $a7,$04,$7e,$40,$5c,$40,$4f,$40,$04,$fc,$23,$18,$b3,$90,$b7,$13
1606 .byt $ce,$04,$7f,$70,$a2,$14,$3b,$d0,$c2,$12,$a1,$5c,$3b,$00,$5d,$00
1607 .byt $4d,$40,$ef,$70,$60,$4d,$24,$7f,$17,$70,$5f,$71,$4a,$05,$7c,$05
1608 .byt $02,$fc,$13,$77,$80,$00,$ae,$04,$e6,$04,$ea,$14,$4c,$14,$77,$c0
1609 .byt $e0,$14,$8b,$03,$c7,$12,$e4,$07,$21,$2b,$91,$7d,$62,$05,$47,$04
1610 .byt $5f,$40,$7e,$41,$5f,$bb,$24,$11,$10,$35,$72,$bc,$15,$ae,$14,$7c
1611 .byt $b3,$10,$34,$ab,$14,$67,$c1,$70,$f2,$04,$40,$5f,$11,$05,$e7,$34
1612 .byt $44,$67,$c1,$3b,$70,$60,$ae,$20,$2b,$c1,$3b,$10,$4f,$60,$13,$80
1613 .byt $77,$30,$b3,$c0,$77,$50,$53,$03,$77,$d0,$3b,$40,$b3,$00,$4e,$00
1614 .byt $3b,$f0,$2b,$11,$62,$25,$b3,$00,$a0,$23,$3d,$21,$2b,$c1,$d1,$05
1615 .byt $81,$7e,$f6,$00,$2b,$f1,$9e,$05,$5e,$06,$ae,$16,$e3,$01,$7e,$3b
1616 .byt $40,$58,$3b,$d0,$43,$78,$50,$c3,$06,$3d,$14,$8f,$5f,$67,$41,$60
1617 .byt $48,$14,$3b,$b0,$7b,$14,$5f,$03,$77,$7f,$be,$16,$0c,$24,$1b,$b2
1618 .byt $f6,$16,$57,$12,$dc,$56,$40,$df,$b1,$1b,$22,$be,$03,$57,$12,$93
1619 .byt $a2,$42,$16,$7b,$f6,$16,$06,$99,$16,$42,$4f,$cb,$04,$3b,$c0,$93
1620 .byt $42,$42,$07,$08,$14,$08,$cf,$a2,$5a,$23,$6a,$14,$70,$cc,$00,$11
1621 .byt $70,$65,$53,$42,$06,$04,$9d,$07,$29,$03,$70,$55,$02,$af,$07,$77
1622 .byt $33,$8f,$03
1623
1624
1625 _BufferUnpack
1626
1627
1628
1629
1630
1631

  ViewVC Help
Powered by ViewVC 1.1.26