Details | Last modification | View Log
Rev | Author | Line No. | Line |
---|---|---|---|
1303 | alone | 1 | load_anim_pre_sub: |
2 | push hl |
||
3 | |||
4 | call load_gfx_sub |
||
5 | |||
6 | |||
7 | ld a,(language) |
||
8 | ld hl,loc_modes |
||
9 | call sel_word |
||
10 | call copystr_hlde ;+lang ( gfx/ddp/eng/ ) |
||
11 | |||
12 | ld a,(censor_mode) |
||
13 | and a |
||
14 | jp z,load_anim_pre_sub_one |
||
15 | call load_censor_sub ;( gfx/ddp/eng/censored/ ) |
||
16 | |||
17 | |||
18 | pop hl |
||
19 | push hl |
||
20 | call copy_anim_name_ext |
||
21 | |||
22 | ld de,buf |
||
23 | call openstream_file |
||
24 | or a |
||
25 | jp z,load_anim_to_load_buf_found ;found localized image |
||
26 | |||
27 | call load_gfx_sub |
||
28 | ld a,(language) |
||
29 | ld hl,loc_modes |
||
30 | call sel_word |
||
31 | call copystr_hlde ;+lang ( gfx/ddp/eng/ ) |
||
32 | |||
33 | load_anim_pre_sub_one: |
||
34 | pop hl |
||
35 | push hl |
||
36 | call copy_anim_name_ext |
||
37 | |||
38 | ld de,buf |
||
39 | call openstream_file |
||
40 | or a |
||
41 | jr z,load_anim_to_load_buf_found ;found localized image |
||
42 | |||
43 | call load_gfx_sub |
||
44 | |||
45 | |||
46 | ld a,(censor_mode) |
||
47 | and a |
||
48 | jr z,load_anim_pre_sub_two |
||
49 | |||
50 | |||
51 | call load_censor_sub ;( gfx/ddp/censored/ ) |
||
52 | |||
53 | pop hl |
||
54 | push hl |
||
55 | call copy_anim_name_ext |
||
56 | |||
57 | ld de,buf |
||
58 | call openstream_file |
||
59 | or a |
||
60 | jp z,load_anim_to_load_buf_found ;found localized image |
||
61 | |||
62 | call load_gfx_sub |
||
63 | |||
64 | load_anim_pre_sub_two: |
||
65 | pop hl |
||
66 | push hl |
||
67 | call copy_anim_name_ext |
||
68 | |||
69 | ld de,buf |
||
70 | call openstream_file |
||
71 | or a |
||
72 | jp nz,fileopenerror |
||
73 | |||
74 | load_anim_to_load_buf_found: |
||
75 | pop hl |
||
76 | ret |
||
77 | |||
78 | ;image loaded in load_buf1 and load_buf2; |
||
79 | load_gfx_pre_sub: |
||
80 | push hl |
||
81 | |||
82 | call load_gfx_sub ;set path - gfs/ddp |
||
83 | ld a,(language) |
||
84 | ld hl,loc_modes |
||
85 | call sel_word |
||
86 | call copystr_hlde ;+lang ( gfx/ddp/eng/ ) |
||
87 | |||
88 | |||
89 | ld a,(censor_mode) |
||
90 | and a |
||
91 | jr z,load_gfx_pre_sub_one |
||
92 | call load_censor_sub ;( gfx/ddp/eng/censored/ ) |
||
93 | |||
94 | pop hl |
||
95 | push hl |
||
96 | call copy_gfx_name_ext |
||
97 | |||
98 | ld de,buf |
||
99 | call openstream_file |
||
100 | or a |
||
101 | jp z,load_gfx_to_load_buf_found ;found localized image |
||
102 | |||
103 | call load_gfx_sub |
||
104 | ld a,(language) |
||
105 | ld hl,loc_modes |
||
106 | call sel_word |
||
107 | call copystr_hlde ;+lang ( gfx/ddp/eng/ ) |
||
108 | |||
109 | |||
110 | load_gfx_pre_sub_one: |
||
111 | pop hl |
||
112 | push hl |
||
113 | call copy_gfx_name_ext |
||
114 | |||
115 | ld de,buf |
||
116 | call openstream_file |
||
117 | or a |
||
118 | jp z,load_gfx_to_load_buf_found ;found localized image |
||
119 | |||
120 | call load_gfx_sub |
||
121 | |||
122 | ld a,(censor_mode) |
||
123 | and a |
||
124 | jr z,load_gfx_pre_sub_two |
||
125 | |||
126 | call load_censor_sub ;( gfx/ddp/censored/ ) |
||
127 | |||
128 | pop hl |
||
129 | push hl |
||
130 | call copy_gfx_name_ext |
||
131 | |||
132 | ld de,buf |
||
133 | call openstream_file |
||
134 | or a |
||
135 | jp z,load_gfx_to_load_buf_found ;found localized image |
||
136 | |||
137 | call load_gfx_sub |
||
138 | |||
139 | load_gfx_pre_sub_two: |
||
140 | pop hl |
||
141 | push hl |
||
142 | call copy_gfx_name_ext ;( gfx/ddp/ ) |
||
143 | |||
144 | |||
145 | ld de,buf |
||
146 | call openstream_file |
||
147 | or a |
||
148 | jp nz,fileopenerror |
||
149 | |||
150 | load_gfx_to_load_buf_found: |
||
151 | pop hl |
||
152 | ret |
||
153 | |||
154 | |||
155 | |||
156 | |||
157 | load_gfx_to_load_buf_nopal: |
||
158 | call load_gfx_pre_sub |
||
159 | |||
160 | call store8000c000 |
||
161 | |||
162 | ld a,(load_buf1) |
||
163 | SETPG8000 |
||
164 | |||
165 | ld a,(load_buf2) |
||
166 | SETPGC000 |
||
167 | |||
168 | |||
169 | ld hl,0x8000 |
||
170 | ld de,0x8000 |
||
171 | call readstream_file |
||
172 | or a |
||
173 | jp nz,filereaderror |
||
174 | |||
175 | call closestream_file |
||
176 | |||
177 | jp restore8000c000 |
||
178 | load_gfx_to_load_buf: |
||
179 | call load_gfx_pre_sub |
||
180 | |||
181 | call store8000c000 |
||
182 | |||
183 | ld a,(load_buf1) |
||
184 | SETPG8000 |
||
185 | |||
186 | ld a,(load_buf2) |
||
187 | SETPGC000 |
||
188 | |||
189 | |||
190 | ld hl,0x8000 |
||
191 | ld de,0x8000 |
||
192 | call readstream_file |
||
193 | or a |
||
194 | jp nz,filereaderror |
||
195 | |||
196 | |||
197 | ld de,pal;curpal |
||
198 | ld hl,32 |
||
199 | call readstream_file |
||
200 | or a |
||
201 | jp nz,filereaderror |
||
202 | |||
203 | call closestream_file |
||
204 | |||
205 | jp restore8000c000 |
||
206 | |||
207 | load_gfx_sub: |
||
208 | ld de,buf |
||
209 | ld hl,gfx_path1 |
||
210 | call copystr_hlde ;gfx/ |
||
211 | |||
212 | ld a,(gfx_mode) |
||
213 | ld hl,gfx_modes |
||
214 | call sel_word |
||
215 | jp copystr_hlde ;gfx/ddp/ |
||
216 | |||
217 | load_censor_sub: |
||
218 | ld hl,censor_path |
||
219 | jp copystr_hlde ;gfx/ |
||
220 | |||
221 | |||
222 | |||
223 | copy_gfx_name_ext: |
||
224 | call copystr_hlde ;+picture name |
||
225 | ld hl,gfx_ext |
||
226 | call copystr_hlde ;+extension |
||
227 | xor a |
||
228 | ld (de),a ;+string terminator |
||
229 | ret |
||
230 | copy_anim_name_ext: |
||
231 | call copystr_hlde ;+picture name |
||
232 | ld hl,anim_ext |
||
233 | call copystr_hlde ;+extension |
||
234 | xor a |
||
235 | ld (de),a ;+string terminator |
||
236 | ret |
||
237 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
238 | ;image loaded in mem_buf1 and mem_buf2; |
||
239 | load_gfx_to_mem_buf: |
||
240 | call load_gfx_pre_sub |
||
241 | |||
242 | call store8000c000 |
||
243 | |||
244 | ld a,(mem_buf1) |
||
245 | SETPG8000 |
||
246 | |||
247 | ld a,(mem_buf2) |
||
248 | SETPGC000 |
||
249 | |||
250 | |||
251 | ld hl,0x8000 |
||
252 | ld de,0x8000 |
||
253 | call readstream_file |
||
254 | or a |
||
255 | jp nz,filereaderror |
||
256 | |||
257 | |||
258 | ld de,mempal;curpal |
||
259 | ld hl,32 |
||
260 | call readstream_file |
||
261 | or a |
||
262 | jp nz,filereaderror |
||
263 | |||
264 | call closestream_file |
||
265 | |||
266 | jp restore8000c000 |
||
267 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
268 | ;image loaded in mem_buf1 and mem_buf2; |
||
269 | load_gfx_to_scr_buf: |
||
270 | call load_gfx_pre_sub |
||
271 | |||
272 | call store8000c000 |
||
273 | |||
274 | ld a,(scr_buf1) |
||
275 | SETPG8000 |
||
276 | |||
277 | ld a,(scr_buf2) |
||
278 | SETPGC000 |
||
279 | |||
280 | |||
281 | ld hl,0x8000 |
||
282 | ld de,0x8000 |
||
283 | call readstream_file |
||
284 | or a |
||
285 | jp nz,filereaderror |
||
286 | |||
287 | call closestream_file |
||
288 | |||
289 | jp restore8000c000 |
||
290 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
291 | load_ovl_to_script_buf: |
||
292 | push hl |
||
293 | call load_ovl_to_script_buf_sub |
||
294 | |||
295 | ld a,(language) |
||
296 | ld hl,loc_modes |
||
297 | call sel_word |
||
298 | call copystr_hlde ;+lang ( ovl/eng/ ) |
||
299 | |||
300 | pop hl |
||
301 | push hl |
||
302 | call copystr_hlde ;+name |
||
303 | |||
304 | xor a |
||
305 | ld (de),a |
||
306 | |||
307 | ld de,buf |
||
308 | call openstream_file |
||
309 | or a |
||
310 | jr z,load_ovl_to_script_buf_found ;found localized ovl |
||
311 | |||
312 | call load_ovl_to_script_buf_sub |
||
313 | |||
314 | pop hl |
||
315 | push hl |
||
316 | call copystr_hlde |
||
317 | xor a |
||
318 | ld (de),a |
||
319 | |||
320 | ld de,buf |
||
321 | call openstream_file |
||
322 | or a |
||
323 | jp nz,fileopenerror |
||
324 | load_ovl_to_script_buf_found: |
||
325 | pop hl |
||
326 | |||
327 | ld a,(script_buf1) |
||
328 | SETPG4000 |
||
329 | ld a,(script_buf2) |
||
330 | SETPG8000 |
||
331 | |||
332 | ld hl,0x8000 |
||
333 | ld de,0x4000 |
||
334 | call readstream_file |
||
335 | or a |
||
336 | jp nz,filereaderror |
||
337 | |||
338 | jp closestream_file |
||
339 | |||
340 | |||
341 | load_ovl_to_script_buf_sub: |
||
342 | ld de,buf |
||
343 | ld hl,ovl_path1 |
||
344 | jp copystr_hlde ;ovl/ |
||
345 | |||
346 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
347 | savestream_file |
||
348 | ;de=buf |
||
349 | ;hl=size |
||
350 | ld a,(filehandle) |
||
351 | ld b,a |
||
352 | OS_WRITEHANDLE |
||
353 | ;hl=actual size |
||
354 | ret |
||
355 | ;============================================ |
||
356 | showpalz: |
||
357 | ld a,1 |
||
358 | ld (setpalflag),a |
||
359 | ret |
||
360 | |||
361 | load_big_img_dark: |
||
362 | ld hl,showpalz |
||
363 | push hl |
||
364 | |||
365 | load_big_img_dark2: |
||
366 | call load_gfx_to_load_buf |
||
367 | |||
368 | ld hl,pal |
||
369 | ld de,temppal |
||
370 | ld bc,32 |
||
371 | ldir |
||
372 | |||
373 | ld hl,blackpal |
||
374 | ld de,pal |
||
375 | ld bc,32 |
||
376 | ldir |
||
377 | |||
378 | call _immed_big |
||
379 | |||
380 | ld de,pal |
||
381 | ld hl,temppal |
||
382 | ld bc,32 |
||
383 | ldir |
||
384 | ret |