mirror of
https://github.com/elua/elua.git
synced 2025-01-25 01:02:54 +08:00
Changed the ROMFS terminator char
The ROMFS termination char is now 0xFF instead of 0x00 (in preparation of WOFS).
This commit is contained in:
parent
ed54aec47a
commit
01a8dcd9a5
4
mkfs.py
4
mkfs.py
@ -133,8 +133,8 @@ def mkfs( dirname, outname, flist, mode, compcmd ):
|
|||||||
# Report
|
# Report
|
||||||
print "Encoded file %s (%d bytes real size, %d bytes after rounding, %d bytes total)" % ( fname, len( filedata ), actual, _fcnt )
|
print "Encoded file %s (%d bytes real size, %d bytes after rounding, %d bytes total)" % ( fname, len( filedata ), actual, _fcnt )
|
||||||
|
|
||||||
# All done, write the final "0" (terminator)
|
# All done, write the final "0xFF" (terminator)
|
||||||
_add_data( 0, outfile, False )
|
_add_data( 0xFF, outfile, False )
|
||||||
outfile.write( "};\n\n#endif\n" );
|
outfile.write( "};\n\n#endif\n" );
|
||||||
outfile.close()
|
outfile.close()
|
||||||
print "Done, total size is %d bytes" % _bytecnt
|
print "Done, total size is %d bytes" % _bytecnt
|
||||||
|
@ -48,18 +48,15 @@ static u8 romfs_open_file( const char* fname, u8 *pbase, FD* pfd )
|
|||||||
i = 0;
|
i = 0;
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
|
if( pbase[ i ] == 0xFF )
|
||||||
|
return FS_FILE_NOT_FOUND;
|
||||||
// Read file name
|
// Read file name
|
||||||
for( j = 0; j < DM_MAX_FNAME_LENGTH; j ++ )
|
for( j = 0; j < DM_MAX_FNAME_LENGTH; j ++ )
|
||||||
{
|
{
|
||||||
fsname[ j ] = pbase[ i + j ];
|
fsname[ j ] = pbase[ i + j ];
|
||||||
if( fsname[ j ] == 0 )
|
if( fsname[ j ] == 0 )
|
||||||
{
|
|
||||||
if( j == 0 )
|
|
||||||
return FS_FILE_NOT_FOUND;
|
|
||||||
else
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// ' i + j' now points at the '0' byte
|
// ' i + j' now points at the '0' byte
|
||||||
j = i + j + 1;
|
j = i + j + 1;
|
||||||
// And read the size
|
// And read the size
|
||||||
@ -182,7 +179,7 @@ static struct dm_dirent* romfs_readdir_r( struct _reent *r, void *d, void *pdata
|
|||||||
FSDATA *pfsdata = ( FSDATA* )pdata;
|
FSDATA *pfsdata = ( FSDATA* )pdata;
|
||||||
u8 *pbase = pfsdata->pbase;
|
u8 *pbase = pfsdata->pbase;
|
||||||
|
|
||||||
if( pbase[ off ] == 0 )
|
if( pbase[ off ] == 0xFF )
|
||||||
return NULL;
|
return NULL;
|
||||||
while( ( dm_shared_fname[ j ++ ] = pbase[ off ++ ] ) != '\0' );
|
while( ( dm_shared_fname[ j ++ ] = pbase[ off ++ ] ) != '\0' );
|
||||||
pent->fname = dm_shared_fname;
|
pent->fname = dm_shared_fname;
|
||||||
|
@ -143,8 +143,8 @@ function mkfs( dirname, outname, flist, mode, compcmd )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- All done, write the final "0" (terminator)
|
-- All done, write the final "0xFF" (terminator)
|
||||||
_add_data( 0, outfile, false )
|
_add_data( 0xFF, outfile, false )
|
||||||
outfile:write( "};\n\n#endif\n" );
|
outfile:write( "};\n\n#endif\n" );
|
||||||
outfile:close()
|
outfile:close()
|
||||||
print( sf( "Done, total size is %d bytes", _bytecnt ) )
|
print( sf( "Done, total size is %d bytes", _bytecnt ) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user