72 |
|
fsAllocateVCB = 562, // UTAllocateVCB(uint16 *sysVCBLength{a0}, uint32 *vcb{a1}) |
73 |
|
fsAddNewVCB = 578, // UTAddNewVCB(int drive_number{d0}, int16 *vRefNum{a1}, uint32 vcb{a1}) |
74 |
|
fsDetermineVol = 594, // UTDetermineVol(uint32 pb{a0}, int16 *status{a1}, int16 *more_matches{a2}, int16 *vRefNum{a3}, uint32 *vcb{a4}) |
75 |
< |
fsResolveWDCB = 614, // UTResolveWDCB(int16 vRefNum{d0}, uint32 *wdcb{a0}) |
75 |
> |
fsResolveWDCB = 614, // UTResolveWDCB(uint32 procID{d0}, int16 index{d1}, int16 vRefNum{d0}, uint32 *wdcb{a0}) |
76 |
|
fsGetDefaultVol = 632, // UTGetDefaultVol(uint32 wdpb{a0}) |
77 |
|
fsGetPathComponentName = 644, // UTGetPathComponentName(uint32 rec{a0}) |
78 |
|
fsParsePathname = 656, // UTParsePathname(uint32 *start{a0}, uint32 name{a1}) |
201 |
|
* Get full path (->full_path) for given FSItem |
202 |
|
*/ |
203 |
|
|
204 |
– |
const int MAX_PATH_LENGTH = 1024; |
204 |
|
static char full_path[MAX_PATH_LENGTH]; |
205 |
|
|
206 |
|
static void add_path_comp(const char *s) |
207 |
|
{ |
208 |
< |
add_path_component(full_path, s, MAX_PATH_LENGTH); |
208 |
> |
add_path_component(full_path, s); |
209 |
|
} |
210 |
|
|
211 |
|
static void get_path_for_fsitem(FSItem *p) |
462 |
|
if (p - fs_data != fsResolveWDCB) |
463 |
|
goto fsdat_error; |
464 |
|
WriteMacInt16(p, 0x4267); p+= 2; // clr.w -(sp) |
465 |
< |
WriteMacInt16(p, 0x42a7); p+= 2; // clr.l -(sp) |
466 |
< |
WriteMacInt16(p, 0x4267); p+= 2; // clr.w -(sp) |
467 |
< |
WriteMacInt16(p, 0x3f00); p+= 2; // move.w d0,-(sp) |
465 |
> |
WriteMacInt16(p, 0x2f00); p+= 2; // move.l d0,-(sp) |
466 |
> |
WriteMacInt16(p, 0x3f01); p+= 2; // move.w d1,-(sp) |
467 |
> |
WriteMacInt16(p, 0x3f02); p+= 2; // move.w d2,-(sp) |
468 |
|
WriteMacInt16(p, 0x2f08); p+= 2; // move.l a0,-(sp) |
469 |
|
WriteMacInt16(p, 0x700e); p+= 2; // UTResolveWDCB |
470 |
|
WriteMacInt16(p, 0xa824); p+= 2; // FSMgr |
732 |
|
current_dir = dirID; |
733 |
|
else { |
734 |
|
D(bug(" resolving WDCB\n")); |
735 |
< |
r.d[0] = ReadMacInt16(pb + ioVRefNum); |
735 |
> |
r.d[0] = 0; |
736 |
> |
r.d[1] = 0; |
737 |
> |
r.d[2] = ReadMacInt16(pb + ioVRefNum); |
738 |
|
r.a[0] = fs_data + fsReturn; |
739 |
|
Execute68k(fs_data + fsResolveWDCB, &r); |
740 |
|
uint32 wdcb = ReadMacInt32(fs_data + fsReturn); |
1154 |
|
D(bug(" fs_get_file_info(%08lx), vRefNum %d, name %.31s, idx %d, dirID %d\n", pb, ReadMacInt16(pb + ioVRefNum), Mac2HostAddr(ReadMacInt32(pb + ioNamePtr) + 1), ReadMacInt16(pb + ioFDirIndex), dirID)); |
1155 |
|
|
1156 |
|
FSItem *fs_item; |
1157 |
< |
int16 dir_index = (int16)ReadMacInt16(pb + ioFDirIndex); |
1157 |
> |
int16 dir_index = ReadMacInt16(pb + ioFDirIndex); |
1158 |
|
if (dir_index <= 0) { // Query item specified by ioDirID and ioNamePtr |
1159 |
|
|
1160 |
|
// Find FSItem for given file |
1275 |
|
D(bug(" fs_get_cat_info(%08lx), vRefNum %d, name %.31s, idx %d, dirID %d\n", pb, ReadMacInt16(pb + ioVRefNum), Mac2HostAddr(ReadMacInt32(pb + ioNamePtr) + 1), ReadMacInt16(pb + ioFDirIndex), ReadMacInt32(pb + ioDirID))); |
1276 |
|
|
1277 |
|
FSItem *fs_item; |
1278 |
< |
int16 dir_index = (int16)ReadMacInt16(pb + ioFDirIndex); |
1278 |
> |
int16 dir_index = ReadMacInt16(pb + ioFDirIndex); |
1279 |
|
if (dir_index < 0) { // Query directory specified by ioDirID |
1280 |
|
|
1281 |
|
// Find FSItem for directory |
2008 |
|
D(bug(" allocating WDCB\n")); |
2009 |
|
r.a[0] = pb; |
2010 |
|
Execute68k(fs_data + fsAllocateWDCB, &r); |
2011 |
< |
D(bug(" UTAllocateWDCB returned %d\n", r.d[0])); |
2011 |
> |
D(bug(" UTAllocateWDCB returned %d, refNum is %d\n", r.d[0], ReadMacInt16(pb + ioVRefNum))); |
2012 |
|
return r.d[0]; |
2013 |
|
} |
2014 |
|
|