/[projet1]/public/atari/demos/defenceforce/savetheearth/credits.s
Defence Force logotype

Contents of /public/atari/demos/defenceforce/savetheearth/credits.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 172 - (show annotations)
Sat Nov 28 13:10:37 2009 UTC (10 years ago) by dbug
File size: 11201 byte(s)
Added the source code of "Save The Earth", the Atari STe demo presented at Kindergarden 2009
1 ;
2 ; Assuming the credits are stored in two bitplans, we have a buffer that takes
3 ; 208 bytes per line /2 -> 104 bytes (52 half words)
4 ;
5 ; The largest nop sequence is 91 nops per scanline
6 ;
7 ;
8
9 FONT_HEIGHT set 21
10 LINE_COUNT set 10
11 MAX_CHAR_PER_FRAME set 4
12
13 FONT_LEFT_OFFSET set 20
14 FONT_LINE_WIDTH set 380 ; 416-20-20
15
16
17 SECTION TEXT
18
19 even
20
21
22 CreditsInit
23 ifne enable_music
24 lea music,a0
25 bsr StartMusicIfNotStarted
26 endc
27
28 ; Depack the OCR font
29 lea PackInfoCreditFont,a0
30 bsr DepackBlock
31
32 lea PackInfoAtari,a0
33 bsr DepackBlock
34
35 move.l #big_buffer_start+credits_screen,ptr_scr_1
36
37 bsr CreditsMapFont
38
39 ; Compute the justification for the scroller
40 lea CreditsMessage,a0
41 lea big_buffer_start+credits_character_width,a1
42 move #FONT_LINE_WIDTH,d0
43 bsr ComputeCharacterJustification
44
45 move.l #big_buffer_start+credits_screen+((LINE_COUNT*FONT_HEIGHT)+0)*208,character_buffer_base
46 move.l #big_buffer_start+credits_screen,big_buffer_start+credits_top_line
47
48 move.l #CreditsMessage,big_buffer_start+credits_current_position
49
50 move #0,pos_scr_y ; Set the screen to the top line of the first buffer
51 move #FONT_LEFT_OFFSET,character_xpos
52 move #0,character_ypos ; We use the buffer adress instead of Y pos
53 move #0,big_buffer_start+credits_sub_ypos ; From 0 to 21, allows to know when to go to next text line
54 move #0,big_buffer_start+credits_sub_line_count ; From 0 to
55
56 move.l #CreditsPlayScroller,_AdrPartCredits
57
58 ; Picture palette
59 lea black_palette,a0
60 lea big_buffer_start+credits_depacked_font,a1
61 moveq #16,d7
62 bsr ComputeGradient
63
64 ; Using the template data, we generate the fullscreen
65 lea PanoramicTemplate_DisplayList,a0
66 lea big_buffer_start+credits_fullscreen,a1
67 bsr GenerateOverscan
68 rts
69
70
71 CreditsPlay
72 _AdrPartCredits=*+2
73 jsr DummyRoutine
74 rts
75
76
77 CreditsTerminate
78 bsr TerminateFullscreenTimer
79
80 ; Stops the music
81 ifne enable_music
82 bsr StopMusic
83 endc
84
85 ; 3 seconds of black at the very end before quitting.
86 move.w #50*3,d0
87 bsr WaitDelay
88 rts
89
90
91 CreditsPlayAtariLogo
92 move.l #big_buffer_start+credits_depacked_atari,d0
93 move.l d0,a1
94 add.l #32*200,d0
95 lsl.l #8,d0
96 move.l d0,a0
97
98 lea DisplayList,a2 ; Target display list
99 move pos_scr_y,d0
100 lsl #3,d0
101 add d0,a2
102
103 move.l #208*256,d0
104 move.l #32,d1
105 bsr DisplayListInit200
106
107 subq.w #1,pos_scr_y
108 bne.s .continue
109 move.l #CreditsPlayAtariLogoWait,_AdrPartCredits
110 move.w #50*8,big_buffer_start+credits_delay
111 .continue
112 rts
113
114
115 CreditsPlayAtariLogoWait
116 subq.w #1,big_buffer_start+credits_delay
117 bne.s .continue
118
119 lea DisplayList,a0
120 lea big_buffer_start+credits_displaylist,a1
121 move.w #200-1,d7
122 .loop
123 move.l (a0)+,(a1)+
124 move.l (a0)+,(a1)+
125 dbra d7,.loop
126
127 move.l #CreditsPlayAtariLogoShrink,_AdrPartCredits
128 move.w #200,big_buffer_start+credits_logo_size
129
130 .continue
131 rts
132
133
134
135
136 CreditsPlayAtariLogoShrink
137 ; Black picture
138 bsr DisplayListInitBlack
139
140 ; Start of display list around the middle line
141 lea DisplayList+100*8,a2
142 move.w big_buffer_start+credits_logo_size,d0
143 lsr.w d0
144 lsl.w #3,d0
145 sub.w d0,a2
146
147 ; Zoom factor
148 move.l #$00000,d0 ; Start value
149 move.l #1,d1 ; increment
150 mulu #200,d1
151 lsl.l #8,d1
152 divu big_buffer_start+credits_logo_size,d1
153 ext.l d1 ; Flush the top word
154 lsl.l #8,d1
155
156 ; Draw from d1 to d2
157 lea big_buffer_start+credits_displaylist,a0
158 move.w big_buffer_start+credits_logo_size,d7
159 subq #1,d7
160 .loop
161 swap d0
162 move d0,d2
163 swap d0
164 add.l d1,d0
165
166 lsl #3,d2
167 lea (a0,d2.w),a1
168 move.l 0(a1),(a2)+
169 move.l 4(a1),(a2)+
170 dbra d7,.loop
171
172 subq #4,big_buffer_start+credits_logo_size
173 beq.s .done
174 rts
175 .done
176 st.b flag_end_part
177 rts
178
179
180
181
182 CreditsPlayScroller
183 bsr.s CreditsUpdate
184 bsr.s CreditsSetScreen
185 rts
186
187 CreditsSetScreen
188 ; Update the display list to point on the correct screen adress
189 move pos_scr_y,d1
190 mulu #208,d1
191 add.l #big_buffer_start+credits_screen,d1
192 lsl.l #8,d1
193 move.l d1,a0
194
195 lea palette_vbl_fade,a1
196 lea DisplayList,a2
197 move.l #208*256,d0
198 moveq #0,d1
199 bsr DisplayListInit200
200 rts
201
202 CreditsUpdate
203 addq #1,pos_scr_y
204 addq #1,big_buffer_start+credits_sub_ypos
205
206 ; On first call, erase the 21 lines
207 cmp #1,big_buffer_start+credits_sub_ypos
208 bne .print_line
209
210
211 ; Clear the 21 lines after that one...
212 move.l character_buffer_base,a0
213 lea (FONT_HEIGHT)*208(a0),a0
214 ; 208*21=4368 bytes to erase
215 movem.l black_palette,d0-d7/a2-a6 ; 8+5=13*4=52 bytes with 0's inside
216 REPT 4*FONT_HEIGHT
217 movem.l d0-d7/a2-a6,-(a0)
218 ENDR
219
220 rts
221
222 .print_line
223
224 moveq #MAX_CHAR_PER_FRAME,d1
225 .loop
226 move.l big_buffer_start+credits_current_position,a0
227 move.b (a0)+,d0 ; Get the current character
228 beq.s .done
229 cmp.b #13,d0
230 beq.s .new_line
231 cmp.b #'_',d0
232 beq.s .variable_space
233
234 ; d0=character index
235 ; a6=pointer on the font description bloc
236 lea FontCredits,a6
237 bsr CharacterDraw
238 move.l a0,big_buffer_start+credits_current_position
239 dbra d1,.loop
240 rts
241
242 .done
243 ; Reached the end of the scroller,
244 ; start the logo
245 move.l #CreditsPlayAtariLogo,_AdrPartCredits
246 move.w #200,pos_scr_y
247 rts
248
249 .variable_space
250 moveq #0,d0
251 move.b (a0)+,d0
252 add d0,d0 ; x2
253 add d0,character_xpos
254 move.l a0,big_buffer_start+credits_current_position
255 bra.s .loop
256
257 .new_line
258 cmp #FONT_HEIGHT,big_buffer_start+credits_sub_ypos
259 bne .no_end_line
260
261 move.l a0,big_buffer_start+credits_current_position
262
263 ; First copy the line
264 move.l character_buffer_base,a0
265 move.l big_buffer_start+credits_top_line,a1
266 var set 0
267 REPT 4*FONT_HEIGHT
268 movem.l (a0)+,d0-d7/a2-a6 ; 8+5=13*4=52 bytes
269 movem.l d0-d7/a2-a6,var(a1)
270 var set var+52
271 ENDR
272 lea 208*FONT_HEIGHT(a1),a1
273 move.l a1,big_buffer_start+credits_top_line
274
275
276 move #0,big_buffer_start+credits_sub_ypos ; From 0 to 21, allows to know when to go to next text line
277 move #FONT_LEFT_OFFSET,character_xpos
278 add.l #(FONT_HEIGHT)*208,character_buffer_base
279
280 addq #1,big_buffer_start+credits_sub_line_count
281 cmp #LINE_COUNT,big_buffer_start+credits_sub_line_count
282 bne.s .no_end_page
283
284 move #0,big_buffer_start+credits_sub_line_count
285 move #0,pos_scr_y ; Set the screen to the top line of the first buffer
286 move.l #big_buffer_start+credits_screen+((LINE_COUNT*FONT_HEIGHT)+0)*208,character_buffer_base
287 move.l #big_buffer_start+credits_screen,big_buffer_start+credits_top_line
288
289 .no_end_page
290
291 .no_end_line
292 rts
293
294
295 CreditsMapFont
296 ; Compute the pointers to fonts
297 lea FontCredits,a6
298 bsr ComputeCharactersAdressMapFromBitmap
299 rts
300
301
302 SECTION DATA
303
304 even
305
306 FontCredits
307 dc.l big_buffer_start+credits_depacked_font+32
308 dc.l CommonCharacterList
309 dc.l big_buffer_start+credits_mapping_font
310 dc.l big_buffer_start+credits_character_width
311 dc.w FONT_HEIGHT
312 dc.w 104
313 dc.w 104*FONT_HEIGHT
314 dc.w 8
315 dc.w 0 ; No extra pixel between characters
316 dc.w 8 ; 8 pixels for the space
317
318
319 PackInfoCreditFont
320 dc.l font_ocr
321 dc.l big_buffer_start+credits_depacked_font
322 dc.l 15320
323
324 PackInfoAtari
325 dc.l packed_picture_atari
326 dc.l big_buffer_start+credits_depacked_atari
327 dc.l 48000
328
329
330 ; Unpacked: 15320
331 ; Packed: 8059
332 FILE "font_ocr.pik",font_ocr
333
334 ; Unpacked: 48000
335 ; Packed: 16384
336 FILE "atari.pik",packed_picture_atari
337
338
339 CreditsMessage
340 dc.b " ",13
341 dc.b "__Save The Earth__",13
342 dc.b " ",13
343 dc.b " ",13
344 dc.b "__An Environmentally Aware Demo__",13
345 dc.b "__For the 20th Birthday of the STE__",13
346 dc.b "__at Kindergarden 2009__",13
347 dc.b " ",13
348 dc.b " ",13
349 dc.b "Credits:",13
350 dc.b " ",13
351 dc.b " Dbug__(code & graphics)",13
352 ;dc.b " XiA__(music)",13
353 dc.b " Excellence in Art__(music)",13
354 dc.b " Crem__(revamped logo)",13
355 dc.b " ",13
356 dc.b " ",13
357 dc.b "Additional credits:",13
358 dc.b " ",13
359 dc.b " Mircha__(moral support)",13
360 dc.b " Dad__(1040 STe)",13
361 dc.b " GGN__(SIMMs)",13
362 dc.b " Gloky__(new keyboard)",13
363 dc.b " Jookie & MiKRO__(Ultra Satan)",13
364 dc.b " Nerve__(transportation)",13
365 dc.b " Evl__(many small things)",13
366 dc.b " gwEm__(maxYMiser)",13
367 dc.b " Elitar__(pixel-art trucks)",13
368 dc.b " ",13
369 dc.b " ",13
370 dc.b "Borrowed material credits:",13
371 dc.b " ",13
372 dc.b "__The Industry Trust for__",13
373 dc.b "__Intellectual Property Awareness__",13
374 dc.b " ",13
375 dc.b "__Google Image__",13
376 dc.b " ",13
377 dc.b "__Elitar__",13
378 dc.b "__(@ www.pixelcarart.com)__",13
379 dc.b " ",13
380 dc.b " ",13
381 dc.b "Atari greetings:",13
382 dc.b " ",13
383 dc.b "__Nolan Bushnell__",13
384 dc.b "__Jay Miner__",13
385 dc.b "__Shirav Shivji__",13
386 dc.b "__Jack & Sam Tramiel__",13
387 dc.b "__Pradip K Fatehpuria__",13
388 dc.b " ",13
389 dc.b " ",13
390 dc.b "Classic atari game greeting:",13
391 dc.b " ",13
392 dc.b "__Faster Than Light__",13
393 dc.b "__The Bitmap Brothers__",13
394 dc.b "__Psygnosis__",13
395 dc.b "__Steve Bak__",13
396 dc.b "__David Whittaker__",13
397 dc.b "__Archer MacLean__",13
398 dc.b " ",13
399 dc.b " ",13
400 dc.b "Demo scene greetings:",13
401 dc.b " ",13
402 dc.b "Accession, "
403 dc.b "Aggression, "
404 dc.b "Alive Team, "
405 dc.b "Andromeda, "
406 dc.b "ASD, "
407 dc.b "Ate Bit, "
408 dc.b "BitFlavour, "
409 dc.b "BlockoS, "
410 dc.b "Booze Design, "
411 dc.b "Boozoholics, "
412 dc.b "Byterapers, "
413 dc.b "Brainstorm, "
414 dc.b "CEO, "
415 dc.b "Checkpoint, "
416 dc.b "Chema, "
417 dc.b "Cream, "
418 dc.b "Crest, "
419 dc.b "d-Bug, "
420 dc.b "DHS, "
421 dc.b "Darklite, "
422 dc.b "Dekadence, "
423 dc.b "Drifters, "
424 dc.b "Ephidrena, "
425 dc.b "Equinox, "
426 dc.b "Evolution, "
427 dc.b "Excess, "
428 dc.b "Fairlight, "
429 dc.b "Gwem, "
430 dc.b "IRIS, "
431 dc.b "Keyboarders, "
432 dc.b "Kvasigen, "
433 dc.b "Limp ninja, "
434 dc.b "Lineout, "
435 dc.b "Loonies, "
436 dc.b "Loud, "
437 dc.b "MJJ Prod, "
438 dc.b "New Beat, "
439 dc.b "No Extra, "
440 dc.b "Noon, "
441 dc.b "Odd, "
442 dc.b "ORB, "
443 dc.b "Outracks, "
444 dc.b "Oxygene, "
445 dc.b "Oxyron, "
446 dc.b "Paradize, "
447 dc.b "Paradox, "
448 dc.b "PHF, "
449 dc.b "PlayPsyCo, "
450 dc.b "Portal Process, "
451 dc.b "Reservoir Gods, "
452 dc.b "Rgba, "
453 dc.b "Spaceballs, "
454 dc.b "Speckdrumm, "
455 dc.b "Stax, "
456 dc.b "St Knights, "
457 dc.b "Stu, "
458 dc.b "Synestetics, "
459 dc.b "TetraKnight Squad 348, "
460 dc.b "TBC, "
461 dc.b "TBL, "
462 dc.b "TSCC, "
463 dc.b "Tufs, "
464 dc.b "Twilighte, "
465 dc.b "Yescrew, "
466 dc.b "YM-Rockerz...",13
467 dc.b " ",13
468 dc.b "__...and you as well",13
469 dc.b "since you took the time to watch this scroller :)",13
470 dc.b " ",13
471 REPT LINE_COUNT
472 dc.b " ",13
473 ENDR
474
475 dc.b 0
476
477 even
478
479 SECTION BSS
480
481 even
482
483 ;
484 ; The content of this buffer is going to be stored in
485 ; the big common table.
486 ;
487 rsreset
488 credits_fullscreen rs.b Size_PanoramicRoutine_DisplayList
489 credits_depacked_font rs.b 15320
490
491 credits_screen rs.b 208*(LINE_COUNT*FONT_HEIGHT*2)+256 ; Screen data
492
493 credits_depacked_atari rs.b 48000
494
495 credits_mapping_font rs.l 256
496 credits_character_width rs.w 256 ; Width in pixels for each character
497 credits_current_position rs.l 1
498 credits_top_line rs.l 1
499 credits_sub_ypos rs.w 1
500 credits_sub_line_count rs.w 1
501
502 credits_delay rs.w 1
503
504 credits_displaylist rs.l 200*2
505 credits_logo_size rs.w 1
506
507 update_buffer_size
508
509
510
511

  ViewVC Help
Powered by ViewVC 1.1.26