From : Serge Veugelers (sergev@cistron.nl)
Subject : Reading the joystick and blitter theory

>1. How can I write a routine that will read a mouse in the Joystick port? Can I
>do this sort of thing in Amiga mode as it's multitasking at the moment...

As far as I know both port work exactly the same. The only trouble is, that the
OS uses all it's routines on Port# 0. If you really like to read the mouse on 
both ports, you'll have to write all these routines yourself :

Mouse / Joystick Port# 0 = $DFF00A.w -> xxxxxxxxyyyyyyyy 
Mouse / Joystick Port# 1 = $DFF00C.w -> xxxxxxxxyyyyyyyy

Where x is vertical, and y = horizontal movement

x and y only store the difference since last time you checked, so It's usefull to
check this port every VBlank.

>2. Is the scroll command the fastest way to copy from one bitmap to another or
>would it be worth writing an Asm routine for this?

No actually it's blockscroll. You're data must be on a position that can be
divided trough 16 though. (Same as Blit vs Block). And it's programmed to be
functional on all screenmodes, so if you really want to be fast, you can make
your own routines, that don't have to check all these conditions, because you
_know_ what your bitmap looks like. This would be a speed increase, but take
away all functionality.

>with the Blit command and/or the Block command. I'm quite interested in knowing
>if the Block command actually uses the Blitter at all and whether the Blitter
>is faster at "pasting" 64 bit wide blocks than an 020 or better procesor would?

Yes, the Block/Blit command use the Blitter when they are in Blitz-mode. I'm not
sure what they do when they're in Amiga-mode. I guess it'll use graphics.library
which off course also uses the blitter.

And as for the speed... I read my Hardware refernce manual a while ago, and it said
that the Blitter was fast because it ran at a speed of 14Mhz. This was double the
speed of the Processor at that time . But now the processors are faster, and I'm not
exactly sure of the speed of the Blitter. I know there's an enhanced AGA 32-bit mode,
but I know no speed specifications :(. The advantage of the Blitter is it can run
simultaniously with your processor. That is if they don't want to access the same
memory type. CHIPMEM can only give access to one Chip at a time. It uses odd/even
cycles to manage this, but sometimes the processor time gets taken over (Cycle Stealing)
And if you do a lot of blitting the Processor waits for the Blitter to finish, before
it can give another command to the Blitter. Anyway for things like Texture mapping and
stuff they use the processor and FASTMEM nowadays...

I think a lot of time could be gained by using a interrupt-handler for the Blitter
(IRQ #6). You could create a table with everything that needs to be blitted, and let
the handler blit it one at a time. When you do that, all the processor has to do is
to fill that table, and then can go on with his work. This way you use the processor
to it's maximum capacity. I haven't tried it yet, it's just in theory. When I have the
time I'll try to set up a thing like that...