Add DskGetIndexBlock(), DskPutIndexBlock() prodos helpers

This commit is contained in:
Michaelangel007 2017-11-07 08:43:09 -08:00
parent 866304d006
commit b31fd85c18
1 changed files with 19 additions and 0 deletions

View File

@ -58,6 +58,25 @@
gaDsk[ offset + 2 ] = (val >>16) & 0xFF;
}
int DskGetIndexBlock( int offset, int index )
{
int block = 0
| (gaDsk[ offset + index + 0 ] << 0)
| (gaDsk[ offset + index + 256 ] << 8)
;
return block;
}
/*
000:lo0 lo1 lo2 ...
100:hi0 hi1 hi2 ...
*/
void DskPutIndexBlock( int offset, int index, int block )
{
gaDsk[ offset + index + 0 ] = (block >> 0) & 0xFF;
gaDsk[ offset + index + 256 ] = (block >> 8) & 0xFF;
}
// --- Name ---