English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 13 March 2006, 00:31   #1
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,699
Blitter MFM decoding

Just got my trackloader with blitter decoding to work... the thing is, I need TWO 256 word blits to do it, because the blitter shifts to the right and the MFM data needs to be shifted left by one lousy bit Darn It!

It seems impossible to do it with a single blit, since blitsize width is max. 64 words and shifts don't happen across rows.

Does anyone know if anyone in the history of Amiga has achieved this with a single blit? I'd sure like to see that code...

Last edited by Photon; 13 March 2006 at 01:54.
Photon is online now  
Old 13 March 2006, 01:55   #2
Codetapper
2 contact me: email only!
 
Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,187
Isn't shifting switched around if you use the blitter descending mode? ie. Shifts become to the left?
Codetapper is offline  
Old 13 March 2006, 09:46   #3
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,699
The System Programmer's Guide says the blitter shifts right and in the chapter about descending mode it doesn't mention any change in shift direction. Wish I had my Hardware Reference Manual around to settle the matter, but it's stored somewhere.
Photon is online now  
Old 13 March 2006, 10:41   #4
musashi5150
move.w #$4489,$dff07e
 
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 43
Posts: 2,351
It does shift the other way in descending mode - I'm sure of it.
musashi5150 is online now  
Old 13 March 2006, 11:24   #5
Codetapper
2 contact me: email only!
 
Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,187
Indeed. From the book Mapping the Amiga:

You should also use descending mode if you need to shift your source data left. You must use descending mode if you plan to perform a blitter fill operation.
Codetapper is offline  
Old 13 March 2006, 15:12   #6
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
I think I might have that book.. Is it by Abacus?

If so I'll dig it out later and scan anything required.. Just say da word guys
BippyM is offline  
Old 13 March 2006, 22:55   #7
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,130
dee jay may of typed it in ages ago.
redblade is offline  
Old 14 March 2006, 00:07   #8
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,481
Quote:
Descending mode is turned on by setting bit one of BLTCON1 (defined as BLITREVERSE). If you use descending mode the address pointers will be decremented by two (bytes) instead of incremented by two for each word fetched. In addition, the modulo values will be subtracted rather than added. Shifts are then towards the left, rather than the right, the first word mask masks the last word in a row (which is still the first word fetched) and the last word mask masks the first word in a row.
Hope that helps.
Attached Files
File Type: zip AMIHARRE.zip (163.3 KB, 349 views)
alexh is offline  
Old 15 March 2006, 00:53   #9
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,699
Sorry for no reply guys, been away (project deadline at Uni). I actually tried descending mode right after posting and it worked straight away

Just goes to show that you need thorough manuals when you try to do something special

Anyway, here's the code for it:

Code:
**** MFM DECODE BLIT ****

;a0=destination (chipmem)
;a1=start of sector data in MFM-buffer
;a5=$dff000
;d7.l=$55555555

	lea $200-2(a0),a0
	lea $200-2(a1),a1
	lea $200(a1),a2
	moveq #0,d5

.wbl1:   btst #6,2(a5)
	bne.s .wbl1

	move.w d5,$62(a5)	;bltbmod
	move.l d5,$64(a5)	;bltadmod
	move.l a2,$4c(a5)	;bltbptH
	move.l a1,$50(a5)	;bltaptH
	move.l a0,$54(a5)	;bltdptH

	move.l d7,$44(a5)	;bltaflwm - MASK BEFORE SHIFT!!
	move.l #$1df80002,$40(a5)	;bltcon0&1, shift a by 1, descending

	move.w d7,$70(a5)	;bltcdat - mask for b

	move.w #256*64+1,$58(a5)	;bltsize=256w=512b=1 sector

My loader is really fast now Does anyone know a megademo with a fast loader, so I can compare? :P (And I don't mean those cheatz0r demos that load only one side of each track )

Last edited by Photon; 15 March 2006 at 10:48.
Photon is online now  
Old 15 March 2006, 09:01   #10
bobbybearing
Zone Friend
 
bobbybearing's Avatar
 
Join Date: Oct 2003
Location: France
Age: 51
Posts: 161
see Trashcan/Wizzcat. fast loader
bobbybearing is offline  
Old 15 March 2006, 11:48   #11
CFou!
Moderator
 
CFou!'s Avatar
 
Join Date: Sep 2004
Location: France
Age: 51
Posts: 4,277
Quote:
Originally Posted by Photon
Just got my trackloader with blitter decoding to work... the thing is, I need TWO 256 word blits to do it, because the blitter shifts to the right and the MFM data needs to be shifted left by one lousy bit Darn It!

It seems impossible to do it with a single blit, since blitsize width is max. 64 words and shifts don't happen across rows.

Does anyone know if anyone in the history of Amiga has achieved this with a single blit? I'd sure like to see that code...
Thalamus's track loader for BOROBODURhttp://hol.abime.net/186 use blitter to decode MFM (track length $1800 without checksum in my memory)

If You are interesting in it, I can extract the code
CFou! is offline  
Old 15 March 2006, 19:54   #12
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,699
Quote:
Originally Posted by bobbybearing
see Trashcan/Wizzcat. fast loader
That's one of those cheatz0r demos I was talking about. I can modify mine to only load 1 sector per cylinder, then it will tick like crazy!!!
Photon is online now  
Old 15 March 2006, 19:58   #13
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,699
Quote:
Originally Posted by CFOU!
Thalamus's track loader for BOROBODURhttp://hol.abime.net/186 use blitter to decode MFM (track length $1800 without checksum in my memory)

If You are interesting in it, I can extract the code
Well I might be interested in booting it to hear if it's faster... unless it only loads one side of the cylinder of course
Photon is online now  
Old 16 March 2006, 09:47   #14
musashi5150
move.w #$4489,$dff07e
 
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 43
Posts: 2,351
Fairlight's 242 demo tracked in pretty fast as I remember too
musashi5150 is online now  
Old 16 March 2006, 11:24   #15
IFW
Moderator
 
IFW's Avatar
 
Join Date: Jan 2003
Location: ...
Age: 52
Posts: 1,838
The disk rotates at 300rpm.
Reading an entire track is one revolution.
You have 5 revolutions per second.
All this means no matter what you do, it won't get any faster than 5 tracks per second.
IFW is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overzealous Kickstart ROM - address decoding? robinsonb5 Hardware mods 3 30 June 2013 11:09
Decoding algorithm(s) for encoded disk sectors (ADOS) andreas Coders. General 10 02 November 2009 22:18
jpeg decoding in full asm meynaf Coders. General 111 27 March 2008 18:40
mfm/custom regs/track loader snyp Coders. General 9 06 June 2006 19:42
Winuae+IPF > MFM > Floppy killergorilla project.SPS (was CAPS) 1 14 July 2004 13:04

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:52.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09650 seconds with 14 queries