aboutsummaryrefslogtreecommitdiff
path: root/devtools/tasmrecover/dreamweb/titles.asm
blob: 8f2b46e3f443447b5c7d811f8d1ff46cf4c0be01 (plain)
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
;Copyright (c) 1990-2011 by Neil Dodwell
;Released with permission from Neil Dodwell under GPLv2
;See LICENSE file for full license text

Titles	proc	near
	
	if	demo
	ret
	else
	call	clearpalette
	call	biblequote
	cmp quitrequested, 0
	jnz titlesearly
	call	intro
titlesearly:
	ret
	endif

	endp




Endgame	proc	near

	mov	dx,offset cs:endtextname
	call	loadtemptext
	call	monkspeaking
	call	gettingshot
	call	getridoftemptext
	mov	volumeto,7
	mov	volumedirection,1
	mov	cx,200
	call	hangon
	ret

	endp


	if	cd

Monkspeaking	proc	near

	mov	roomssample,35
	call	loadroomssample
	mov	dx,offset cs:monkface
	call	loadintotemp
	call	clearwork ;createpanel2
	call	showmonk
	call	worktoscreen
	mov	volume,7
	mov	volumedirection,-1
	mov	volumeto,5
	mov	al,12
	mov	ah,255
	call	playchannel0
	call	fadescreenups
	mov	cx,300
	call	hangon

	mov	al,40
loadspeech2:	push	ax
	mov	dl,"T"
	mov	dh,83
               	mov	cl,"T"
	mov	ah,0
	call	loadspeech
	mov	al,50+12
	call	playchannel1
notloadspeech2:	
	call vsync
	cmp	ch1playing,255
	jnz	notloadspeech2
	pop	ax
	inc	al
	cmp	al,48
	jnz	loadspeech2

	mov	volumedirection,1
	mov	volumeto,7
	call	fadescreendowns
	mov	cx,300
	call	hangon
	call	getridoftemp
	ret

	endp
	
	else

Monkspeaking	proc	near

	mov	roomssample,35
	call	loadroomssample
	mov	dx,offset cs:monkface
	call	loadintotemp
	call	clearwork ;createpanel2
	call	showmonk
	call	worktoscreen
	mov	volume,7
	mov	volumedirection,-1
	mov	volumeto,0
	mov	al,12
	mov	ah,255
	call	playchannel0
	call	fadescreenups
	mov	cx,300
	call	hangon

	mov	al,40
nextmonkspeak:	push	ax
	mov	ah,0
	mov	si,ax
	add	si,si
	mov	es,textfile1
	mov	ax,[es:si]
	add	ax,textstart
	mov	si,ax
nextbit:	mov	di,36
	mov	bx,140
	mov	dl,239
	call	printdirect
	push	ax si es
	call	worktoscreen
	call	clearwork
	call	showmonk
	mov	cx,240
	call	hangon
	pop	es si ax
	cmp	al,0
	jnz	nextbit
	pop	ax
	inc	al
	cmp	al,44
	jnz	nextmonkspeak

	mov	volumedirection,1
	mov	volumeto,7
	call	fadescreendowns
	mov	cx,300
	call	hangon
	call	getridoftemp
	ret

	endp

	endif




Showmonk	proc	near

	mov	al,0
	mov	ah,128
	mov	di,160
	mov	bx,72
	mov	ds,tempgraphics
	call	showframe
	ret

	endp


Gettingshot	proc	near

	mov	newlocation,55
	call	clearpalette
          	call	loadintroroom
         	call	fadescreenups
	mov	volumeto,0
	mov	volumedirection,-1	
        	call	runendseq
	call	clearbeforeload
	ret

	endp


	
	
	
	
Credits	proc	near

	call	clearpalette
	call	realcredits
	ret	
	
	endp



Biblequote	proc	near

	call	mode640x480
	mov	dx,offset cs:title0graphics
	call	showpcx
	call	fadescreenups
	mov	cx,80
	call	hangone
	cmp	lasthardkey,1
	jz	biblequotearly
	mov	cx,560
	call	hangone
	cmp	lasthardkey,1
	jz	biblequotearly
	call	fadescreendowns
	mov	cx,200 ;128
	call	hangone
	cmp	lasthardkey,1
	jz	biblequotearly
	call	cancelch0	
biblequotearly:
	mov lasthardkey,0
	ret

	endp




Hangone	proc	near

hangonloope:	push	cx
	call	vsync
	pop	cx
	cmp	lasthardkey,1
	jz	hangonearly
	loop	hangonloope
hangonearly:
	ret

	endp






Intro	proc	near

	mov	dx,offset cs:introtextname
	call	loadtemptext

	call	loadpalfromiff
	call	setmode

	mov	newlocation,50
	call	clearpalette
          	call	loadintroroom
	mov	volume,7
	mov	volumedirection,-1
	if	cd
	mov	volumeto,4
	else
	mov	volumeto,0
	endif
	mov	al,12 ;4
	mov	ah,255
	call	playchannel0
         	call	fadescreenups
        	call	runintroseq
		cmp	lasthardkey,1
		jz	introearly

;waitsound:	cmp	ch1blockstoplay,0
;	jnz	waitsound
	call	clearbeforeload
	
	mov	newlocation,52
	call	loadintroroom
	call	runintroseq
	cmp	lasthardkey,1
	jz	introearly
	call	clearbeforeload
	
	mov	newlocation,53
	call	loadintroroom
	call	runintroseq
	cmp	lasthardkey,1
	jz	introearly
	call	clearbeforeload
	
	call	allpalette
	mov	newlocation,54
	call	loadintroroom
	;mov	al,12
	;mov	ah,255
	;call	playchannel0
	call	runintroseq
	cmp	lasthardkey,1
	jz	introearly

	call	getridoftemptext
	call	clearbeforeload
introearly:
	mov lasthardkey, 0
	ret

	endp








Runintroseq	proc	near

	mov	getback,0

moreintroseq:	call	vsync
	cmp	lasthardkey,1
	jz	earlyendrun
	call	spriteupdate
	call	vsync
	cmp	lasthardkey,1
	jz	earlyendrun
	call	deleverything
	call	printsprites
	call	reelsonscreen
	call	afterintroroom
	call	usetimedtext
	call	vsync
	cmp	lasthardkey,1
	jz	earlyendrun
	call	dumpmap
	call	dumptimedtext
	call	vsync
	cmp	lasthardkey,1
	jz	earlyendrun
	cmp	getback,1
	jnz	moreintroseq
	ret
earlyendrun:
	call	getridoftemptext
	call	clearbeforeload
	ret

	endp





Runendseq	proc	near
	
	call	atmospheres
	mov	getback,0
moreendseq:	call	vsync
	call	spriteupdate
	call	vsync
	call	deleverything
	call	printsprites
	call	reelsonscreen
	call	afterintroroom
	call	usetimedtext
	call	vsync
	call	dumpmap
	call	dumptimedtext
	call	vsync
	cmp	getback,1
	jnz	moreendseq
	ret

	endp




Loadintroroom	proc	near

	mov	introcount,0
	mov	location,255
	call	loadroom
	mov	mapoffsetx,72
	mov	mapoffsety,16
	call	clearsprites
	mov	throughdoor,0
	mov	currentkey,"0"
	mov	mainmode,0
	call	clearwork
	mov	newobs,1
	call	drawfloor
	call	reelsonscreen
	call	spriteupdate
	call	printsprites
	call	worktoscreen
	ret

	endp






Mode640x480	proc	near

	mov	al,12h+128
	mov	ah,0
	int	10h
	;call	clearpalette
	ret

	endp



Set16colpalette	proc	near

	mov	cx,16
	mov	bl,0
	mov	bh,0
	mov	al,0
	mov	ah,10h
set16palloop2:	push	ax bx cx
	int	10h
	pop	cx bx ax
	inc	bl
	inc	bh
	loop	set16palloop2
	
	mov	bl,31h
	mov	al,1
	mov	ah,12h
	int	10h
	ret

	endp





RealCredits	proc	near

	mov	roomssample,33
	call	loadroomssample
	mov	volume,0

	call	mode640x480
	mov	cx,35
	call	hangon

	mov	dx,offset cs:title1graphics
	call	showpcx
	mov	al,12
	mov	ah,0
	call	playchannel0
	mov	cx,2
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	allpalette
	mov	cx,80
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	fadescreendowns
	mov	cx,256
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly

	mov	dx,offset cs:title2graphics
	call	showpcx
	mov	al,12
	mov	ah,0
	call	playchannel0
	mov	cx,2
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	allpalette
	mov	cx,80
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	fadescreendowns
	mov	cx,256
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly

	if	demo
	else
	mov	dx,offset cs:title3graphics
	call	showpcx
	mov	al,12
	mov	ah,0
	call	playchannel0
	mov	cx,2
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	allpalette
	mov	cx,80
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	fadescreendowns
	mov	cx,256
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly

	mov	dx,offset cs:title4graphics
	call	showpcx
	mov	al,12
	mov	ah,0
	call	playchannel0
	mov	cx,2
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	allpalette
	mov	cx,80
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	fadescreendowns
	mov	cx,256
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly

	mov	dx,offset cs:title5graphics
	call	showpcx
	mov	al,12
	mov	ah,0
	call	playchannel0
	mov	cx,2
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	allpalette
	mov	cx,80
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	fadescreendowns
	mov	cx,256
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	endif

	mov	dx,offset cs:title6graphics
	call	showpcx
	call	fadescreenups
	mov	cx,60
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	mov	al,13
	mov	ah,0
	call	playchannel0
	mov	cx,350
	call	hangone
	cmp	lasthardkey,1
	jz	realcreditsearly
	call	fadescreendowns
	mov	cx,256
	call	hangone
realcreditsearly:
	mov lasthardkey, 0
	ret

	endp