Xref: utzoo comp.sys.amiga.hardware:5833 comp.sys.amiga.programmer:340 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ub!ubvmsd.cc.buffalo.edu!v089pfrb From: v089pfrb@ubvmsd.cc.buffalo.edu (Jeffrey C Murphy) Newsgroups: comp.sys.amiga.hardware,comp.sys.amiga.programmer Subject: Re: Decoding MFM Message-ID: <56321@eerie.acsu.Buffalo.EDU> Date: 26 Jan 91 23:27:12 GMT References: <2786@gould.doc.ic.ac.uk> Sender: news@acsu.Buffalo.EDU Reply-To: v089pfrb@ubvmsd.cc.buffalo.edu Followup-To: comp.sys.amiga.hardware Organization: University at Buffalo Lines: 43 Nntp-Posting-Host: ubvmsd.cc.buffalo.edu News-Software: VAX/VMS VNEWS V1.3-4.4 In article <2786@gould.doc.ic.ac.uk>, la@doc.ic.ac.uk (Liaket Ali) writes... >Hi Amiga Fans! > >Could anyone offer some help (info/source) on how to convert raw MFM data into >[del...snip....del...cut..] With MFM every data bit is followed by a clock bit (the clock bit is toggled according to the status of the adjacent clock bits: if an adjacent data bit is set then the clock bit is reset and versa vice-a) Data: 1 0 1 0 0 0 0 1 Clock: 0 0 0 0 1 1 1 0 MFM: 0100010010101001 To decode you can use this simple routine (assuming you already have the data in memory): ... MOVE.L (A0)+,D0 ; get first longword MOVE.L (A0)+,D1 ; get second ANDI.L #$55555555,D0 ;remove clock bits ANDI.L #$55555555,D1 ;for d1 too LSL.L #1,D1 ; Shift bits in D1 over one position OR.L D1,D0 ; Overlay D1 on D0 and put in D0 ... As far as the blitter goes, it can do this much faster than the cpu can (unless you have a fast cpu) but requires you to set up structures for the blitter (which I have not really learned about yet....) I got the decode routine from Amiga Disk Drives Inside and Out by Abacus, which is about the worst proging book I have ever read (they repeatedly refer to absolute memory addresses! and routines that are not always at the addresses that they say.) This is because they get the book from Data Becker, a german company which thinks the amiga is really a C64 with everything permanently in rom. sigh... Anywaze... a pretty good book (although not the best) is the amiga programmer's handbook by sybex. I don't know if it is still available. Hope this helps. Jeff M. SUNYAB v089pfrb@ubvmsd.bitnet