Class representing a single block on a C64 disk.
More...
#include <mkd64/block.h>
Detailed Description
Class representing a single block on a C64 disk.
Friends And Related Function Documentation
int Block_allocate |
( |
Block * |
self | ) |
|
|
related |
Allocate the current block.
ATTENTION: This does not check anything. Make sure you never allocate a block that is currently reserved by some other module. If you need a reserved block, ask for it using Block_unReserve()!
- Parameters
-
- Returns
- 1 on success, 0 on failure
uint8_t * Block_data |
( |
Block * |
self | ) |
|
|
related |
Get a pointer to the 254 bytes of data inside the block.
ATTENTION: You can call this for ANY block. Make sure you never modify block data allocated or reserved by some other module!
- Parameters
-
- Returns
- pointer to the data
int Block_free |
( |
Block * |
self | ) |
|
|
related |
Free the current block.
ATTENTION: This does not check anything. Make sure you never free a block you didn't allocate yourself!
- Parameters
-
- Returns
- 1 on success, 0 on failure
Get the position of the following block in the chain.
The BlockPosition pos is filled with the first two bytes of the block, which is the position of the next block for chained blocks.
- Parameters
-
uint8_t Block_nextSector |
( |
const Block * |
self | ) |
|
|
related |
Get sector number of the following block in the chain.
returns the second byte of the block, which is the sector number of the next block for chained blocks.
- Parameters
-
- Returns
- sector number of the next block
uint8_t Block_nextTrack |
( |
const Block * |
self | ) |
|
|
related |
Get track number of the following block in the chain.
returns the first byte of the block, which is the track number of the next block for chained blocks.
- Parameters
-
- Returns
- track number of the next block
Get position (track/sector) of the block.
- Parameters
-
- Returns
- the position of the block
uint8_t * Block_rawData |
( |
Block * |
self | ) |
|
|
related |
Get a pointer to the 256 bytes of raw data inside the block.
This includes the first two bytes that are normally used for chaining. ATTENTION: You can call this for ANY block. Make sure you never modify block data allocated or reserved by some other module!
- Parameters
-
- Returns
- pointer to the data
Reserve this block for later use.
- Parameters
-
self | the block |
by | pointer to the module reserving the block |
- Returns
- 1 on success, 0 on failure
Get module instance reserving the current block.
- Parameters
-
- Returns
- pointer to the module reserving this block, or 0 if not reserved
Set the position of the following block in the chain.
- Parameters
-
self | the block |
pos | the position of the next block in the chain |
void Block_setNextSector |
( |
Block * |
self, |
|
|
uint8_t |
nextSector |
|
) |
| |
|
related |
Set sector number of the following block in the chain.
- Parameters
-
self | the block |
nextSector | sector number of the next block in the chain |
void Block_setNextTrack |
( |
Block * |
self, |
|
|
uint8_t |
nextTrack |
|
) |
| |
|
related |
Set track number of the following block in the chain.
- Parameters
-
self | the block |
nextTrack | track number of the next block in the chain |
Get status of the block.
- Parameters
-
- Returns
- the current status
int Block_unReserve |
( |
Block * |
self | ) |
|
|
related |
Try to unreserve the block by asking the module to release it.
- Parameters
-
- Returns
- 1 on success, 0 on failure
The documentation for this class was generated from the following file: