i have a startup source with a draw line code, it works on my A600, but on my A1200 i got corrupted screen graphics,
It's a bad startup code, not aware of the AGA.
See my home page for
a better one.
The code also doesn't allocate the blitter (OwnBlitter + WaitBlit) for your own use, so it might mess up system blitter queue. The copperlist is not terminated with two $fffffffe's (two are required due to some copper bugs in some chipset revisions). OldOpenLibrary is obsolete and should not be used. The code actually stores old INTENA, DMACON and ADKCON without disabling interrupts. This leaves the code open for race conditions (wrong values might be restored at exit). The code is not aware of VBR (Vector Base Register, 68010-68060) that can be used to move the vector register array elsewhere in memory. Just poking/peeking $6C.w is not enough, it must be relative to VBR (for 68000 use base of 0).
.WAIT: BTST #6,$2(A6)
BNE.S .WAIT
is not enough to wait blitter. The BTST #6 must be done once before entering a loop, or the code might get false positive for blitter done (again some chipset revisions are buggy). Correct code:
BTST #6,$2(A6)
.WAIT: BTST #6,$2(A6)
BNE.S .WAIT
a lot of examples don't work because DevPac don't recognise instruction BLK, is a specific assembler instruction?
No.
it can be switched with other instruction compatible with DevPac?
dcb.size count,val
for example:
dcb.l 16,$715517
And the last question is about Blitter, to check if the blitter finished the operation, i test bit 6 on $DFF000 address
It's actually $DFF002 (dmaconr).
, but i found that some codes test bit 14, and DevPac says that you can test bits 0-7. Why some codes use bit 14?
Because btst is always byte operation and the bit number is masked by 7, and 14 & 7 = 6. Since the bits are counted from the LSB (rightmost bit) to MSB (leftmost bit), it doesn't really matter if you use 14 or 6, both fall to same bit. If you're testing bits 0 to 7, then you need to use btst #x,addr+1.
Some assemblers are a bit more lax about the constant value, but really you should use x-8 for the x = 8...15. Strictly speaking using btst #14,... is a bug, it should be btst #14-8,... or btst #14&7,...
So in short, the correct syntax that works for ALL assemblers (testing bit from 16bit memory location):
btst #x,addr+1 ; if x is 0..7
btst #x&7,addr ; if x is 8..15
And expanded to 32bit memory locations:
btst #x,addr+3 ; if x is 0..7
btst #x&7,addr+2 ; if x is 8..15
btst #x&7,addr+1 ; if x is 16..23
btst #x&7,addr ; if x is 24..31