mirror of
https://github.com/trudnai/Steve2.git
synced 2024-12-22 21:29:50 +00:00
Few bugfixes
This commit is contained in:
parent
94aeaaefaa
commit
55bb6b5fd5
@ -381,6 +381,7 @@ uint8_t woz_read() {
|
|||||||
const int magicShiftOffset = 50;
|
const int magicShiftOffset = 50;
|
||||||
|
|
||||||
uint16_t usedBytes = woz_trks[track].bytes_used < WOZ_TRACK_BYTE_COUNT ? woz_trks[track].bytes_used : WOZ_TRACK_BYTE_COUNT;
|
uint16_t usedBytes = woz_trks[track].bytes_used < WOZ_TRACK_BYTE_COUNT ? woz_trks[track].bytes_used : WOZ_TRACK_BYTE_COUNT;
|
||||||
|
|
||||||
if ( usedBytes ) {
|
if ( usedBytes ) {
|
||||||
if ( clkelpased > clkBeforeAdjusting ) {
|
if ( clkelpased > clkBeforeAdjusting ) {
|
||||||
// printf("NEED SYNC : %llu (clkBefRd:%d)\n", clkelpased, clkBeforeSync);
|
// printf("NEED SYNC : %llu (clkBefRd:%d)\n", clkelpased, clkBeforeSync);
|
||||||
@ -392,6 +393,7 @@ uint8_t woz_read() {
|
|||||||
// preroll data stream
|
// preroll data stream
|
||||||
WOZread.shift16 = 0;
|
WOZread.shift16 = 0;
|
||||||
WOZread.data = woz_trks[track].data[trackOffset++];
|
WOZread.data = woz_trks[track].data[trackOffset++];
|
||||||
|
trackOffset %= usedBytes;
|
||||||
|
|
||||||
WOZread.shift16 <<= bitOffset;
|
WOZread.shift16 <<= bitOffset;
|
||||||
|
|
||||||
@ -399,11 +401,12 @@ uint8_t woz_read() {
|
|||||||
for ( ; bitOffset < 8; bitOffset++ ) {
|
for ( ; bitOffset < 8; bitOffset++ ) {
|
||||||
WOZread.shift16 <<= 1;
|
WOZread.shift16 <<= 1;
|
||||||
|
|
||||||
if (WOZread.shift & 0x80) {
|
if ( WOZread.valid ) {
|
||||||
WOZread.shift = 0;
|
WOZread.shift = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WOZread.data = woz_trks[track].data[trackOffset++];
|
WOZread.data = woz_trks[track].data[trackOffset++];
|
||||||
|
trackOffset %= usedBytes;
|
||||||
bitOffset = 0;
|
bitOffset = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user