mirror of
https://github.com/trudnai/Steve2.git
synced 2025-03-10 02:32:57 +00:00
Disk adjustment magic numbers lifted out as variables so it will be easier to remember them and adjust them
This commit is contained in:
parent
5051c0f8c7
commit
572977f5f8
@ -254,12 +254,15 @@ uint8_t woz_read() {
|
|||||||
clkelpased = m6502.clktime - m6502.clklast;
|
clkelpased = m6502.clktime - m6502.clklast;
|
||||||
m6502.clklast = m6502.clktime;
|
m6502.clklast = m6502.clktime;
|
||||||
|
|
||||||
|
const int clkBeforeAdjusting = 250;
|
||||||
|
const int magicShiftOffset = 90;
|
||||||
|
|
||||||
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 > 120 ) {
|
if ( clkelpased > clkBeforeAdjusting ) {
|
||||||
// printf("NEED SYNC : %llu\n", clkelpased);
|
// printf("NEED SYNC : %llu\n", clkelpased);
|
||||||
bitOffset = (clkelpased >> 2) & 7;
|
bitOffset = (clkelpased >> 2) & 7;
|
||||||
trackOffset += ((clkelpased >> 5) +80) % usedBytes;
|
trackOffset += ((clkelpased >> 5) + magicShiftOffset) % usedBytes;
|
||||||
WOZread.data = woz_trks[track].data[trackOffset];
|
WOZread.data = woz_trks[track].data[trackOffset];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user