Rev 3500 | Rev 4287 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3500 | Rev 3555 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | ;; (C) 2004 Ville Turjanmaa, License: GPL ;; |
7 | ;; (C) 2004 Ville Turjanmaa, License: GPL ;; |
8 | ;; Addings by M.Lisovin ;; |
8 | ;; Addings by M.Lisovin ;; |
9 | ;; LFN support by diamond ;; |
9 | ;; LFN support by diamond ;; |
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 11... | Line 11... | ||
11 | 11 | ||
Line 12... | Line 12... | ||
12 | $Revision: 3500 $ |
12 | $Revision: 3555 $ |
Line 13... | Line 13... | ||
13 | 13 | ||
Line 344... | Line 344... | ||
344 | jb .rus2 |
344 | jb .rus2 |
345 | .unk: |
345 | .unk: |
346 | mov al, '_' |
346 | mov al, '_' |
347 | jmp .doit |
347 | jmp .doit |
348 | .yo1: |
348 | .yo1: |
349 | mov al, 'ð' |
349 | mov al, 0xF0 ; 'Ё' |
350 | jmp .doit |
350 | jmp .doit |
351 | .yo2: |
351 | .yo2: |
352 | mov al, 'ñ' |
352 | mov al, 0xF1 ; 'ё' |
353 | jmp .doit |
353 | jmp .doit |
354 | .rus1: |
354 | .rus1: |
355 | ; 0x410-0x43F -> 0x80-0xAF |
355 | ; 0x410-0x43F -> 0x80-0xAF |
356 | add al, 0x70 |
356 | add al, 0x70 |
357 | jmp .doit |
357 | jmp .doit |
Line 387... | Line 387... | ||
387 | add ax, 0x440-0xE0 |
387 | add ax, 0x440-0xE0 |
388 | ret |
388 | ret |
389 | ; 0xF0 -> 0x401 |
389 | ; 0xF0 -> 0x401 |
390 | ; 0xF1 -> 0x451 |
390 | ; 0xF1 -> 0x451 |
391 | @@: |
391 | @@: |
392 | cmp al, 'ð' |
392 | cmp al, 0xF0 ; 'Ё' |
393 | jz .yo1 |
393 | jz .yo1 |
394 | cmp al, 'ñ' |
394 | cmp al, 0xF1 ; 'ё' |
395 | jz .yo2 |
395 | jz .yo2 |
396 | .unk: |
396 | .unk: |
397 | mov al, '_' ; ah=0 |
397 | mov al, '_' ; ah=0 |
398 | ret |
398 | ret |
399 | .yo1: |
399 | .yo1: |
Line 409... | Line 409... | ||
409 | ; out: al=converted symbol |
409 | ; out: al=converted symbol |
410 | cmp al, 'a' |
410 | cmp al, 'a' |
411 | jb .ret |
411 | jb .ret |
412 | cmp al, 'z' |
412 | cmp al, 'z' |
413 | jbe .az |
413 | jbe .az |
414 | cmp al, 'ñ' |
414 | cmp al, 0xF1 ; 'ё' |
415 | jz .yo1 |
415 | jz .yo1 |
416 | cmp al, ' ' |
416 | cmp al, 0xA0 ; 'а' |
417 | jb .ret |
417 | jb .ret |
418 | cmp al, 'à' |
418 | cmp al, 0xE0 ; 'р' |
419 | jb .rus1 |
419 | jb .rus1 |
420 | cmp al, 'ï' |
420 | cmp al, 0xEF ; 'я' |
421 | ja .ret |
421 | ja .ret |
422 | ; 0xE0-0xEF -> 0x90-0x9F |
422 | ; 0xE0-0xEF -> 0x90-0x9F |
423 | sub al, 'à'-'' |
423 | sub al, 0xE0-0x90 |
424 | .ret: |
424 | .ret: |
425 | ret |
425 | ret |
426 | .rus1: |
426 | .rus1: |
427 | ; 0xA0-0xAF -> 0x80-0x8F |
427 | ; 0xA0-0xAF -> 0x80-0x8F |
428 | .az: |
428 | .az: |
Line 1599... | Line 1599... | ||
1599 | @@: |
1599 | @@: |
1600 | inc ecx |
1600 | inc ecx |
1601 | cmp ecx, eax |
1601 | cmp ecx, eax |
1602 | jb .scan_cont |
1602 | jb .scan_cont |
1603 | ; found! |
1603 | ; found! |
- | 1604 | ; If creating a directory, allocate one data cluster now and fail immediately |
|
- | 1605 | ; if this is impossible. This prevents from creating an invalid directory entry |
|
1604 | ; calculate name checksum |
1606 | ; on a full disk. |
- | 1607 | ; yup, the argument is quite non-intuitive... but what should I do if |
|
- | 1608 | ; the entire function uses such arguments? BTW, it refers to al from pushad, |
|
- | 1609 | ; which in turn is filled with 0 in fs_RamdiskRewrite and 1 in fs_RamdiskCreateFolder. |
|
1605 | push esi ecx |
1610 | push esi ecx |
- | 1611 | cmp byte [esp+24+12+20+28], 0 |
|
- | 1612 | jz .no.preallocate.folder.data |
|
- | 1613 | mov ecx, 2849 |
|
- | 1614 | mov edi, RAMDISK_FAT |
|
- | 1615 | xor eax, eax |
|
- | 1616 | repnz scasw |
|
- | 1617 | jz @f |
|
- | 1618 | add esp, 24 |
|
- | 1619 | jmp .disk_full |
|
- | 1620 | @@: |
|
- | 1621 | mov [esp+24+12+20+20], edi ; store the cluster somewhere |
|
- | 1622 | .no.preallocate.folder.data: |
|
- | 1623 | ; calculate name checksum |
|
1606 | mov esi, [esp+8+8] |
1624 | mov esi, [esp+8+8] |
1607 | mov ecx, 11 |
1625 | mov ecx, 11 |
1608 | xor eax, eax |
1626 | xor eax, eax |
1609 | @@: |
1627 | @@: |
1610 | ror al, 1 |
1628 | ror al, 1 |
Line 1670... | Line 1688... | ||
1670 | jz .doit |
1688 | jz .doit |
1671 | ; create directory |
1689 | ; create directory |
1672 | mov byte [edi+11], 10h ; attributes: folder |
1690 | mov byte [edi+11], 10h ; attributes: folder |
1673 | mov ecx, 32*2 |
1691 | mov ecx, 32*2 |
1674 | mov edx, edi |
1692 | mov edx, edi |
- | 1693 | push edx |
|
- | 1694 | push ecx |
|
- | 1695 | push edi |
|
- | 1696 | add edi, 26 ; edi points to low word of cluster |
|
- | 1697 | push edi |
|
- | 1698 | mov edi, [esp+16+20+20] |
|
- | 1699 | jmp .doit2 |
|
1675 | .doit: |
1700 | .doit: |
1676 | push edx |
1701 | push edx |
1677 | push ecx |
1702 | push ecx |
1678 | push edi |
1703 | push edi |
1679 | add edi, 26 ; edi points to low word of cluster |
1704 | add edi, 26 ; edi points to low word of cluster |
Line 1684... | Line 1709... | ||
1684 | .write_loop: |
1709 | .write_loop: |
1685 | ; allocate new cluster |
1710 | ; allocate new cluster |
1686 | xor eax, eax |
1711 | xor eax, eax |
1687 | repnz scasw |
1712 | repnz scasw |
1688 | jnz .disk_full2 |
1713 | jnz .disk_full2 |
- | 1714 | .doit2: |
|
1689 | dec edi |
1715 | dec edi |
1690 | dec edi |
1716 | dec edi |
Line 1691... | Line 1717... | ||
1691 | 1717 |