mirror of
https://github.com/Michaelangel007/apple2_prodos_utils.git
synced 2024-05-28 12:41:35 +00:00
Cleanup hard-coded consts replace with PRODOS_ROOT_OFFSET
This commit is contained in:
parent
929fee853a
commit
ea38c4f782
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
void prodos_GetVolumeHeader( ProDOS_VolumeHeader_t *meta_, int block )
|
void prodos_GetVolumeHeader( ProDOS_VolumeHeader_t *meta_, int block )
|
||||||
{
|
{
|
||||||
int base = block*PRODOS_BLOCK_SIZE + 4; // skip prev/next dir block double linked list
|
int base = block*PRODOS_BLOCK_SIZE + 4; // skip prev/next dir block double linked list
|
||||||
ProDOS_VolumeHeader_t info;
|
ProDOS_VolumeHeader_t info;
|
||||||
|
|
||||||
info.kind = (gaDsk [ base + 0 ] >> 4) & 0xF;
|
info.kind = (gaDsk [ base + 0 ] >> 4) & 0xF;
|
||||||
|
@ -460,8 +460,12 @@ int prodos_DirGetFirstFree( ProDOS_VolumeHeader_t *volume, int base )
|
||||||
|
|
||||||
|
|
||||||
// @return 0 if couldn't find file, else offset
|
// @return 0 if couldn't find file, else offset
|
||||||
|
// Sets:
|
||||||
|
// gtLastDirFile
|
||||||
|
// gnLastDirBlock
|
||||||
|
// gnLastDirMaxFiles
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
int prodos_FindFile( ProDOS_VolumeHeader_t *volume, const char *path, int base = 0x400 )
|
int prodos_FindFile( ProDOS_VolumeHeader_t *volume, const char *path, int base = PRODOS_ROOT_OFFSET )
|
||||||
{
|
{
|
||||||
if( !path )
|
if( !path )
|
||||||
return base;
|
return base;
|
||||||
|
@ -572,7 +576,7 @@ next_file:
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
int prodos_BlockGetPath( const char *path )
|
int prodos_BlockGetPath( const char *path )
|
||||||
{
|
{
|
||||||
int offset = PRODOS_ROOT_BLOCK*PRODOS_BLOCK_SIZE; // Block 2 * 0x200 Bytes/Block = 0x400 abs offset
|
int offset = PRODOS_ROOT_OFFSET; // Block 2 * 0x200 Bytes/Block = 0x400 abs offset
|
||||||
|
|
||||||
// Scan Directory ...
|
// Scan Directory ...
|
||||||
strcpy( gpLastDirName, gVolume.name );
|
strcpy( gpLastDirName, gVolume.name );
|
||||||
|
@ -679,12 +683,12 @@ bool ProDOS_GetVolumeName( char *pVolume_ )
|
||||||
{
|
{
|
||||||
bool bValid = false;
|
bool bValid = false;
|
||||||
|
|
||||||
int vol_length = gaDsk[ 0x404 ] & 0xF;
|
int vol_length = gaDsk[ PRODOS_ROOT_OFFSET + 4 ] & 0xF;
|
||||||
|
|
||||||
if( vol_length < 16 )
|
if( vol_length < 16 )
|
||||||
{
|
{
|
||||||
for( int i = 0; i < vol_length; i++ )
|
for( int i = 0; i < vol_length; i++ )
|
||||||
*pVolume_++ = gaDsk[ 0x405 + i ];
|
*pVolume_++ = gaDsk[ PRODOS_ROOT_OFFSET + 5 + i ];
|
||||||
}
|
}
|
||||||
|
|
||||||
*pVolume_ = 0;
|
*pVolume_ = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user