Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5253 | mario79 | 1 | ;--------------------------------------------------------------------- |
2 | load_file: |
||
3 | mov esi,path |
||
4 | mov edi,file_name |
||
5 | call copy_file_path |
||
6 | |||
7 | mov [fileinfo.subfunction],dword 5 |
||
8 | mov [fileinfo.size],dword 0 |
||
9 | mov [fileinfo.return],dword file_info |
||
10 | mcall 70,fileinfo |
||
11 | test eax,eax |
||
12 | jnz .error |
||
13 | |||
14 | mov [fileinfo.subfunction],dword 0 |
||
15 | |||
16 | mov ecx,[file_info+32] |
||
17 | mov [fileinfo.size],ecx |
||
18 | mov [img_size],ecx |
||
19 | |||
20 | mcall 68,12 |
||
21 | test eax,eax |
||
22 | jz memory_get_error |
||
23 | |||
24 | mov [fileinfo.return],eax |
||
25 | mov [image_file],eax |
||
26 | |||
27 | mcall 70,fileinfo |
||
28 | test eax,eax |
||
29 | jnz .error |
||
30 | ret |
||
31 | .error: |
||
32 | mov [N_error],2 |
||
33 | mov [error_type],eax |
||
34 | jmp button.exit |
||
35 | ;--------------------------------------------------------------------- |
||
36 | copy_file_path: |
||
37 | xor eax,eax |
||
38 | cld |
||
39 | @@: |
||
40 | lodsb |
||
41 | stosb |
||
42 | test eax,eax |
||
43 | jnz @b |
||
44 | mov esi,edi |
||
45 | dec esi |
||
46 | std |
||
47 | @@: |
||
48 | lodsb |
||
49 | cmp al,'/' |
||
50 | jnz @b |
||
51 | mov edi,esi |
||
52 | add edi,2 |
||
53 | mov esi,ebx |
||
54 | cld |
||
55 | @@: |
||
56 | lodsb |
||
57 | stosb |
||
58 | test eax,eax |
||
59 | jnz @b |
||
60 | ret |
||
61 | ;--------------------------------------------------------------------- |
||
62 | load_and_convert_current_icon_set: |
||
63 | call load_file |
||
64 | call convert_icons |
||
65 | mov eax,[raw_pointer] |
||
66 | ret |
||
67 | ;--------------------------------------------------------------------- |
||
68 | load_and_convert_all_icons: |
||
69 | ; load and convert base icons |
||
70 | mov ebx,base_icons_file_name |
||
71 | call load_and_convert_current_icon_set |
||
72 | mov [base_icons],eax |
||
73 | ; DEBUGF 1, "base_icons: %x\n",eax |
||
74 | |||
75 | ; load and convert base icons |
||
76 | ; mov ebx,npc_miku_kick_icons_file_name |
||
77 | ; call load_and_convert_current_icon_set |
||
78 | ; mov [npc_miku_kick_icons],eax |
||
79 | ; DEBUGF 1, "npc_miku_kick_icons_file_name: %s\n",npc_miku_kick_icons_file_name |
||
80 | ; DEBUGF 1, "size x: %x\n",[eax+4] |
||
81 | ; DEBUGF 1, "size x: %x\n",[eax+8] |
||
82 | ; DEBUGF 1, "common depth: %x\n",[eax+12] |
||
83 | ; DEBUGF 1, "channel depth: %x\n",[eax+16]:2 |
||
84 | ; DEBUGF 1, "channel value: %x\n",[eax+18]:2 |
||
85 | ; DEBUGF 1, "palette offset: %x\n",[eax+20] |
||
86 | ; DEBUGF 1, "palette size: %x\n",[eax+24] |
||
87 | ; DEBUGF 1, "data offset: %x\n",[eax+28] |
||
88 | ; DEBUGF 1, "data size: %x\n",[eax+32] |
||
89 | ; DEBUGF 1, "transparency offset: %x\n",[eax+36] |
||
90 | ; DEBUGF 1, "transparency size: %x\n",[eax+40] |
||
91 | |||
92 | ; load and convert red brick |
||
93 | mov ebx,red_brick_icons_file_name |
||
94 | call load_and_convert_current_icon_set |
||
95 | mov [red_brick_icons],eax |
||
96 | ; DEBUGF 1, "red_brick_icons: %x\n",eax |
||
97 | |||
98 | ; load and convert white brick |
||
99 | mov ebx,white_brick_icons_file_name |
||
100 | call load_and_convert_current_icon_set |
||
101 | mov [white_brick_icons],eax |
||
102 | ; DEBUGF 1, "white_brick_icons: %x\n",eax |
||
103 | |||
104 | ; load and convert miku |
||
105 | mov ebx,npc_miku_icons_file_name |
||
106 | call load_and_convert_current_icon_set |
||
107 | mov [npc_miku_icons],eax |
||
108 | ; DEBUGF 1, "npc_miku_icons: %x\n",eax |
||
109 | |||
110 | ; load and convert death |
||
111 | mov ebx,npc_death_icons_file_name |
||
112 | call load_and_convert_current_icon_set |
||
113 | mov [npc_death_icons],eax |
||
114 | ; DEBUGF 1, "npc_death_icons: %x\n",eax |
||
115 | |||
116 | ; load and convert skeleton |
||
117 | mov ebx,npc_skeleton_icons_file_name |
||
118 | call load_and_convert_current_icon_set |
||
119 | mov [npc_skeleton_icons],eax |
||
120 | ; DEBUGF 1, "npc_skeleton_icons: %x\n",eax |
||
121 | |||
122 | ; load and convert ifrit |
||
123 | mov ebx,npc_ifrit_icons_file_name |
||
124 | call load_and_convert_current_icon_set |
||
125 | mov [npc_ifrit_icons],eax |
||
126 | ; DEBUGF 1, "npc_ifrit_icons: %x\n",eax |
||
127 | |||
128 | ; load and convert barret |
||
129 | mov ebx,npc_barret_icons_file_name |
||
130 | call load_and_convert_current_icon_set |
||
131 | mov [npc_barret_icons],eax |
||
132 | ; DEBUGF 1, "npc_barret_icons: %x\n",eax |
||
133 | |||
134 | ret |
||
135 | ;--------------------------------------------------------------------- |
||
136 | load_sound: |
||
137 | call load_file |
||
138 | mov eax,[fileinfo.return] |
||
139 | ret |
||
140 | ;--------------------------------------------------------------------- |
||
141 | load_all_sound_files: |
||
142 | ; load background music |
||
143 | mov ebx,background_music_file_name |
||
144 | call load_sound |
||
145 | mov [background_music],eax |
||
146 | |||
147 | ; load stone kick sound |
||
148 | mov ebx,stone_kick_sound_file_name |
||
149 | call load_sound |
||
150 | mov [stone_kick_sound],eax |
||
151 | |||
152 | ret |
||
153 | ;--------------------------------------------------------------------- |