home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************************
- *
- * SEEKUP
- *
- * Short description:
- * On STs running TOS 2.06, SEEKUP turns off step rate doubling.
- *
- * Versions:
- * 1.0 mo 25.04.92 base version
- *
- * Author:
- * mo (\/) Martin Osieka, Erbacherstr. 2, D-6100 Darmstadt
- *
- * Translated (sort of) into English (kind of) by Martin_Koehling@un.maus.de
- * Note: only tested (by me) with German TOS ROMs.
- *
- *********************************************************************/
-
- #include <stddef.h>
- #include <tos.h>
-
-
- #define PRGNAME "(\\/) SEEKUP"
-
- #define _sysbase (*((SYSHDR **)0x4F2))
-
- /*** 3rd variant of the DSB ***/
- typedef struct {
- char cmdbit3; /* $00 or $08, will be OREd into the SEEK command
- Can be changed/inquired with Floprate() */
- char dummy; /* unused */
- short track; /* current track */
- short hdmode; /* 0 or 3, written into register $FF860E
- This register doesn't exist on a ST */
- short seekrate; /* hdmode=0: 0: 6ms, 1: 12ms, 2: 2ms, 3: 3ms
- hdmode=3: 0,1: 12ms, 2,3: 6ms
- Can be changed/inquired with Floprate() */
- } dsb3S;
-
- /*
- TOS remembers the floppy disk state in DSBs.
- The DSBs are initialized to { 0, 0, 0xFF00, 3, _seekrate}, which sets
- the seek rate to 6 ms on a ST.
- The track positioning routine toggles <hdmode> when an error occurs and
- makes a second attempt.
- The formatting function sets <hdmode> depending on the number of sectors
- per track. It would propably be better if TOS set <hdmode> to 0 after any
- diskchange it recognized.
- */
-
- /********************************************************************/
-
- int main( void)
- {
- void *stk;
- SYSHDR *sys;
-
- /*** get address of OSHEADER ***/
- stk = (void *)Super( NULL);
- sys = _sysbase->os_base;
- Super( stk);
-
- /*** turn of seek rate doubling ***/
- if (sys->os_version == 0x206) {
- dsb3S *pdsb = (dsb3S *)0x160A;
- pdsb->hdmode = 0;
- (pdsb+1)->hdmode = 0;
- Cconws( PRGNAME ": Done.\r\n");
- }
- else {
- Cconws( PRGNAME ": Unsupported TOS.\r\n");
- };
-
- return( 0);
- } /* main */
-
- /********************************************************************/
-