~ubuntu-branches/debian/jessie/scummvm/jessie

« back to all changes in this revision

Viewing changes to devtools/tasmrecover/dreamweb/talk.asm

  • Committer: Package Import Robot
  • Author(s): Moritz Muehlenhoff
  • Date: 2011-11-05 10:29:43 UTC
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: package-import@ubuntu.com-20111105102943-zfm3dhlvy5b01u7v
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;Copyright (c) 1990-2011 by Neil Dodwell
 
2
;Released with permission from Neil Dodwell under GPLv2
 
3
;See LICENSE file for full license text
 
4
Talk    proc    near
 
5
        
 
6
        mov     talkpos,0
 
7
        mov     inmaparea,0
 
8
        mov     al,command
 
9
        mov     character,al
 
10
        call    createpanel
 
11
        call    showpanel
 
12
        call    showman
 
13
        call    showexit
 
14
        call    undertextline
 
15
        call    convicons
 
16
        call    starttalk
 
17
        mov     commandtype,255
 
18
        call    readmouse
 
19
        call    showpointer
 
20
        call    worktoscreen
 
21
waittalk:       call    delpointer
 
22
        call    readmouse
 
23
        call    animpointer
 
24
        call    showpointer
 
25
        call    vsync
 
26
        call    dumppointer
 
27
        call    dumptextline
 
28
        mov     getback,0
 
29
        mov     bx,offset cs:talklist
 
30
        call    checkcoords
 
31
        cmp quitrequested, 0
 
32
        jnz finishtalk
 
33
        cmp     getback,0
 
34
        jz      waittalk
 
35
finishtalk:     mov     bx,persondata
 
36
        push    cs
 
37
        pop     es
 
38
        cmp     talkpos,4
 
39
        jc      notnexttalk
 
40
        mov     al,[es:bx+7]
 
41
        or      al,128
 
42
        mov     [es:bx+7],al
 
43
notnexttalk:    call    redrawmainscrn
 
44
        call    worktoscreenm
 
45
        cmp     speechloaded,1
 
46
        jnz     nospeech
 
47
        call    cancelch1
 
48
        mov     volumedirection,-1      ;fade (louder)
 
49
        mov     volumeto,0      ;up to 0 (max)
 
50
nospeech:       ret
 
51
 
 
52
talklist:       dw      273,320,157,198,getback1
 
53
        dw      240,290,2,44,moretalk
 
54
        dw      0,320,0,200,blank
 
55
        dw      0ffffh
 
56
 
 
57
        endp
 
58
 
 
59
 
 
60
 
 
61
 
 
62
 
 
63
 
 
64
 
 
65
 
 
66
 
 
67
 
 
68
 
 
69
 
 
70
Convicons       proc    near
 
71
 
 
72
        mov     al,character
 
73
        and     al,127
 
74
        call    getpersframe
 
75
        mov     di,234
 
76
        mov     bx,2
 
77
        mov     currentframe,ax
 
78
        call    findsource
 
79
        mov     ax,currentframe
 
80
        sub     ax,takeoff
 
81
        mov     ah,0
 
82
        call    showframe
 
83
        ret
 
84
 
 
85
        endp
 
86
 
 
87
 
 
88
 
 
89
 
 
90
 
 
91
 
 
92
 
 
93
 
 
94
Getpersframe    proc    near
 
95
 
 
96
        mov     ah,0
 
97
        add     ax,ax
 
98
        mov     bx,ax
 
99
        mov     es,people
 
100
        add     bx,personframes
 
101
        mov     ax,[es:bx]
 
102
        ret
 
103
 
 
104
        endp
 
105
 
 
106
 
 
107
 
 
108
 
 
109
 
 
110
Starttalk       proc    near
 
111
 
 
112
        mov     talkmode,0
 
113
        mov     al,character
 
114
        and     al,127
 
115
        call    getpersontext
 
116
        mov     charshift,91+91
 
117
        mov     di,66
 
118
        mov     bx,64
 
119
        mov     dl,241
 
120
        mov     al,0
 
121
        mov     ah,79
 
122
        call    printdirect
 
123
        mov     charshift,0
 
124
        mov     di,66
 
125
        mov     bx,80
 
126
        mov     dl,241
 
127
        mov     al,0
 
128
        mov     ah,0
 
129
        call    printdirect
 
130
 
 
131
        if      cd
 
132
        mov     speechloaded,0
 
133
        mov     al,character
 
134
        and     al,127
 
135
        mov     ah,0
 
136
        mov     cx,64
 
137
        mul     cx
 
138
        mov     cl,"C"
 
139
        mov     dl,"R"
 
140
        mov     dh,reallocation
 
141
        call    loadspeech
 
142
        cmp     speechloaded,1
 
143
        jnz     nospeech1
 
144
        mov     volumedirection,1       ;quieter
 
145
        mov     volumeto,6      ;quite quiet!
 
146
        mov     al,50+12
 
147
        call    playchannel1
 
148
        endif
 
149
nospeech1:      ret
 
150
 
 
151
        endp
 
152
 
 
153
 
 
154
 
 
155
 
 
156
 
 
157
Getpersontext   proc    near
 
158
 
 
159
        mov     ah,0
 
160
        mov     cx,64*2
 
161
        mul     cx
 
162
        mov     si,ax
 
163
        mov     es,people
 
164
        add     si,persontxtdat
 
165
        mov     cx,persontext
 
166
        mov     ax,[es:si]
 
167
        add     ax,cx
 
168
        mov     si,ax
 
169
        ret
 
170
 
 
171
        endp
 
172
 
 
173
 
 
174
 
 
175
 
 
176
 
 
177
 
 
178
 
 
179
Moretalk        proc    near
 
180
 
 
181
        ;cmp    ch1playing,255
 
182
        ;jnz    cantredes
 
183
        cmp     talkmode,0
 
184
        jz      canmore
 
185
        call    redes
 
186
        ret
 
187
 
 
188
canmore:        cmp     commandtype,215
 
189
        jz      alreadymore
 
190
        mov     commandtype,215
 
191
        mov     al,49
 
192
        call    commandonly
 
193
alreadymore:    mov     ax,mousebutton
 
194
        cmp     ax,oldbutton
 
195
        jz      nomore
 
196
        and     ax,1
 
197
        jnz     domoretalk
 
198
nomore:         ret
 
199
 
 
200
domoretalk:     mov     talkmode,2
 
201
        mov     talkpos,4
 
202
        cmp     character,100
 
203
        jc      notsecondpart
 
204
                mov     talkpos,48
 
205
notsecondpart:  call    dosometalk
 
206
        ret
 
207
 
 
208
        endp
 
209
 
 
210
 
 
211
 
 
212
 
 
213
 
 
214
 
 
215
 
 
216
 
 
217
 
 
218
 
 
219
 
 
220
 
 
221
 
 
222
 
 
223
Dosometalk      proc    near
 
224
 
 
225
        if      cd
 
226
dospeech:       mov     al,talkpos
 
227
        mov     al,character
 
228
        and     al,127
 
229
        mov     ah,0
 
230
        mov     cx,64
 
231
        mul     cx
 
232
        mov     cx,ax
 
233
        mov     al,talkpos
 
234
        mov     ah,0
 
235
        add     ax,cx
 
236
        add     ax,ax
 
237
        mov     si,ax
 
238
 
 
239
        mov     es,people
 
240
        add     si,persontxtdat
 
241
        mov     cx,persontext
 
242
 
 
243
        mov     ax,[es:si]
 
244
        add     ax,cx
 
245
        mov     si,ax
 
246
        cmp     byte ptr [es:si],0
 
247
        jz      endheartalk
 
248
       
 
249
        push    es si
 
250
        call    createpanel
 
251
        call    showpanel
 
252
        call    showman
 
253
        call    showexit
 
254
        call    convicons
 
255
        pop     si es
 
256
 
 
257
        mov     di,164
 
258
        mov     bx,64
 
259
        mov     dl,144
 
260
        mov     al,0
 
261
        mov     ah,0
 
262
        call    printdirect
 
263
 
 
264
        mov     al,character
 
265
        and     al,127
 
266
        mov     ah,0
 
267
        mov     cx,64
 
268
        mul     cx
 
269
        mov     cl,talkpos
 
270
        mov     ch,0
 
271
        add     ax,cx
 
272
        mov     cl,"C"
 
273
        mov     dl,"R"
 
274
        mov     dh,reallocation
 
275
        call    loadspeech
 
276
        cmp     speechloaded,0
 
277
        jz      noplay1
 
278
        mov     al,62
 
279
        call    playchannel1
 
280
 
 
281
noplay1:        mov     pointermode,3
 
282
        call    worktoscreenm
 
283
        mov     cx,180
 
284
        call    hangonpq
 
285
        jnc $1
 
286
        ret
 
287
 
 
288
$1:
 
289
        inc     talkpos
 
290
          
 
291
        mov     al,talkpos
 
292
                mov     al,character
 
293
        and     al,127
 
294
        mov     ah,0
 
295
        mov     cx,64
 
296
        mul     cx
 
297
        mov     cx,ax
 
298
        mov     al,talkpos
 
299
        mov     ah,0
 
300
        add     ax,cx
 
301
        add     ax,ax
 
302
        mov     si,ax
 
303
 
 
304
        mov     es,people
 
305
        add     si,persontxtdat
 
306
        mov     cx,persontext
 
307
 
 
308
        mov     ax,[es:si]
 
309
        add     ax,cx
 
310
        mov     si,ax
 
311
        cmp     byte ptr [es:si],0
 
312
        jz      endheartalk
 
313
        cmp     byte ptr [es:si],":"
 
314
        jz      skiptalk2
 
315
        cmp     byte ptr [es:si],32
 
316
        jz      skiptalk2
 
317
        
 
318
        push    es si
 
319
        call    createpanel
 
320
        call    showpanel
 
321
        call    showman
 
322
        call    showexit
 
323
        call    convicons
 
324
        pop     si es
 
325
 
 
326
        mov     di,48
 
327
        mov     bx,128
 
328
        mov     dl,144
 
329
        mov     al,0
 
330
        mov     ah,0
 
331
        call    printdirect
 
332
 
 
333
        mov     al,character
 
334
        and     al,127
 
335
        mov     ah,0
 
336
        mov     cx,64
 
337
        mul     cx
 
338
        mov     cl,talkpos
 
339
        mov     ch,0
 
340
        add     ax,cx
 
341
        mov     cl,"C"
 
342
        mov     dl,"R"
 
343
        mov     dh,reallocation
 
344
        call    loadspeech
 
345
        cmp     speechloaded,0
 
346
        jz      noplay2
 
347
        mov     al,62
 
348
        call    playchannel1
 
349
 
 
350
noplay2:        mov     pointermode,3
 
351
        call    worktoscreenm
 
352
        mov     cx,180
 
353
        call    hangonpq
 
354
        jnc skiptalk2
 
355
        ret
 
356
 
 
357
skiptalk2:      inc     talkpos
 
358
        jmp     dospeech
 
359
 
 
360
endheartalk:    mov     pointermode,0
 
361
        ret
 
362
        
 
363
        else
 
364
 
 
365
watchtalk:      mov     al,talkpos
 
366
        mov     al,character
 
367
        and     al,127
 
368
        mov     ah,0
 
369
        mov     cx,64
 
370
        mul     cx
 
371
        mov     cx,ax
 
372
        mov     al,talkpos
 
373
        mov     ah,0
 
374
        add     ax,cx
 
375
        add     ax,ax
 
376
        mov     si,ax
 
377
 
 
378
        mov     es,people
 
379
        add     si,persontxtdat
 
380
        mov     cx,persontext
 
381
 
 
382
        mov     ax,[es:si]
 
383
        add     ax,cx
 
384
        mov     si,ax
 
385
        cmp     byte ptr [es:si],0
 
386
        jz      endwatchtalk
 
387
        
 
388
        push    es si
 
389
        call    createpanel
 
390
        call    showpanel
 
391
        call    showman
 
392
        call    showexit
 
393
        call    convicons
 
394
        pop     si es
 
395
 
 
396
        mov     di,164
 
397
        mov     bx,64
 
398
        mov     dl,144
 
399
        mov     al,0
 
400
        mov     ah,0
 
401
        call    printdirect
 
402
 
 
403
        mov     pointermode,3
 
404
        call    worktoscreenm
 
405
        mov     cx,180
 
406
        call    hangonpq
 
407
        jnc $1
 
408
        ret
 
409
$1:
 
410
 
 
411
        inc     talkpos
 
412
          
 
413
        mov     al,talkpos
 
414
                mov     al,character
 
415
        and     al,127
 
416
        mov     ah,0
 
417
        mov     cx,64
 
418
        mul     cx
 
419
        mov     cx,ax
 
420
        mov     al,talkpos
 
421
        mov     ah,0
 
422
        add     ax,cx
 
423
        add     ax,ax
 
424
        mov     si,ax
 
425
 
 
426
        mov     es,people
 
427
        add     si,persontxtdat
 
428
        mov     cx,persontext
 
429
 
 
430
        mov     ax,[es:si]
 
431
        add     ax,cx
 
432
        mov     si,ax
 
433
        cmp     byte ptr [es:si],0
 
434
        jz      endwatchtalk
 
435
        cmp     byte ptr [es:si],":"
 
436
        jz      skiptalk
 
437
        cmp     byte ptr [es:si],32
 
438
        jz      skiptalk
 
439
        
 
440
        push    es si
 
441
        call    createpanel
 
442
        call    showpanel
 
443
        call    showman
 
444
        call    showexit
 
445
        call    convicons
 
446
        pop     si es
 
447
 
 
448
        mov     di,48
 
449
        mov     bx,128
 
450
        mov     dl,144
 
451
        mov     al,0
 
452
        mov     ah,0
 
453
        call    printdirect
 
454
 
 
455
        mov     pointermode,3
 
456
        call    worktoscreenm
 
457
        mov     cx,180
 
458
        call    hangonpq
 
459
        jnc skiptalk
 
460
        ret
 
461
 
 
462
skiptalk:       inc     talkpos
 
463
        jmp     watchtalk
 
464
 
 
465
endwatchtalk:   mov     pointermode,0
 
466
        ret
 
467
 
 
468
        endif
 
469
 
 
470
        endp
 
471
 
 
472
 
 
473
 
 
474
 
 
475
 
 
476
 
 
477
 
 
478
Hangonpq        proc    near
 
479
 
 
480
        mov     getback,0
 
481
        mov     bx,0
 
482
hangloopq:      push    cx bx
 
483
        call    delpointer
 
484
        call    readmouse
 
485
        call    animpointer
 
486
        call    showpointer
 
487
        call    vsync
 
488
        call    dumppointer
 
489
        call    dumptextline
 
490
        mov     bx,offset cs:quitlist
 
491
        call    checkcoords
 
492
        pop     bx cx
 
493
        cmp     getback,1
 
494
        jz      quitconv
 
495
        cmp quitrequested, 0
 
496
        jnz quitconv
 
497
        cmp     speechloaded,1
 
498
        jnz     notspeaking
 
499
                cmp     ch1playing,255
 
500
        jnz     notspeaking
 
501
        inc     bx
 
502
        cmp     bx,40           ;pause after speech ends
 
503
        jz      finishconv
 
504
notspeaking:    cmp     mousebutton,0
 
505
        jz      hangloopq
 
506
        cmp     oldbutton,0
 
507
        jnz     hangloopq
 
508
finishconv:     call    delpointer
 
509
        mov     pointermode,0
 
510
        clc
 
511
        ret
 
512
        
 
513
quitconv:       call    delpointer
 
514
        mov     pointermode,0
 
515
        call    cancelch1
 
516
        stc
 
517
        ret
 
518
 
 
519
quitlist:       dw      273,320,157,198,getback1
 
520
        dw      0,320,0,200,blank
 
521
        dw      0ffffh
 
522
 
 
523
        endp
 
524
 
 
525
 
 
526
 
 
527
 
 
528
 
 
529
 
 
530
 
 
531
 
 
532
 
 
533
Redes   proc    near
 
534
 
 
535
        cmp     ch1playing,255
 
536
        jnz     cantredes
 
537
        cmp     talkmode,2
 
538
        jz      canredes
 
539
cantredes:      call    blank
 
540
        ret
 
541
 
 
542
canredes:       cmp     commandtype,217
 
543
        jz      alreadyreds
 
544
        mov     commandtype,217
 
545
        mov     al,50
 
546
        call    commandonly
 
547
alreadyreds:    mov     ax,mousebutton
 
548
        and     ax,1
 
549
        jnz     doredes
 
550
        ret
 
551
 
 
552
doredes:        call    delpointer
 
553
        call    createpanel
 
554
        call    showpanel
 
555
        call    showman
 
556
        call    showexit
 
557
        call    convicons
 
558
        call    starttalk
 
559
        call    readmouse
 
560
        call    showpointer
 
561
        call    worktoscreen
 
562
        call    delpointer
 
563
        ret
 
564
 
 
565
        endp