Cdi_mac.asm 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. ; CD intro files
  2. cdv_00 equ 59500
  3. cd_pal equ 59501
  4. cd_1_log equ 59502
  5. cd_1 equ 59503
  6. cdv_01 equ 59504
  7. cdv_02 equ 59505
  8. cd_2 equ 59506
  9. cdv_03 equ 59507
  10. cdv_04 equ 59508
  11. cd_3 equ 59509
  12. cdv_05 equ 59510
  13. cdv_06 equ 59511
  14. cd_5 equ 59512
  15. cdv_07 equ 59513
  16. cdv_08 equ 59514
  17. cdv_09 equ 59515
  18. cd_7 equ 59516
  19. cdv_10 equ 59518
  20. cd_11 equ 59519
  21. cdv_11 equ 59520
  22. cd_11_pal equ 59521
  23. cd_11_log equ 59522
  24. cdv_12 equ 59523
  25. cd_13 equ 59524
  26. cdv_13 equ 59525
  27. cdv_14 equ 59527
  28. cdv_15 equ 59528
  29. cd_15_pal equ 59529
  30. cd_15_log equ 59530
  31. cdv_16 equ 59531
  32. cd_17_log equ 59532
  33. cd_17 equ 59533
  34. cdv_17 equ 59534
  35. cdv_18 equ 59535
  36. cdv_19 equ 59536
  37. cd_19_pal equ 59537
  38. cd_19_log equ 59538
  39. cdv_20 equ 59539
  40. cd_20_log equ 59540
  41. cdv_21 equ 59541
  42. cd_21_log equ 59542
  43. ;cd_22 equ 59544
  44. cdv_22 equ 59545
  45. cdv_23 equ 59546
  46. cd_23_pal equ 59547
  47. ;cd_23_log equ 59548
  48. ;cd_23 equ 59549
  49. cd_24_log equ 59550
  50. cdv_24 equ 59551
  51. cdv_25 equ 59554
  52. cdv_26 equ 59556
  53. cd_27 equ 59557
  54. cdv_27 equ 59558
  55. cd_27_pal equ 59559
  56. cd_27_log equ 59560
  57. cdv_28 equ 59561
  58. cdv_29 equ 59562
  59. cdv_30 equ 59563
  60. cdv_31 equ 59565
  61. cdv_32 equ 59566
  62. cdv_33 equ 59567
  63. cdv_34 equ 59568
  64. cd_35 equ 59569
  65. cdv_35 equ 59570
  66. cd_35_pal equ 59571
  67. cd_35_log equ 59572
  68. cdv_36 equ 59574
  69. cd_37 equ 59575
  70. cdv_37 equ 59576
  71. cd_37_pal equ 59577
  72. cd_37_log equ 59578
  73. cdv_38 equ 59579
  74. cdv_39 equ 59581
  75. cdv_40 equ 59583
  76. cd_40_pal equ 59584
  77. cd_40_log equ 59585
  78. cdv_41 equ 59587
  79. cdv_42 equ 59588
  80. cd_43 equ 59589
  81. cdv_43 equ 59590
  82. cd_43_pal equ 59591
  83. cd_43_log equ 59592
  84. cdv_44 equ 59594
  85. cd_45 equ 59595
  86. cdv_45 equ 59596
  87. cd_45_pal equ 59597
  88. cd_45_log equ 59598
  89. cdv_46 equ 59600
  90. cdv_47 equ 59602
  91. cd_47_pal equ 59603
  92. cd_47_log equ 59604
  93. cd_48 equ 59605
  94. cdv_48 equ 59606
  95. cd_48_pal equ 59607
  96. cd_48_log equ 59608
  97. cd_49 equ 59609
  98. cdv_49 equ 59610
  99. cd_50 equ 59611
  100. cdv_50 equ 59612
  101. cdv_51 equ 59613
  102. cdv_52 equ 59614
  103. cdv_53 equ 59615
  104. cdv_54 equ 59616
  105. cdv_55 equ 59618
  106. cd_55_pal equ 59619
  107. cd_55_log equ 59620
  108. cdv_56 equ 59621
  109. cdv_57 equ 59622
  110. cd_58 equ 59623
  111. cdv_58 equ 59624
  112. cd_58_pal equ 59625
  113. cd_58_log equ 59626
  114. cdv_59 equ 59627
  115. cdv_60 equ 59628
  116. cdv_61 equ 59629
  117. cdv_62 equ 59630
  118. cdv_63 equ 59631
  119. cdv_64 equ 59632
  120. cdv_65 equ 59633
  121. cdv_66 equ 59635
  122. cd_66_pal equ 59636
  123. cd_66_log equ 59637
  124. cdv_67 equ 59639
  125. cd_67_pal equ 59640
  126. cd_67_log equ 59641
  127. cdv_68 equ 59642
  128. cd_69 equ 59643
  129. cdv_69 equ 59644
  130. cd_69_pal equ 59645
  131. cd_69_log equ 59646
  132. cdv_70 equ 59647
  133. cdv_71 equ 59648
  134. cdv_72 equ 59649
  135. cd_72_pal equ 59650
  136. cd_72_log equ 59651
  137. cd_73_pal equ 59652
  138. cd_73_log equ 59653
  139. cdv_73 equ 59654
  140. cdv_74 equ 59655
  141. cdv_75 equ 59656
  142. cd_76_pal equ 59657
  143. cd_76_log equ 59658
  144. cdv_76 equ 59659
  145. cdv_77 equ 59660
  146. cd_78_pal equ 59661
  147. cd_78_log equ 59662
  148. cdv_78 equ 59663
  149. cdv_79 equ 59664
  150. cdv_80 equ 59665
  151. cdv_81 equ 59666
  152. cdv_82 equ 59667
  153. cdv_83 equ 59668
  154. cdv_84 equ 59669
  155. cdv_85 equ 59670
  156. cdv_86 equ 59671
  157. cdv_87 equ 59672
  158. cd_100 equ 60087
  159. cd_101_log equ 60088
  160. cd_101 equ 60099
  161. cd_102_log equ 60090
  162. cd_102 equ 60091
  163. cd_103_pal equ 60092
  164. cd_103_log equ 60093
  165. cd_103 equ 60094
  166. cd_104_pal equ 60095
  167. cd_104_log equ 60096
  168. cd_104 equ 60097
  169. cd_105 equ 60098
  170. load_voc macro num
  171. ifdef selective_intro
  172. mov eax,num
  173. cmp eax,intro_start
  174. jc lc_skip_&num&
  175. endif
  176. cherror [cd_voices],ne,0,em_internal_error
  177. mov eax,[cd_voices]
  178. jife eax,lab_fr_&num&
  179. call my_free
  180. lab_fr_&num&: mov eax,cdv_&num&
  181. clear edx
  182. call load_file
  183. mov [cd_voices],eax
  184. lc_skip_&num&:
  185. endm
  186. load_seq macro num
  187. ifndef which_seq
  188. which_seq = 1
  189. else
  190. IF which_seq EQ 1
  191. which_seq = 2
  192. ELSE
  193. which_seq = 1
  194. ENDIF
  195. endif
  196. ifdef selective_intro
  197. mov eax,num
  198. cmp eax,intro_start
  199. jc ls_skip_&num&
  200. endif
  201. IF which_seq EQ 1
  202. free_if_n0 cd2_seq_data_1
  203. ELSE
  204. free_if_n0 cd2_seq_data_2
  205. ENDIF
  206. mov eax,cd_&num&
  207. clear edx
  208. call load_file
  209. IF which_seq EQ 1
  210. mov [cd2_seq_data_1],eax
  211. ELSE
  212. mov [cd2_seq_data_2],eax
  213. ENDIF
  214. ls_skip_&num&:
  215. endm
  216. start_sequence macro num
  217. ifdef selective_intro
  218. mov eax,num
  219. cmp eax,intro_start
  220. jc ss_skip_&num&
  221. endif
  222. IF which_seq EQ 1
  223. mov esi,[cd2_seq_data_1]
  224. ELSE
  225. mov esi,[cd2_seq_data_2]
  226. ENDIF
  227. call start_timer_sequence
  228. ifdef selective_intro
  229. ss_skip_&num&:
  230. endif
  231. endm
  232. wait_sequence macro lab
  233. wait_seq_&lab&: ;call check_commands
  234. ifdef debug_42
  235. call debug_loop
  236. endif
  237. ifdef no_timer
  238. call do_timer_sequence
  239. call stabilise
  240. endif
  241. call fetch_key
  242. jne key_pressed_eax
  243. test [tseq_frames],-1
  244. jne wait_seq_&lab&
  245. endm
  246. start_voc macro num
  247. ; 1/5 second pause before starting the voc's
  248. ifdef debug_42
  249. mov [c_text_no],num
  250. call debug_loop
  251. endif
  252. ifdef selective_intro
  253. mov eax,num
  254. cmp eax,intro_start
  255. jc sv_skip_&num&
  256. endif
  257. mov eax,[game_50hz_count]
  258. sv_wait_&num&: mov ebx,[game_50hz_count]
  259. sub ebx,eax
  260. cmp ebx,20
  261. jc sv_wait_&num&
  262. mov esi,[cd_voices]
  263. movzx ecx,(s ptr[esi]).s_tot_size
  264. lea esi,SIZE s[esi]
  265. push esi
  266. push ecx
  267. push 0
  268. call _play_voc_data__Npcii
  269. bts [system_flags],sf_voc_playing
  270. free_clr2 [cd_voices]
  271. sv_skip_&num&:
  272. endm
  273. wait_voc macro lab
  274. local freddy
  275. wait_voc_&lab&: mov al,-1
  276. call voc_progress_report2
  277. ifdef debug_42
  278. call debug_loop
  279. endif
  280. call fetch_key
  281. jne key_pressed_eax
  282. ifndef no_timer
  283. btr [system_flags],sf_timer_tick
  284. freddy: btr [system_flags],sf_timer_tick
  285. jnc freddy
  286. endif
  287. bt [system_flags],sf_voc_playing
  288. jc wait_voc_&lab&
  289. endm
  290. cd_fade_up macro seq
  291. ifdef selective_intro
  292. mov eax,seq
  293. cmp eax,intro_start
  294. jc cdfj_&seq&
  295. call fade_up_esi
  296. jmp cdfp_&seq&
  297. cdfj_&seq&: call set_palette
  298. cdfp_&seq&:
  299. else
  300. call fade_up_esi
  301. endif
  302. endm
  303. cd_fade_down macro seq
  304. ifdef selective_intro
  305. mov eax,seq
  306. cmp eax,intro_start
  307. jc cdfdj_&seq&
  308. call fn_fade_down
  309. cdfdj_&seq&:
  310. else
  311. call fn_fade_down
  312. endif
  313. endm
  314. load_to_cd macro num,dest
  315. local fred
  316. mov eax,num
  317. clear edx
  318. call load_file
  319. xchg dest,eax
  320. jife eax,fred
  321. call my_free
  322. fred:
  323. endm
  324. load_background macro num
  325. mov eax,num
  326. mov edx,[back_voc_space]
  327. call load_file
  328. mov [back_voc_space],eax
  329. endm
  330. play_background macro num
  331. mov esi,[back_voc_space]
  332. movzx ecx,(s ptr[esi]).s_tot_size
  333. lea esi,SIZE s[esi]
  334. push esi
  335. push ecx
  336. push 1
  337. call _play_voc_data__Npcii
  338. endm
  339.