------------------------------------------------------------------------
| 457 | |
| 458 | // ------------------------------------------------------------------------ |
| 459 | void ProDOS_SetVolumeHeader ( uint8_t *pDiskBytes, ProDOS_VolumeHeader_t *pVolume, int iBlock ) |
| 460 | { |
| 461 | if( !pVolume ) |
| 462 | return; |
| 463 | |
| 464 | int base = iBlock*PRODOS_BLOCK_SIZE + 4; // skip prev/next dir block double linked list |
| 465 | |
| 466 | uint8_t KindLen = 0 |
| 467 | | ((pVolume->kind & 0xF) << 4) |
| 468 | | ((pVolume->len & 0xF) << 0) |
| 469 | ; |
| 470 | |
| 471 | pDiskBytes[ base + 0 ] = KindLen; |
| 472 | |
| 473 | for( int i = 0; i < pVolume->len; i++ ) |
| 474 | pDiskBytes[ base+ 1+i ] = pVolume->name[ i ]; |
| 475 | |
| 476 | for( int i = 0; i < 8; i++ ) |
| 477 | pDiskBytes[ base+16+i ] = pVolume->pad8[ i ]; |
| 478 | |
| 479 | ProDOS_Put16( pDiskBytes, base + 24 , pVolume->date ); |
| 480 | ProDOS_Put16( pDiskBytes, base + 26 , pVolume->time ); |
| 481 | pDiskBytes[ base + 28 ] = pVolume->cur_ver ; |
| 482 | pDiskBytes[ base + 29 ] = pVolume->min_ver ; |
| 483 | pDiskBytes[ base + 30 ] = pVolume->access ; |
| 484 | pDiskBytes[ base + 31 ] = pVolume->entry_len; |
| 485 | pDiskBytes[ base + 32 ] = pVolume->entry_num; |
| 486 | ProDOS_Put16( pDiskBytes, base + 33 , pVolume->file_count ); |
| 487 | ProDOS_Put16( pDiskBytes, base + 35 , pVolume->meta.bitmap_block ); |
| 488 | ProDOS_Put16( pDiskBytes, base + 37 , pVolume->meta.total_blocks ); |
| 489 | } |
| 490 | |
| 491 | // --- ProDOS File Functions --- |
| 492 |
no test coverage detected