Feature #73 » atx.c.patch
| atx.c 2018-09-02 22:27:39.547686394 +0200 | ||
|---|---|---|
|
//
|
||
|
//*****************************************************************************
|
||
|
#include <stdlib.h>
|
||
|
#include <util/delay.h>
|
||
|
#include "avrlibtypes.h"
|
||
|
#include "fat.h"
|
||
|
#include "atx_eclaire.h"
|
||
|
#include "atx.h"
|
||
|
// number of angular units in a full disk rotation
|
||
| ... | ... | |
|
u16 gBytesPerSector; // number of bytes per sector
|
||
|
u08 gSectorsPerTrack; // number of sectors in each track
|
||
|
struct atxTrackInfo gTrackInfo[2][40]; // pre-calculated info for each track and drive
|
||
|
struct atxTrackInfo gTrackInfo[NUM_ATX_DRIVES][40]; // pre-calculated info for each track and drive
|
||
|
// support slot D1 and D2 only because of insufficient RAM!
|
||
|
u16 gLastAngle = 0;
|
||
|
u08 gCurrentHeadTrack = 1;
|
||
|
u16 gLastAngle;
|
||
|
u08 gCurrentHeadTrack;
|
||
|
u16 loadAtxFile(u08 drive) {
|
||
|
struct atxFileHeader *fileHeader;
|
||
| ... | ... | |
|
for (i=0; i < sectorCount; i++) {
|
||
|
if (faccess_offset(FILE_ACCESS_READ, currentFileOffset, sizeof(struct atxSectorHeader))) {
|
||
|
sectorHeader = (struct atxSectorHeader *) atari_sector_buffer;
|
||
|
byteSwapAtxTrackChunk(sectorHeader);
|
||
|
byteSwapAtxSectorHeader(sectorHeader);
|
||
|
// if the sector number matches the one we're looking for...
|
||
|
if (sectorHeader->number == tgtSectorNumber) {
|
||
|
// check if it's the next sector that the head would encounter angularly...
|
||
| ... | ... | |
|
ret -= AU_FULL_ROTATION;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
}
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »