DEMO.DESIGN
Frequently Asked Questions
 
оглавление | demo party в ex-СССР | infused bytes e-mag | новости от ib/news | другие проекты | письмо | win koi lat

следующий фpагмент (2)
> How does one go about writing a speedy substitute for WritePixel()? That's not very hard, but the plot routine which I used in the speed tests was too optimized to be used anywhere else. A more generic (though it must be re-coded if the screen depth is changed), yet still fast, routine can be found below the dashed line. It plots to 3 interleaved bitmaps. If you use normal bitmaps, you must make sure that the bitplanes are consecutive. The source is for AsmOne and Devpac. This plot routine is approx. 4 times faster than WritePixel(). -- Bjorn Reese | Email: breese@imada.ou.dk Odense University, Denmark | Voice: +45 65 932 182 (private) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;------------------------------------------------------------------ ; @Plot3 ;------------------------------------------------------------------ ; IN d0.w = x ; d1.w = y ; d2.w = color ; a0.l = ^Screen ; USED d0-d1/a1 ; TIME 158cc ; breese@imada.ou.dk(Bjorn Reese) ;------------------------------------------------------------------ ;--- For Normal (consecutive) BitMaps ;NxtPlane = ScreenWidth*ScreenDepth ;NxtMulu = ScreenWidth ;--- For Interleaved BitMaps NxtPlane = ScreenWidth NxtMulu = ScreenWidth*ScreenDepth Plot3: lea MuluArray(pc),a1 add.w d1,d1 move.w (a1,d1.w),a1 adda.l a0,a1 ;ScrPtr += y * Width move.w d0,d1 not.b d1 ;Bit Number asr.w #3,d0 adda.w d0,a1 ;ScrPtr += x move.w d2,d0 add.w d0,d0 move.w JumpArray(pc,d0.w),d0 jmp JumpArray(pc,d0.w) JumpArray: dc.w Col000-JumpArray,Col001-JumpArray dc.w Col010-JumpArray,Col011-JumpArray dc.w Col100-JumpArray,Col101-JumpArray dc.w Col110-JumpArray,Col111-JumpArray Col000: bclr.b d1,(a1) bclr.b d1,NxtPlane(a1) bclr.b d1,2*NxtPlane(a1) rts Col001: bset.b d1,(a1) bclr.b d1,NxtPlane(a1) bclr.b d1,2*NxtPlane(a1) rts Col010: bclr.b d1,(a1) bset.b d1,NxtPlane(a1) bclr.b d1,2*NxtPlane(a1) rts Col011: bset.b d1,(a1) bset.b d1,NxtPlane(a1) bclr.b d1,2*NxtPlane(a1) rts Col100: bclr.b d1,(a1) bclr.b d1,NxtPlane(a1) bset.b d1,2*NxtPlane(a1) rts Col101: bset.b d1,(a1) bclr.b d1,NxtPlane(a1) bset.b d1,2*NxtPlane(a1) rts Col110: bclr.b d1,(a1) bset.b d1,NxtPlane(a1) bset.b d1,2*NxtPlane(a1) rts Col111: bset.b d1,(a1) bset.b d1,NxtPlane(a1) bset.b d1,2*NxtPlane(a1) rts MuluArray: aaa SET 0 REPT ScreenHeight dc.w aaa aaa SET aaa+NxtMulu ENDR

Всего 1 фpагмент(а/ов) |пpедыдущий фpагмент (1)

Если вы хотите дополнить FAQ - пожалуйста пишите.

design/collection/some content by Frog,
DEMO DESIGN FAQ (C) Realm Of Illusion 1994-2000,
При перепечатке материалов этой страницы пожалуйста ссылайтесь на источник: "DEMO.DESIGN FAQ, http://www.enlight.ru/demo/faq".