From 08f3899de45fe487faf80f09b4133fec8b767185 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Tue, 20 Feb 2018 14:33:36 -0600 Subject: [PATCH] Tracks don't move from shifting; sector work The sector work being: - We only wrap around if we go beyond the length of an encoded track, so use ENC_ETRACK. - If we DO wrap around, we don't use modulus; we simply reset to zero. --- tests/apple2.dd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/apple2.dd.c b/tests/apple2.dd.c index 469bf24..c6d5317 100644 --- a/tests/apple2.dd.c +++ b/tests/apple2.dd.c @@ -1,6 +1,7 @@ #include #include "apple2.dd.h" +#include "apple2.enc.h" static apple2dd *drive; @@ -109,11 +110,12 @@ Test(apple2_dd, shift) // Push it beyond the sector boundary; see if the track position // updates as it should. - apple2_dd_shift(drive, MAX_SECTOR_POS + 3); - cr_assert_eq(drive->track_pos, 2); + apple2_dd_shift(drive, ENC_ETRACK + 3); + cr_assert_eq(drive->track_pos, 0); // this should be the mod of sector_pos and MAX_SECTOR_POS - cr_assert_eq(drive->sector_pos, 7); + printf("it's %d\n", drive->sector_pos); + cr_assert_eq(drive->sector_pos, 0); } Test(apple2_dd, step)