Compare commits
9 Commits
cleanup/er
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc19fc3cbe | ||
|
|
1e0e0a951f | ||
|
|
b9780d319f | ||
|
|
abbabdb9e2 | ||
|
|
c292eb2196 | ||
|
|
596ede1923 | ||
|
|
830c43db17 | ||
|
|
abbe3720f1 | ||
|
|
009471782a |
10
configure.py
10
configure.py
@@ -1698,7 +1698,7 @@ config.libs = [
|
||||
Object(NonMatching, "fa/pf_entry_iterator.c"),
|
||||
Object(NonMatching, "fa/pf_fat.c"),
|
||||
Object(NonMatching, "fa/pf_fat12.c"),
|
||||
Object(NonMatching, "fa/pf_fat16.c"),
|
||||
Object(Matching, "fa/pf_fat16.c"),
|
||||
Object(Matching, "fa/pf_fat32.c"),
|
||||
Object(Matching, "fa/pf_fatfs.c"),
|
||||
Object(NonMatching, "fa/pf_file.c"),
|
||||
@@ -1706,7 +1706,7 @@ config.libs = [
|
||||
Object(Matching, "fa/pf_sector.c"),
|
||||
Object(NonMatching, "fa/pf_volume.c"),
|
||||
Object(Matching, "fa/pf_volume_apiadd.c"),
|
||||
Object(NonMatching, "fa/pf_cp932.c"),
|
||||
Object(Matching, "fa/pf_cp932.c"),
|
||||
Object(Matching, "fa/pf_api_util.c"),
|
||||
Object(Matching, "fa/pf_attach.c"),
|
||||
Object(Matching, "fa/pf_buffering.c"),
|
||||
@@ -1800,7 +1800,7 @@ config.libs = [
|
||||
Object(Matching, "fa/pf_w_rmdir.c"),
|
||||
Object(Matching, "fa/pf_w_xdivide.c"),
|
||||
Object(Matching, "fa/pf_filelock.c"),
|
||||
Object(NonMatching, "fa/pf_stub.c"),
|
||||
Object(Matching, "fa/pf_stub.c"),
|
||||
Object(Matching, "fa/pf_system.c"),
|
||||
Object(Matching, "fa/pf_stub_standard.c"),
|
||||
Object(Matching, "fa/pfs_attach.c"),
|
||||
@@ -1851,11 +1851,11 @@ config.libs = [
|
||||
Object(Matching, "fa/api/FASetThreadPriority.c"),
|
||||
Object(Matching, "fa/api/FAUnmount.c"),
|
||||
|
||||
Object(NonMatching, "fa/kernel/pfk_api.c"),
|
||||
Object(Matching, "fa/kernel/pfk_api.c"),
|
||||
|
||||
Object(NonMatching, "fa/driver/nand_drv.c"),
|
||||
Object(NonMatching, "fa/driver/sd_drv.c"),
|
||||
Object(NonMatching, "fa/driver/pfd_cmn.c"),
|
||||
Object(Matching, "fa/driver/pfd_cmn.c"),
|
||||
Object(NonMatching, "fa/driver/msc_drv.c"),
|
||||
|
||||
Object(NonMatching, "fa/msc/puh_msc.c"),
|
||||
|
||||
@@ -318,10 +318,11 @@ s32 pfd_sddrv_init(FADisk* disk) {
|
||||
}
|
||||
if ((pfd_sddrv_flags(&g_pfd_sddrv_info) & 1) != 0) {
|
||||
OSReport("INFO SD Card driver is already initialize. pfd_sddrv_init()\n");
|
||||
sd_result = -44;
|
||||
if (disk == g_pfd_sddrv_info.disk) {
|
||||
return 0;
|
||||
sd_result = 0;
|
||||
}
|
||||
return -44;
|
||||
return sd_result;
|
||||
}
|
||||
if ((g_pfd_sddrv_info.flags & 4) == 0) {
|
||||
g_pfd_sddrv_info.bytes_per_sector = 0x200;
|
||||
@@ -554,7 +555,7 @@ s32 pfd_sddrv_get_disk_info(FADisk* disk, FADiskInfo* disk_info) {
|
||||
disk_info->heads = 0;
|
||||
disk_info->sectorsPerTrack = 0;
|
||||
disk_info->formatParam = 0;
|
||||
return 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 pfd_sddrv_init_drv_tbl(FADiskTbl* disk_table, u32 extended) {
|
||||
@@ -1361,9 +1362,6 @@ s32 pfd_sddrv_store_fat32_bpb_buf(PFD_SDDRV_FORMAT_DATA* format_data, u8* sector
|
||||
static s32 pfd_sddrv_store_fat32_reserved_buf(u8* sector_buffer) {
|
||||
PFD_SDDRV_RESERVED_BOOT_SECTOR* reserved_boot_sector;
|
||||
|
||||
if (sector_buffer == 0) {
|
||||
return -30;
|
||||
}
|
||||
pf_memset(sector_buffer, 0, 0x200);
|
||||
reserved_boot_sector = (PFD_SDDRV_RESERVED_BOOT_SECTOR*)sector_buffer;
|
||||
if (((u32)reserved_boot_sector->signature.bytes & 1) != 0) {
|
||||
|
||||
@@ -10,24 +10,34 @@ pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mb
|
||||
pf_s16 index;
|
||||
pf_u32 start[4];
|
||||
pf_u32 count[4];
|
||||
pf_u32* p_start;
|
||||
pf_u32* p_count;
|
||||
*p_is_mbr = 0;
|
||||
if (buf[510] != 0x55 || buf[511] != 0xAA) { return 2; }
|
||||
p_start = start;
|
||||
p_count = count;
|
||||
for (index = 0; index < 4; index++) {
|
||||
start[index] = 0;
|
||||
start[index] = (((pf_u32)buf[456] << 16) + buf[454]) + (((pf_u32)buf[457] << 24) + ((pf_u32)buf[455] << 8));
|
||||
count[index] = (((pf_u32)buf[460] << 16) + buf[458]) + (((pf_u32)buf[461] << 24) + ((pf_u32)buf[459] << 8));
|
||||
if (start[index] != 0 && count[index] != 0) {
|
||||
*p_start = 0;
|
||||
*p_start = (((pf_u32)buf[456] << 16) + buf[454]) + (((pf_u32)buf[457] << 24) + ((pf_u32)buf[455] << 8));
|
||||
*p_count = (((pf_u32)buf[460] << 16) + buf[458]) + (((pf_u32)buf[461] << 24) + ((pf_u32)buf[459] << 8));
|
||||
if (*p_start != 0 && *p_count != 0) {
|
||||
if (index == 0) { *p_is_mbr = 1; }
|
||||
} else {
|
||||
if (index == 0) { return 2; }
|
||||
}
|
||||
p_start++;
|
||||
p_count++;
|
||||
buf += 16;
|
||||
}
|
||||
p_start = start;
|
||||
p_count = count;
|
||||
for (index = 0; index < 4; index++) {
|
||||
if (start[index] + count[index] > total) {
|
||||
if (*p_start + *p_count > total) {
|
||||
if (index == 0) { *p_is_mbr = 0; }
|
||||
return 2;
|
||||
}
|
||||
p_start++;
|
||||
p_count++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -370,8 +370,9 @@ pf_s32 PFCLUSTER_CombineFiles(PFCLUSTER_ENT_ITER* p_first_iter, PFCLUSTER_ENT_IT
|
||||
if (*p_second_iter->ffd.p_start_cluster != 0) {
|
||||
second_spare_clusters = p_second_iter->ffd.last_cluster.max_chain_index + 1 - second_used_clusters;
|
||||
}
|
||||
if (-1U / cluster_size + 1 < (second_used_clusters + second_spare_clusters) + first_used_clusters) {
|
||||
excess_clusters = (second_used_clusters + second_spare_clusters) + first_used_clusters - (-1U / cluster_size + 1);
|
||||
excess_clusters = (second_used_clusters + second_spare_clusters) + first_used_clusters;
|
||||
if (-1U / cluster_size + 1 < excess_clusters) {
|
||||
excess_clusters -= -1U / cluster_size + 1;
|
||||
err = PFFAT_TraceClustersChain(&p_second_iter->ffd, second_spare_cluster,
|
||||
cluster_size * ((p_second_iter->ffd.last_cluster.max_chain_index + 1 - excess_clusters) - second_used_clusters),
|
||||
&end_cluster, &spare_cluster);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#define PF_FA_CP932_TABLE
|
||||
#define VFiPFCODE_CP932_OEM2Unicode PFCODE_CP932_OEM2Unicode
|
||||
#define VFiPFCODE_CP932_OEMCharWidth PFCODE_CP932_OEMCharWidth
|
||||
#define VFiPFCODE_CP932_Unicode2OEM PFCODE_CP932_Unicode2OEM
|
||||
|
||||
@@ -144,7 +144,7 @@ static inline pf_u32 current_directory_is_open(PF_VOLUME* volume, pf_u32 cluster
|
||||
pf_u32 index;
|
||||
for (index = 0; index < 4; index++) {
|
||||
if (pf_vol_set.volume_state.volumes[index].p_vol == volume) {
|
||||
PFDIR_VOLUME_DIRS* state = (PFDIR_VOLUME_DIRS*)volume;
|
||||
PFDIR_VOLUME_DIRS* state = (PFDIR_VOLUME_DIRS*)pf_vol_set.volume_state.volumes[index].p_vol;
|
||||
PF_CUR_DIR* directory = state->current_dirs;
|
||||
pf_u32 slot;
|
||||
for (slot = 0; slot < 4; slot++, directory++) {
|
||||
@@ -381,7 +381,7 @@ pf_s32 PFDIR_p_readdir(PFDIR_DIR* dir, PFDIR_READ_RESULT* result) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern pf_s32 PFENT_findEntry(PFDIR_FFD*, PF_DIR_ENT*, pf_u32, PFDIR_STR*, pf_u8, pf_u32*, pf_u32*);
|
||||
extern pf_s32 PFENT_findEntry(PFDIR_FFD*, PF_DIR_ENT*, pf_u32, PFDIR_STR*, pf_u32, pf_u32);
|
||||
extern pf_s32 PFFAT_GetSectorSpecified(PFDIR_FFD*, pf_u32, pf_u32, pf_u32*);
|
||||
extern pf_s32 PFPATH_transformInUnicode(pf_u16*, const pf_s8*);
|
||||
extern void PFPATH_SetSearchPattern(pf_s8*, pf_u16*, PFDIR_STR*);
|
||||
@@ -453,7 +453,7 @@ extern pf_s32 PFENT_ITER_GetEntryOfPattern(PF_ENT_ITER* iter, PF_DIR_ENT* entry,
|
||||
extern pf_s32 PFENT_ITER_FindEntry(PF_ENT_ITER* iter, PF_DIR_ENT* entry, PFDIR_STR* pattern,
|
||||
pf_u8 attributes, pf_u32 start, pf_u32* found);
|
||||
extern pf_s32 PFENT_findEntry(PFDIR_FFD* ffd, PF_DIR_ENT* entry, pf_u32 start, PFDIR_STR* pattern,
|
||||
pf_u8 attributes, pf_u32* logical_position, pf_u32* entry_position);
|
||||
pf_u32 attributes, pf_u32 attr_forbidden);
|
||||
extern pf_u32 PFSTR_GetCodeMode(PFDIR_STR* path);
|
||||
extern const pf_s8* PFSTR_GetStrPos(PFDIR_STR* path, pf_u32 target);
|
||||
extern pf_s32 PFPATH_SplitPathPattern(PF_STR* path, PFDIR_STR* directory, PFDIR_STR* pattern);
|
||||
@@ -876,7 +876,7 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
pf_s32 filename_length;
|
||||
pf_s32 parse_error;
|
||||
pf_s32 allocation_error = 0;
|
||||
pf_s32 error;
|
||||
pf_s32 error = 0;
|
||||
pf_u32 index;
|
||||
PF_DIR_ENT* update_entry;
|
||||
|
||||
@@ -925,7 +925,7 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
}
|
||||
destination_entry.start_cluster = source_parent.start_cluster;
|
||||
PFFAT_InitFFD(&destination_iter.ffd, &destination_hint, volume, &destination_entry.start_cluster);
|
||||
error = PFENT_findEntry(&destination_iter.ffd, &destination_entry, 0, &destination_name, 0x7F, 0, 0);
|
||||
error = PFENT_findEntry(&destination_iter.ffd, &destination_entry, 0, &destination_name, 0x7F, 0);
|
||||
if (error == 0) { return 8; }
|
||||
if (error != 0 && error != 3) { return error; }
|
||||
if ((source_entry.attr & 0x10) == 0) {
|
||||
@@ -961,7 +961,8 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
destination_entry.num_entry_LFNs = 0;
|
||||
PFENT_getcurrentDateTimeForEnt(&destination_entry.access_date, &time);
|
||||
error = PFENT_updateEntry(&destination_entry, 1);
|
||||
goto finish_rename;
|
||||
if (error != 0) { allocation_error = error; return error; }
|
||||
return allocation_error;
|
||||
}
|
||||
if (source_entry.num_entry_LFNs != 0 && (source_entry.small_letter_flag & 0x18) == 0) {
|
||||
saved_initial_char = source_entry.long_name[0];
|
||||
@@ -1033,8 +1034,7 @@ pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
update_entry->entry_sector = sector;
|
||||
}
|
||||
error = PFENT_updateEntry(update_entry, 1);
|
||||
finish_rename:
|
||||
if (error != 0) { allocation_error = error; }
|
||||
if (error != 0) { return error; }
|
||||
return allocation_error;
|
||||
}
|
||||
pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
@@ -1070,7 +1070,7 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
|
||||
error = PFENT_ITER_GetEntryOfPath(&source_iter, &source_entry, volume, (PFDIR_STR*)old_path, 0);
|
||||
if (error != 0) { return error; }
|
||||
if (PFPATH_GetVolumeFromPath(new_path) != volume) { return 0x1F; }
|
||||
if (volume != PFPATH_GetVolumeFromPath(new_path)) { return 0x1F; }
|
||||
error = PFPATH_SplitPath((PFDIR_STR*)new_path, &directory, &destination_name);
|
||||
if (error != 0) { return error; }
|
||||
if (PFSTR_GetCodeMode(&destination_name) == 2) {
|
||||
@@ -1083,7 +1083,7 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
if (error != 0) { return error; }
|
||||
destination_entry.start_cluster = destination_parent.start_cluster;
|
||||
PFFAT_InitFFD(&destination_iter.ffd, &destination_hint, volume, &destination_entry.start_cluster);
|
||||
error = PFENT_findEntry(&destination_iter.ffd, &destination_entry, 0, &destination_name, 0x7F, 0, 0);
|
||||
error = PFENT_findEntry(&destination_iter.ffd, &destination_entry, 0, &destination_name, 0x7F, 0);
|
||||
if (error == 0) {
|
||||
if (destination_entry.entry_sector == source_entry.entry_sector &&
|
||||
destination_entry.entry_offset == source_entry.entry_offset) { return 0; }
|
||||
@@ -1120,7 +1120,7 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
PFFAT_InitFFD(&destination_iter.ffd, &destination_hint, volume, &destination_entry.start_cluster);
|
||||
PFSTR_InitStr(&parent_name, (const pf_s8*)"..", 1);
|
||||
PFSTR_SetLocalStr(&parent_name, 0);
|
||||
error = PFENT_findEntry(&destination_iter.ffd, &destination_entry, 0, &parent_name, 0x7F, 0, 0);
|
||||
error = PFENT_findEntry(&destination_iter.ffd, &destination_entry, 0, &parent_name, 0x7F, 0);
|
||||
if (error != 0) { return error; }
|
||||
parent_cluster = destination_entry.start_cluster;
|
||||
if (parent_cluster == 1 || parent_cluster == 0) { break; }
|
||||
@@ -1180,7 +1180,7 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
if (allocation_error != 0) {
|
||||
if (source_entry.num_entry_LFNs != 0 && (source_entry.small_letter_flag & 0x18) == 0) {
|
||||
source_entry.long_name[0] = saved_initial_char;
|
||||
source_entry.entry_offset -= (source_entry.num_entry_LFNs & 0xff) * 32;
|
||||
source_entry.entry_offset -= (pf_u16)(source_entry.num_entry_LFNs * 32);
|
||||
}
|
||||
update_entry = &source_entry;
|
||||
} else {
|
||||
@@ -1192,7 +1192,7 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
PFFAT_InitFFD(&source_iter.ffd, &source_hint, volume, &source_entry.start_cluster);
|
||||
PFSTR_InitStr(&parent_name, (const pf_s8*)"..", 1);
|
||||
PFSTR_SetLocalStr(&parent_name, 0);
|
||||
error = PFENT_findEntry(&source_iter.ffd, &source_entry, 0, &parent_name, 0x7F, 0, 0);
|
||||
error = PFENT_findEntry(&source_iter.ffd, &source_entry, 0, &parent_name, 0x7F, 0);
|
||||
if (error != 0) { return error; }
|
||||
if (destination_parent.start_cluster == 1 || destination_parent.start_cluster == 0 ||
|
||||
(destination_parent.start_cluster == 2 && volume->bpb.fat_type == FAT_32)) {
|
||||
@@ -1226,7 +1226,7 @@ pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
update_entry->entry_sector = sector;
|
||||
}
|
||||
error = PFENT_updateEntry(update_entry, 1);
|
||||
if (error != 0) { allocation_error = error; }
|
||||
if (error != 0) { return error; }
|
||||
return allocation_error;
|
||||
}
|
||||
|
||||
|
||||
@@ -728,20 +728,23 @@ pf_s32 PFENT_ITER_GetEntryOfIter(PFITER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent) {
|
||||
|
||||
pf_s32 PFENT_ITER_GetLFNEntryName(PFITER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent) {
|
||||
pf_u32 i;
|
||||
pf_u32 index;
|
||||
pf_s32 err;
|
||||
if (p_ent->num_entry_LFNs != 0 && !(p_ent->small_letter_flag & 0x18)) {
|
||||
index = 0;
|
||||
for (i = 0; i < p_ent->num_entry_LFNs; ++i) {
|
||||
pf_u16* destination;
|
||||
err = PFENT_ITER_Retreat(p_iter, 0);
|
||||
if (err != 0) return err;
|
||||
err = PFENT_ITER_LoadEntry(p_iter);
|
||||
if (err != 0) return err;
|
||||
destination = &p_ent->long_name[(i * 26U) / 2U];
|
||||
destination = &p_ent->long_name[index];
|
||||
pf_memcpy(destination, &p_iter->buf[1], 10);
|
||||
pf_memcpy(destination + 5, &p_iter->buf[14], 12);
|
||||
pf_memcpy(destination + 11, &p_iter->buf[28], 4);
|
||||
index += 13;
|
||||
}
|
||||
p_ent->long_name[(p_ent->num_entry_LFNs * 26U) / 2U] = 0;
|
||||
p_ent->long_name[index] = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1548,24 +1548,26 @@ s32 PFFAT_FreeChain(PFFAT_FFD* file, u32 startCluster, u32 chainIndex,
|
||||
0, 1, page);
|
||||
chainIndex++;
|
||||
} else {
|
||||
s32 writeError;
|
||||
currentPage = page;
|
||||
switch (volume->bpb.fat_type) {
|
||||
case FAT_12:
|
||||
error = PFFAT12_WriteFATEntryWithBuf(
|
||||
writeError = PFFAT12_WriteFATEntryWithBuf(
|
||||
volume, (u16)startCluster, 0, currentPage);
|
||||
break;
|
||||
case FAT_16:
|
||||
error = PFFAT16_WriteFATEntryWithBuf(volume, startCluster, 0,
|
||||
writeError = PFFAT16_WriteFATEntryWithBuf(volume, startCluster, 0,
|
||||
currentPage);
|
||||
break;
|
||||
case FAT_32:
|
||||
error = PFFAT32_WriteFATEntryWithBuf(volume, startCluster, 0,
|
||||
writeError = PFFAT32_WriteFATEntryWithBuf(volume, startCluster, 0,
|
||||
currentPage);
|
||||
break;
|
||||
default:
|
||||
error = 15;
|
||||
writeError = 15;
|
||||
break;
|
||||
}
|
||||
error = writeError;
|
||||
}
|
||||
if (error != 0) {
|
||||
PFCACHE_FreeDataPage(volume, page);
|
||||
|
||||
@@ -126,6 +126,7 @@ pf_s32 PFFAT12_WriteFATEntryWithBuf(PF_VOLUME* p_vol, pf_s16 cluster, pf_u16 val
|
||||
pf_s32 fat_offset;
|
||||
pf_u32 fat_sector;
|
||||
pf_s32 result;
|
||||
pf_u32 next_sector;
|
||||
fat_offset = (pf_u16)(cluster + (cluster >> 1));
|
||||
fat_sector = (pf_u16)(p_vol->bpb.active_FAT_sector + (fat_offset >> p_vol->bpb.log2_bytes_per_sector));
|
||||
offset_in_sector = fat_offset & (p_vol->bpb.bytes_per_sector - 1);
|
||||
@@ -146,10 +147,10 @@ pf_s32 PFFAT12_WriteFATEntryWithBuf(PF_VOLUME* p_vol, pf_s16 cluster, pf_u16 val
|
||||
p_page->p_buf[(pf_u16)offset_in_sector] = (p_page->p_buf[(pf_u16)offset_in_sector] & 0xF) | ((value << 4) & 0xF0);
|
||||
if ((pf_u16)offset_in_sector == (pf_u32)(p_vol->bpb.bytes_per_sector - 1)) {
|
||||
FLUSH_FAT_BUFFER();
|
||||
offset_in_sector = fat_sector + 1;
|
||||
err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, offset_in_sector, 0, p_vol->bpb.bytes_per_sector);
|
||||
next_sector = fat_sector + 1;
|
||||
err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, next_sector, 0, p_vol->bpb.bytes_per_sector);
|
||||
if (err != 0) { return err; }
|
||||
p_page->sector = offset_in_sector;
|
||||
p_page->sector = next_sector;
|
||||
p_page->p_buf[0] = value >> 4;
|
||||
} else {
|
||||
((pf_u16)offset_in_sector + p_page->p_buf)[1] = value >> 4;
|
||||
@@ -158,10 +159,10 @@ pf_s32 PFFAT12_WriteFATEntryWithBuf(PF_VOLUME* p_vol, pf_s16 cluster, pf_u16 val
|
||||
p_page->p_buf[(pf_u16)offset_in_sector] = value;
|
||||
if ((pf_u16)offset_in_sector == (pf_u32)(p_vol->bpb.bytes_per_sector - 1)) {
|
||||
FLUSH_FAT_BUFFER();
|
||||
offset_in_sector = fat_sector + 1;
|
||||
err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, offset_in_sector, 0, p_vol->bpb.bytes_per_sector);
|
||||
next_sector = fat_sector + 1;
|
||||
err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, next_sector, 0, p_vol->bpb.bytes_per_sector);
|
||||
if (err != 0) { return err; }
|
||||
p_page->sector = offset_in_sector;
|
||||
p_page->sector = next_sector;
|
||||
p_page->p_buf[0] = (p_page->p_buf[0] & 0xF0) | ((pf_u8)(value >> 8));
|
||||
} else {
|
||||
((pf_u16)offset_in_sector + p_page->p_buf)[1] = (((pf_u16)offset_in_sector + p_page->p_buf)[1] & 0xF0) | ((pf_u8)(value >> 8));
|
||||
|
||||
@@ -102,7 +102,7 @@ pf_s32 PFFAT16_WriteFATEntryWithBuf(PF_VOLUME* p_vol, pf_u32 cluster, pf_u32 val
|
||||
err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, fat_sector, 0, p_vol->bpb.bytes_per_sector);
|
||||
}
|
||||
p_page->p_buf[offset_in_sector] = value;
|
||||
(offset_in_sector + p_page->p_buf)[1] = value >> 8;
|
||||
p_page->p_buf[offset_in_sector + 1] = value >> 8;
|
||||
if (err != 0) {
|
||||
result = err;
|
||||
}
|
||||
|
||||
@@ -400,10 +400,10 @@ pf_s32 PFPATH_cmpNameImpl(const pf_s8* name, const pf_s8* pattern, pf_u32* match
|
||||
case '*': {
|
||||
do {
|
||||
pattern_width = volume->codeset.oem_char_width(pattern);
|
||||
if (pattern_width != 1) {
|
||||
read_char = (pf_u16)PF_GET_LE_U16((const pf_u8*)pattern);
|
||||
} else {
|
||||
if (pattern_width == 1) {
|
||||
read_char = pf_toupper(*pattern);
|
||||
} else {
|
||||
read_char = (pf_u16)PF_GET_LE_U16((const pf_u8*)pattern);
|
||||
}
|
||||
pattern_char = (pf_u16)read_char;
|
||||
pattern += pattern_width;
|
||||
|
||||
@@ -58,7 +58,7 @@ void* pfstub_entry(void* argument) {
|
||||
pf_vol_set.context_id = message->task_id;
|
||||
if (message->operation >= 0 && message->operation < 100) {
|
||||
pfstub_call_function_standard(message);
|
||||
} else if (received->operation >= 100 && received->operation < 200) {
|
||||
} else if (((s32*)received)[1] >= 100 && ((s32*)received)[1] < 200) {
|
||||
pfstub_call_function_unicode(message);
|
||||
} else {
|
||||
message->result.status = -1;
|
||||
|
||||
Reference in New Issue
Block a user