MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / ProDOS_BlockSetUsed

Function ProDOS_BlockSetUsed

source/ProDOS_FileSystem.h:312–330  ·  view source on GitHub ↗

------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

310
311 // ------------------------------------------------------------------------
312 bool ProDOS_BlockSetUsed ( uint8_t *pDiskBytes, ProDOS_VolumeHeader_t *pVolume, int block )
313 {
314 if( !pVolume )
315 {
316 return false;
317 }
318
319 int bitmap = pVolume->meta.bitmap_block;
320 int offset = bitmap * PRODOS_BLOCK_SIZE;
321
322 int byte = block / 8;
323 int bits = block % 8;
324 int mask = 0x80 >> bits;
325
326 pDiskBytes[ offset + byte ] |= mask;
327 pDiskBytes[ offset + byte ] ^= mask;
328
329 return true;
330 }
331
332 // ------------------------------------------------------------------------
333 inline int ProDOS_GetIndexBlock ( uint8_t *pDiskBytes, int offset, int index )

Callers 2

Util_ProDOS_AddFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected