@Hexmage960, post #1
PIPELINE REGISTER
For enhanced performance, the Blitter is pipelined. You might expect the Blitter to read all of the sources for the first cycle, then write the computed value to the destination, then read the sources for the second cycle, then write the com puted value to the destination, and so on. Actually, it writes the value computed in the first cycle after reading the sources for the second cycle—no write takes place in the first cycle, and an extra write takes place after the Blitter is finished. This is useful information to know if you are trying to do something like find the bitwise exclusive OR of a large sec tion of memory. For instance, if you wanted to find the bit wise exclusive OR of an array of 1000 16-bit words, you might try setting the A channel to point to the beginning of the ar ray, and the C and D channels to point to the second word, then set the height to 999 and the width to 1 (word), and use a function of A-C+-AC. The thinking would be along the lines of:
for (i=0; i<999; i++) a[i+1] ^= a[i]; return a[999];
Unfortunately, the pipeline register will cause the "desti nation" to be written too late. The solution is to set the C and D channels to point to the third word, set the height to 998, and exclusive OR the last two by hand. This will work, and corresponds to the code:
for (i=0; i<998; i++) a[i+2] = a[i]; return a[999] ^ a[998];
@teh_KaiN, post #2
@teh_KaiN, post #2
Naciąłem się na to samo i swojego czasu o tym pisałem - objawiało się to głównie przy funkcji składającej tekst z pojedynczych znaków. Spędziłem nad tym nie godziny tylko wręcz miesiące i rozwiąznia nie widzę, więc albo tu jest granica moich zdolności poznawczych albo to jest bug/quirk hardware'u.
Teraz problem mnie nie dotyczy bo robię odpowiednio większe bufory. Zapisywanie tła robię na większym o słowo na operacji D:=A bez shiftów, bo jest szybsza niż cookie cut.
Tak czy inaczej trzymam kciuki, że rozwiążesz ten problem za nas obu. ;)
@teh_KaiN, post #3
@Hexmage960, post #5
#ifndef BLIT_H #define BLIT_H #ifndef EXEC_TYPES_H #include <exec/types.h> #endif /* EXEC_TYPES_H */ /* storeBack op parameter */ enum ops { STORE, RESTORE }; void prepBobMask(struct BitMap *bob, UBYTE *mask); void blitBob(struct BitMap *bob, UBYTE *mask, struct BitMap *back, WORD x, WORD y); void storeBack(struct BitMap *back, WORD x, WORD y, struct BitMap *store, UBYTE op); #endif /* BLIT_H */
@Hexmage960, post #6
custom.bltsize = (bltsizv << HSIZEBITS) | bltsizh;
@teh_KaiN, post #7
Kompilator się pewnie domyśli ale może lepiej przed pętlą zamiast trzymać bltsizv i bltsizh lepiej to wrzucić do jednej zmiennej i zrobić w pętli po prostu przypisanie.
Co do rozbicia na dwa blity to jednak bym był przeciwny, bo to wiąże się z czekaniem aż blitter skończy. Tak samo proponuję Ci przejść z klasycznego planara na interleaved, bo w ten sposób pozbędziesz się wielu WaitBlitów.
@Hexmage960, post #1