home *** CD-ROM | disk | FTP | other *** search
- | R_Draw functions in asm
-
- .text
-
- .globl _R_DrawColumn8
- .globl _R_DrawColumnLow8
- .globl _R_DrawSpan8
- .globl _R_DrawSpanLow8
- .globl _R_DrawTranslatedColumn8
- .globl _R_DrawTranslatedColumnLow8
- .globl _R_DrawFuzzColumn8
- .globl _R_DrawFuzzColumnLow8
-
- .globl _ylookup
- .globl _columnofs
- .globl _centery
- .globl _colormaps
- .globl _viewheight
-
- .globl _fuzzoffset
- .globl _fuzzpos
-
- .globl _dc_yh
- .globl _dc_yl
- .globl _dc_iscale
- .globl _dc_texturemid
- .globl _dc_colormap
- .globl _dc_source
- .globl _dc_translation
-
- .globl _ds_x1
- .globl _ds_x2
- .globl _ds_y
- .globl _ds_xfrac
- .globl _ds_yfrac
- .globl _ds_xstep
- .globl _ds_ystep
- .globl _ds_colormap
- .globl _ds_source
-
- | ----- R_DrawColumn
-
- .text
- _R_DrawColumn8:
- moveml d2-d4/a2-a3,sp@-
-
- movew _dc_yh+2,d0
- movew _dc_yl+2,d1
- subw d1,d0
- bmi R_DC_stop
-
- lea _ylookup,a0
- movel a0@(0,d1:w:4),a0
- movew _dc_x+2,d1
- addw _viewwindowx+2,d1
- addw d1,a0
-
- movel _dc_iscale,d1 | d1 = coef de zoom
-
- movel _dc_yl,d2
- subl _centery,d2
- mulul d1,d2
- addl _dc_texturemid,d2 | d2 = frac (position)
-
- movel _dc_colormap,a1
- movel _dc_source,a2
- lea 320,a3
- moveql #127,d3
- swap d1
- swap d2
- clrw d4
- R_DC_boucle:
- andw d3,d2
- moveb a2@(0,d2:w),d4
- addxl d1,d2
- moveb a1@(0,d4:w:4),a0@
- addl a3,a0
- dbra d0,R_DC_boucle
- R_DC_stop:
- moveml sp@+,d2-d4/a2-a3
- rts
-
- | ----- R_DrawColumnLow
-
- .text
- _R_DrawColumnLow8:
- moveml d2-d4/a2-a3,sp@-
-
- movew _dc_yh+2,d0
- movew _dc_yl+2,d1
- subw d1,d0
- bmi R_DCL_stop
-
- lea _ylookup,a0
- movel a0@(0,d1:w:4),a0
- movew _dc_x+2,d1
- addw d1,d1
- addw _viewwindowx+2,d1
- addw d1,a0
-
- movel _dc_iscale,d1 | d1 = coef de zoom
-
- movel _dc_yl,d2
- subl _centery,d2
- mulul d1,d2
- addl _dc_texturemid,d2 | d2 = frac (position)
-
- movel _dc_colormap,a1
- movel _dc_source,a2
- lea 320,a3
- moveql #127,d3
- swap d1
- swap d2
- clrw d4
- R_DCL_boucle:
- andw d3,d2
- moveb a2@(0,d2:w),d4
- addxl d1,d2
- movew a1@(0,d4:w:4),a0@
- addl a3,a0
- dbra d0,R_DCL_boucle
- R_DCL_stop:
- moveml sp@+,d2-d4/a2-a3
- rts
-
- | ----- R_DrawSpan
- | d0 = _ds_x2
- | d1 = _ds_x1
- | d2 = _ds_y
- | a1 = _ds_colormap
- | a2 = _ds_source
-
- .text
- _R_DrawSpan8:
- moveml d2-d7/a2,sp@-
-
- movew _ds_x2+2,d0
- movew _ds_x1+2,d1
- subw d1,d0
- bmi R_DS_stop
-
- movew _ds_y+2,d2
- lea _ylookup,a0
- movel a0@(0,d2:w:4),a0
- addw _viewwindowx+2,d1
- addw d1,a0
-
- movel _ds_colormap,a1
- movel _ds_source,a2
-
- movel _ds_xfrac,d1
- movel _ds_yfrac,d2
- movel _ds_xstep,d3
- movel _ds_ystep,d4
- asrl #6,d1
- asrl #6,d3
- clrw d6
- R_DS_boucle:
- movel d2,d7
- movew d1,d7
- lsrl #6,d7
- lsrw #4,d7
- moveb a2@(0,d7:w),d6
- addw d3,d1
- addl d4,d2
- moveb a1@(0,d6:w:4),a0@+
- dbra d0,R_DS_boucle
-
- R_DS_stop:
- moveml sp@+,d2-d7/a2
- rts
-
- | ----- R_DrawSpanLow
- | d0 = _ds_x2
- | d1 = _ds_x1
- | d2 = _ds_y
- | a1 = _ds_colormap
- | a2 = _ds_source
-
- .text
- _R_DrawSpanLow8:
- moveml d2-d7/a2,sp@-
-
- movew _ds_x2+2,d0
- addw d0,d0
- movew _ds_x1+2,d1
- addw d1,d1
- subw d1,d0
- bmi R_DSL_stop
-
- movew _ds_y+2,d2
- lea _ylookup,a0
- movel a0@(0,d2:w:4),a0
- addw _viewwindowx+2,d1
- addw d1,a0
-
- movel _ds_colormap,a1
- movel _ds_source,a2
-
- movel _ds_xfrac,d1
- movel _ds_yfrac,d2
- movel _ds_xstep,d3
- movel _ds_ystep,d4
- asrl #6,d1
- asrl #6,d3
- clrw d6
- lsrw #1,d0
- R_DSL_boucle:
- movel d2,d7
- movew d1,d7
- lsrl #6,d7
- lsrw #4,d7
- moveb a2@(0,d7:w),d6
- addw d3,d1
- addl d4,d2
- movew a1@(0,d6:w:4),a0@+
- dbra d0,R_DSL_boucle
-
- R_DSL_stop:
- moveml sp@+,d2-d7/a2
- rts
-
- | ----- R_DrawTranslatedColumn
-
- .text
- _R_DrawTranslatedColumn8:
- moveml d2-d4/a2-a4,sp@-
-
- movew _dc_yh+2,d0
- movew _dc_yl+2,d1
- subw d1,d0 | d0 = Nb de lignes
- bmi R_DTC_stop
-
- lea _ylookup,a0
- movel a0@(0,d1:w:4),a0
- movew _dc_x+2,d1
- addw _viewwindowx+2,d1
- addw d1,a0
-
- movel _dc_iscale,d1 | d1 = coef de zoom
-
- movel _dc_yl,d2
- subl _centery,d2
- mulul d1,d2
- addl _dc_texturemid,d2 | d2 = frac (position)
-
- movel _dc_colormap,a1
- movel _dc_source,a2
- movel _dc_translation,a4
- lea 320,a3
- moveql #127,d3
- swap d1
- swap d2
- clrw d4
- subl a3,a0
- R_DTC_boucle:
- andw d3,d2
- moveb a2@(0,d2:w),d4
- addxl d1,d2
- moveb a4@(0,d4:w),d4
- addl a3,a0
- moveb a1@(0,d4:w:4),a0@
- dbra d0,R_DTC_boucle
- R_DTC_stop:
- moveml sp@+,d2-d4/a2-a4
- rts
-
- | ----- R_DrawTranslatedColumnLow
-
- .text
- _R_DrawTranslatedColumnLow8:
- moveml d2-d4/a2-a4,sp@-
-
- movew _dc_yh+2,d0
- movew _dc_yl+2,d1
- subw d1,d0 | d0 = Nb de lignes
- bmi R_DTCL_stop
-
- lea _ylookup,a0
- movel a0@(0,d1:w:4),a0
- movew _dc_x+2,d1
- addw d1,d1
- addw _viewwindowx+2,d1
- addw d1,a0
-
- movel _dc_iscale,d1 | d1 = coef de zoom
-
- movel _dc_yl,d2
- subl _centery,d2
- mulul d1,d2
- addl _dc_texturemid,d2 | d2 = frac (position)
-
- movel _dc_colormap,a1
- movel _dc_source,a2
- movel _dc_translation,a4
- lea 320,a3
- moveql #127,d3
- swap d1
- swap d2
- clrw d4
- subl a3,a0
- R_DTCL_boucle:
- andw d3,d2
- moveb a2@(0,d2:w),d4
- addxl d1,d2
- moveb a1@(0,d4:w),d4
- addl a3,a0
- movew a4@(0,d4:w:4),a0@
- dbra d0,R_DTCL_boucle
- R_DTCL_stop:
- moveml sp@+,d2-d4/a2-a4
- rts
-
- | ----- R_DrawFuzzColumn
-
- .text
- _R_DrawFuzzColumn8:
- moveml d2-d4/a2-a3,sp@-
-
- movew _viewheight+2,d2
- subqw #1,d2
-
- movew _dc_yl+2,d1
- bne R_DFC_cont
- moveq #1,d1
- R_DFC_cont:
- movew _dc_yh+2,d0
- cmpw d2,d0
- bmi R_DFC_cont1
- movew d2,d0
- subqw #1,d0
- R_DFC_cont1:
-
- subw d1,d0
- bmi R_DFC_stop
-
- lea _ylookup,a0
- movel a0@(0,d1:w:4),a0
- movew _dc_x+2,d1
- addw _viewwindowx+2,d1
- addw d1,a0
-
- movel _colormaps,a1
- lea a1@(4*6*256),a1
- lea _fuzzoffset,a2
- lea 320,a3
- moveq #31,d3
- moveq #0,d2
- moveq #0,d4
- movew _fuzzpos,d1
- R_DFC_boucle:
- movew a2@(0,d1:w:4),d2 | Lecture offset
- addqw #1,d1
- moveb a0@(0,d2:w),d4 | Pixel
- andw d3,d1
- moveb a1@(0,d4:w:4),a0@
- addl a3,a0
- dbra d0,R_DFC_boucle
-
- movew d1,_fuzzpos
- R_DFC_stop:
- moveml sp@+,d2-d4/a2-a3
- rts
-
- | ----- R_DrawFuzzColumnLow
-
- .text
- _R_DrawFuzzColumnLow8:
- moveml d2-d4/a2-a3,sp@-
-
- movew _viewheight+2,d2
- subqw #1,d2
-
- movew _dc_yl+2,d1
- bne R_DFCL_cont
- moveq #1,d1
- R_DFCL_cont:
- movew _dc_yh+2,d0
- cmpw d2,d0
- bmi R_DFCL_cont1
- movew d2,d0
- subqw #1,d0
- R_DFCL_cont1:
-
- subw d1,d0
- bmi R_DFCL_stop
-
- lea _ylookup,a0
- movel a0@(0,d1:w:4),a0
- movew _dc_x+2,d1
- addw d1,d1
- addw _viewwindowx+2,d1
- addw d1,a0
-
- movel _colormaps,a1
- lea a1@(4*6*256),a1
- lea _fuzzoffset,a2
- lea 320,a3
- moveq #31,d3
- moveq #0,d2
- moveq #0,d4
- movew _fuzzpos,d1
- R_DFCL_boucle:
- movew a2@(0,d1:w:4),d2 | Lecture offset
- addqw #1,d1
- moveb a0@(0,d2:w),d4 | Pixel
- andw d3,d1
- movew a1@(0,d4:w:4),a0@
- addl a3,a0
- dbra d0,R_DFCL_boucle
- R_DFCL_stop:
- moveml sp@+,d2-d4/a2-a3
- rts
-