Hi! I've progressed somewhat since my last post and is now trying some pixel shifting. I'm starting in the top right corner and shifts word by word and plane after plane to the left. But it does not work like I want to. I can use my code for the top 19 words of each line, not for the first of some reason. I think I've done some trivial fault that any experienced assembly coder quickly can see.
If anyone have a sec to have a look at my code It would be much appriciated.
scroll
move.w #2,-(a7) ;get screen address
trap #14 ;0 1 2 3, 4 5 6 7, ... , 16 17 18 19
;0 2 4 6, 8 10 12 14, ... , 32 34 36 38
addq.l #2,a7; ;0 8 16 24,32 40 48 56, ... , 128 136 144 152
move.l d0,scrolladr
add.l #152,scrolladr ;add to get to last word, first bit plane
move.l #256,d7
scroll_loop
move.l scrolladr,a6
move.w #37,-(a7) ;wait for vbl
trap #14
addq.l #2,a7
move.l #15,d4 ;set rows to shift
bploop_resd5
move.l #3,d5 ;set bitplanes to shift
bploop_resd6
move.l #18,d6 ;set words width for each row (one bit plane at the time)
bploop
roxl.w (a6)
bp_no_carry
subq.l #8,a6
dbf d6,bploop
add.l #152,a6 ;jump to start. (at the end)
addq.l #2,a6 ;inc to next bitplane
dbf d5,bploop_resd6
add.l #152,a6
dbf d4,bploop_resd5
dbf d7,scroll_loop
rts
I'm surprised that the instruction after roxl.l does not trash the X flag, but this is not the main problem right now. My main problem is that if I try to shift the whole row (setting the move instruction below "bploop_resd6" to 19) makes the program crash. Probably addressing an odd byte, but I've not figured it out. =(