Rev 5640 | Rev 5648 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5640 | Rev 5646 | ||
---|---|---|---|
Line 49... | Line 49... | ||
49 | __file_F70.param1 = |
49 | __file_F70.param1 = |
50 | __file_F70.param2 = |
50 | __file_F70.param2 = |
51 | __file_F70.rezerv = 0; |
51 | __file_F70.rezerv = 0; |
52 | __file_F70.param3 = file_count; |
52 | __file_F70.param3 = file_count; |
53 | __file_F70.param4 = read_buffer; |
53 | __file_F70.param4 = read_buffer; |
54 | __file_F70.name = dir_path; |
54 | __file_F70.name = io.path.path(dir_path); |
55 | $mov eax,70 |
55 | $mov eax,70 |
56 | $mov ebx,#__file_F70.func |
56 | $mov ebx,#__file_F70.func |
57 | $int 0x40 |
57 | $int 0x40 |
58 | } |
58 | } |
Line 63... | Line 63... | ||
63 | __file_F70.param1 = |
63 | __file_F70.param1 = |
64 | __file_F70.param2 = |
64 | __file_F70.param2 = |
65 | __file_F70.param3 = 0; |
65 | __file_F70.param3 = 0; |
66 | __file_F70.param4 = bdvk_struct; |
66 | __file_F70.param4 = bdvk_struct; |
67 | __file_F70.rezerv = 0; |
67 | __file_F70.rezerv = 0; |
68 | __file_F70.name = file_path; |
68 | __file_F70.name = io.path.path(file_path); |
69 | $mov eax,70 |
69 | $mov eax,70 |
70 | $mov ebx,#__file_F70.func |
70 | $mov ebx,#__file_F70.func |
71 | $int 0x40 |
71 | $int 0x40 |
72 | } |
72 | } |
Line 100... | Line 100... | ||
100 | __file_F70.param1 = |
100 | __file_F70.param1 = |
101 | __file_F70.param2 = |
101 | __file_F70.param2 = |
102 | __file_F70.param3 = 0; |
102 | __file_F70.param3 = 0; |
103 | __file_F70.param4 = #io.BDVK; |
103 | __file_F70.param4 = #io.BDVK; |
104 | __file_F70.rezerv = 0; |
104 | __file_F70.rezerv = 0; |
105 | __file_F70.name = file_path; |
105 | __file_F70.name = io.path.path(file_path); |
106 | $mov eax,70 |
106 | $mov eax,70 |
107 | $mov ebx,#__file_F70.func |
107 | $mov ebx,#__file_F70.func |
108 | $int 0x40 |
108 | $int 0x40 |
109 | } |
109 | } |
110 | :int __FILE::del(dword PATH) |
110 | :int __FILE::del(dword PATH) |
Line 113... | Line 113... | ||
113 | __file_F70.param1 = |
113 | __file_F70.param1 = |
114 | __file_F70.param2 = |
114 | __file_F70.param2 = |
115 | __file_F70.param3 = |
115 | __file_F70.param3 = |
116 | __file_F70.param4 = |
116 | __file_F70.param4 = |
117 | __file_F70.rezerv = 0; |
117 | __file_F70.rezerv = 0; |
118 | __file_F70.name = PATH; |
118 | __file_F70.name = io.path.path(PATH); |
119 | $mov eax,70 |
119 | $mov eax,70 |
120 | $mov ebx,#__file_F70.func |
120 | $mov ebx,#__file_F70.func |
121 | $int 0x40 |
121 | $int 0x40 |
122 | } |
122 | } |
123 | :int __FILE::read(dword read_pos, read_file_size, read_buffer, read_file_path) |
123 | :int __FILE::read(dword read_pos, read_file_size, read_buffer, read_file_path) |
Line 126... | Line 126... | ||
126 | __file_F70.param1 = read_pos; |
126 | __file_F70.param1 = read_pos; |
127 | __file_F70.param2 = 0; |
127 | __file_F70.param2 = 0; |
128 | __file_F70.param3 = read_file_size; |
128 | __file_F70.param3 = read_file_size; |
129 | __file_F70.param4 = read_buffer; |
129 | __file_F70.param4 = read_buffer; |
130 | __file_F70.rezerv = 0; |
130 | __file_F70.rezerv = 0; |
131 | __file_F70.name = read_file_path; |
131 | __file_F70.name = io.path.path(read_file_path); |
132 | $mov eax,70 |
132 | $mov eax,70 |
133 | $mov ebx,#__file_F70.func |
133 | $mov ebx,#__file_F70.func |
134 | $int 0x40 |
134 | $int 0x40 |
135 | } |
135 | } |
136 | :int __FILE::write(dword write_file_size, write_buffer, write_file_path) |
136 | :int __FILE::write(dword write_file_size, write_buffer, write_file_path) |
Line 139... | Line 139... | ||
139 | __file_F70.param1 = 0; |
139 | __file_F70.param1 = 0; |
140 | __file_F70.param2 = 0; |
140 | __file_F70.param2 = 0; |
141 | __file_F70.param3 = write_file_size; |
141 | __file_F70.param3 = write_file_size; |
142 | __file_F70.param4 = write_buffer; |
142 | __file_F70.param4 = write_buffer; |
143 | __file_F70.rezerv = 0; |
143 | __file_F70.rezerv = 0; |
144 | __file_F70.name = write_file_path; |
144 | __file_F70.name = io.path.path(write_file_path); |
145 | $mov eax,70 |
145 | $mov eax,70 |
146 | $mov ebx,#__file_F70.func |
146 | $mov ebx,#__file_F70.func |
147 | $int 0x40 |
147 | $int 0x40 |
148 | } |
148 | } |
149 | :struct __DIR |
149 | :struct __DIR |
150 | { |
150 | { |
151 | int make(dword name); |
151 | int make(dword name); |
- | 152 | dword position(dword i); |
|
152 | dword buffer; |
153 | dword buffer; |
153 | signed count; |
154 | signed count; |
154 | }; |
155 | }; |
- | 156 | :dword __DIR::position(dword i) |
|
- | 157 | { |
|
- | 158 | return i*304+buffer+72; |
|
- | 159 | } |
|
155 | :int __DIR::make(dword new_folder_path) |
160 | :int __DIR::make(dword new_folder_path) |
156 | { |
161 | { |
157 | __file_F70.func = 9; |
162 | __file_F70.func = 9; |
158 | __file_F70.param1 = |
163 | __file_F70.param1 = |
159 | __file_F70.param2 = |
164 | __file_F70.param2 = |
160 | __file_F70.param3 = |
165 | __file_F70.param3 = |
161 | __file_F70.param4 = |
166 | __file_F70.param4 = |
162 | __file_F70.rezerv = 0; |
167 | __file_F70.rezerv = 0; |
163 | __file_F70.name = new_folder_path; |
168 | __file_F70.name = io.path.path(new_folder_path); |
164 | $mov eax,70 |
169 | $mov eax,70 |
165 | $mov ebx,#__file_F70.func |
170 | $mov ebx,#__file_F70.func |
166 | $int 0x40 |
171 | $int 0x40 |
167 | } |
172 | } |
Line 168... | Line 173... | ||
168 | 173 | ||
169 | :struct __PATH |
174 | :struct __PATH |
170 | { |
175 | { |
171 | dword file(...); |
176 | dword file(...); |
172 | dword path(...); |
177 | dword path(...); |
- | 178 | }; |
|
173 | }; |
179 | |
174 | :char __PATH_NEW[4096]; |
180 | :char __PATH_NEW[4096]; |
175 | :dword __PATH::path(dword PATH) |
181 | :dword __PATH::path(dword PATH) |
176 | { |
182 | { |
177 | dword _NPT; |
- | |
178 | _NPT = #__PATH_NEW; |
183 | dword pos = PATH; |
179 | if(DSBYTE[PATH]=='/') |
- | |
180 | { |
- | |
181 | if(strcmp(PATH,"sys/",4)) |
- | |
182 | if(strcmp(PATH,"hd/",3)) |
- | |
183 | if(strcmp(PATH,"rd/",3)) |
- | |
184 | if(strcmp(PATH,"tmp/",4)) |
- | |
185 | if(strcmp(PATH,"fd/",3)) |
- | |
186 | if(strcmp(PATH,"cd/",3)) sprintf(_NPT,"/%s%s","sys",PATH); |
- | |
187 | } |
- | |
188 | while(DSBYTE[_NPT]) |
- | |
189 | { |
- | |
190 | if(DSBYTE[_NPT]=='.') |
- | |
191 | { |
- | |
192 | if(DSBYTE[_NPT+1]=='.') |
- | |
193 | { |
- | |
194 | if(DSBYTE[_NPT+1]=='/') |
- | |
195 | { |
- | |
196 | - | ||
197 | } |
- | |
198 | } |
- | |
199 | else if(DSBYTE[_NPT+1]=='/') |
184 | if(DSBYTE[pos]=='/') |
200 | { |
185 | { |
- | 186 | pos++; |
|
- | 187 | if(!strncmp(pos,"sys/",4)) return PATH; |
|
- | 188 | if(!strncmp(pos,"hd/",3)) return PATH; |
|
- | 189 | if(!strncmp(pos,"fd/",3)) return PATH; |
|
- | 190 | if(!strncmp(pos,"rd/",3)) return PATH; |
|
- | 191 | if(!strncmp(pos,"tmp/",4)) return PATH; |
|
- | 192 | if(!strncmp(pos,"cd/",3)) return PATH; |
|
- | 193 | if(!strncmp(pos,"bd/",3)) return PATH; |
|
201 | _NPT++; |
194 | if(!strncmp(pos,"usbhd/",6)) return PATH; |
202 | sprintf(_NPT,"/%s%s","sys",_NPT); |
- | |
203 | } |
- | |
204 | } |
195 | sprintf(#__PATH_NEW,"/sys%s",PATH); |
205 | _NPT++; |
196 | return #__PATH_NEW; |
- | 197 | } |
|
- | 198 | if(!strncmp(PATH,"./",2)) return PATH; |
|
206 | } |
199 | sprintf(#__PATH_NEW,"%s/%s",__DIR__,PATH); |
207 | return _NPT; |
200 | return #__PATH_NEW; |
Line 208... | Line 201... | ||
208 | } |
201 | } |
209 | 202 | ||
210 | :dword __PATH::file(dword name) |
203 | :dword __PATH::file(dword name) |
Line 228... | Line 221... | ||
228 | dword file_name; |
221 | dword file_name; |
229 | double size(...); |
222 | double size(...); |
230 | dword get_size_dir(dword name); |
223 | dword get_size_dir(dword name); |
231 | signed count(dword path); |
224 | signed count(dword path); |
232 | dword dir_buffer(dword path;byte options); |
225 | dword dir_buffer(dword path;byte options); |
233 | dword dir_position(dword pos); |
- | |
234 | signed int run(dword path,param); |
226 | signed int run(dword path,param); |
235 | byte del(...); |
227 | byte del(...); |
236 | dword read(...); |
228 | dword read(...); |
237 | int write(...); |
229 | int write(...); |
238 | byte copy(...); |
230 | byte copy(...); |
Line 249... | Line 241... | ||
249 | :dword IO::convert_size() |
241 | :dword IO::convert_size() |
250 | { |
242 | { |
251 | byte size_nm[3]; |
243 | byte size_nm[3]; |
252 | dword bytes; |
244 | dword bytes; |
253 | bytes = FILES_SIZE; |
245 | bytes = FILES_SIZE; |
254 | if (bytes>=1073741824) strncpy(#size_nm, __T__GB,2); |
246 | if (bytes>=1073741824) strlcpy(#size_nm, __T__GB,2); |
255 | else if (bytes>=1048576) strncpy(#size_nm, __T__MB,2); |
247 | else if (bytes>=1048576) strlcpy(#size_nm, __T__MB,2); |
256 | else if (bytes>=1024) strncpy(#size_nm, __T__KB,2); |
248 | else if (bytes>=1024) strlcpy(#size_nm, __T__KB,2); |
257 | else strncpy(#size_nm, __T___B,1); |
249 | else strlcpy(#size_nm, __T___B,1); |
258 | while (bytes>1023) bytes/=1024; |
250 | while (bytes>1023) bytes/=1024; |
259 | sprintf(#__ConvertSize_size_prefix,"%d %s",bytes,#size_nm); |
251 | sprintf(#__ConvertSize_size_prefix,"%d %s",bytes,#size_nm); |
260 | return #__ConvertSize_size_prefix; |
252 | return #__ConvertSize_size_prefix; |
261 | } |
253 | } |
Line 280... | Line 272... | ||
280 | __file_F70.param1 = |
272 | __file_F70.param1 = |
281 | __file_F70.param3 = |
273 | __file_F70.param3 = |
282 | __file_F70.param4 = |
274 | __file_F70.param4 = |
283 | __file_F70.rezerv = 0; |
275 | __file_F70.rezerv = 0; |
284 | __file_F70.param2 = rparam; |
276 | __file_F70.param2 = rparam; |
285 | __file_F70.name = rpath; |
277 | __file_F70.name = path.path(rpath); |
286 | $mov eax,70 |
278 | $mov eax,70 |
287 | $mov ebx,#__file_F70.func |
279 | $mov ebx,#__file_F70.func |
288 | $int 0x40 |
280 | $int 0x40 |
289 | } |
281 | } |
290 | :signed IO::count(dword PATH) |
282 | :signed IO::count(dword PATH) |
Line 295... | Line 287... | ||
295 | dir.count = ESDWORD[#buf+8]; |
287 | dir.count = ESDWORD[#buf+8]; |
296 | return dir.count; |
288 | return dir.count; |
297 | } |
289 | } |
298 | return -1; |
290 | return -1; |
299 | } |
291 | } |
300 | :dword IO::dir_position(dword pos) |
- | |
301 | { |
- | |
302 | return pos*304+dir.buffer+72; |
- | |
303 | } |
292 | |
304 | :dword IO::dir_buffer(dword PATH;byte options) |
293 | :dword IO::dir_buffer(dword PATH;byte options) |
305 | { |
294 | { |
306 | count(PATH); |
295 | count(PATH); |
307 | if(dir.count!=-1) |
296 | if(dir.count!=-1) |
308 | { |
297 | { |