View Single Post
Old 22 February 2013, 22:24   #4
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by hooverphonique View Post
I am not sure, I understand you 100%, but you cannot use odd addresses with the blitter.. if you need to blit something to a position that corresponds to an odd address, you need to add 2 to your dest address and then use the A or B source shift to move it 8 pixels left.
I knew that you can't use the blitter on odd addresses - I did forgot to correct that in my .not_even routine though However, I was rusty with the barrel shifting technique.


phx,

Thanks for the lengthy explaination, that is exactly what I needed. I did read something along those lines in the Amiga HRM yesterday, but for some reason it didn't sink in properly

I started changing my original code based on what you said, but still couldn't get it to work. Then I started again from scratch with more organised code and direct values for the modulo's and BLTSIZE values.
It worked. I carefully replaced the direct values by adjusting the original modulo's (in d4 and d5) and BLTSIZE value (in d6) as necessary and it still works The resulting code is below:

Code:
.not_even
    move.l    #$FFFF0000,BLTAFWM    ;mask, blocks out first word & draws
                                    ;last word of bob
    move.w    #$FFFF,BLTADAT        ;source A mask (always $FFFF)
    move.l    a5,BLTBPTH        ;source B = Bob (tiles)
                                 ;          (compared with source A)
    move.l    a6,BLTCPTH        ;source C = Screen dest
                                 ;          (to merge with source B)
    move.l    a6,BLTDPTH        ;source D = Screen dest
    subq.w    #2,d4            ;d4=36
    subq.w    #2,d5            ;d5=36
    move.w    d4,BLTAMOD
    move.w    d4,BLTBMOD
    move.w    d5,BLTCMOD
    move.w    d5,BLTDMOD
    move.w    #$87CA,BLTCON0        ;D = (A & B) | (!A & C)
                                    ;use B,C & D   (A is set directly)
                                    ;shift A source right 8 pixels
    move.w    #$8000,BLTCON1        ;shift B source right 8 pixels
    addq.w    #1,d6
    move.w    d6,BLTSIZE        ;d6=$0202 (8 lines, 2 words)
    rts
Lonewolf10 is offline  
 
Page generated in 0.04369 seconds with 11 queries