55char * dt_ident = DT_IDENT ;
66char * dx_ident = DX_IDENT ;
77
8+ // TODO: currently only selected drive will move, this is wrong
9+
810// TODO: find out how this should be controlled
911#define DEVNO 1
1012
@@ -40,10 +42,12 @@ dxmove(Dx555 *dx)
4042{
4143 // At end of tape read the last word forever
4244 if (dx -> dt -> ut_rev ){
45+ dx -> motion = -1 ;
4346 dx -> cur -- ;
4447 if (dx -> cur < dx -> start )
4548 dx -> cur = dx -> start + 5 ;
4649 }else {
50+ dx -> motion = 1 ;
4751 dx -> cur ++ ;
4852 if (dx -> cur >= dx -> end )
4953 dx -> cur = dx -> end - 6 ;
@@ -318,6 +322,8 @@ char state = 'n';
318322
319323#define REV (dt->ut_rev && !UT_BM)
320324
325+ static int selectdx (Dt551 * dt );
326+
321327/* This is a function for debugging purposes */
322328static void
323329setstat (Dt551 * dt , int state )
@@ -329,14 +335,18 @@ static void
329335dtsetgo (Dt551 * dt , int go )
330336{
331337/*
332- printf("setting GO %d %d\n", dt->ut_go, go);
338+ // printf("setting GO %d %d\n", dt->ut_go, go);
333339 if(dt->ut_go != go){
334340 if(go)
335341 printf("DECtape started\n\n\n");
336342 else
337343 printf("DECtape stopped\n\n\n");
338344 }
339345*/
346+ // little hack: stop tape motion here. motion is set in dxmove
347+ // i hope selectdx is safe?
348+ if (!go && selectdx (dt ) == 1 )
349+ dt -> seldx -> motion = 0 ;
340350 dt -> ut_go = go ;
341351}
342352
@@ -657,13 +667,13 @@ wake_dt(void *dev)
657667 if (IOB_RESET ){
658668 dt -> ut_incomp_block = 0 ;
659669
670+ dtsetgo (dt , 0 ); // have to do this before deselection
660671 dt -> ut_pia = 0 ;
661672 dt -> ut_units = 0 ;
662673 dt -> ut_units_select = 0 ;
663674 dt -> ut_fcn = 0 ;
664675 dt -> ut_time = 0 ;
665676 dt -> ut_wren = 0 ;
666- dtsetgo (dt , 0 );
667677 dt -> ut_rev = 0 ;
668678 dt -> ut_tape_end_flag = 0 ;
669679 dt -> ut_tape_end_enable = 0 ;
@@ -728,13 +738,13 @@ dbg("UTC CONO CLEAR\n");
728738 setstat (dt , RW_NULL );
729739 }
730740 if (IOB_CONO_SET ){
741+ dtsetgo (dt , bus -> c12 >>13 & 1 ); // have to do this before deselection
731742 dt -> ut_pia = bus -> c12 & 07 ;
732743 dt -> ut_units = bus -> c12 >>3 & 07 ;
733744 dt -> ut_fcn = bus -> c12 >>6 & 07 ;
734745 dt -> ut_time = bus -> c12 >>9 & 03 ;
735746 dt -> time_enable = bus -> c12 >>11 & 1 ;
736747 dt -> ut_rev = bus -> c12 >>12 & 1 ;
737- dtsetgo (dt , bus -> c12 >>13 & 1 );
738748 dt -> ut_jb_done_enable = bus -> c12 >>14 & 1 ;
739749 dt -> ut_tape_end_enable = bus -> c12 >>15 & 1 ;
740750 dt -> ut_units_select = bus -> c12 >>16 & 1 ;
0 commit comments