1
; void __CALLEE__ *sp1_PreShiftSpr_callee(uchar flag, uchar height, uchar width, void *srcframe, void *destframe, uchar rshift)
2
; 02.2008 aralbrec, Sprite Pack v3.0
5
XLIB sp1_PreShiftSpr_callee
6
XDEF ASMDISP_SP1_PRESHIFTSPR_CALLEE
8
.sp1_PreShiftSpr_callee
30
; enter : a = right shift amount (0-7)
31
; b = width in characters (# columns)
32
; h = zero for 1-byte definition; otherwise 2-byte
33
; de = source frame graphic
34
; ix = destination frame address
35
; l = height in characters
36
; exit : hl = next available address
37
; uses : af, bc, de, hl, b', ix
43
ld c,a ; c = right shift amount + 1
48
ld hl,dummy1byte ; point at two 0 bytes if 1-byte def
51
ld hl,dummy2byte ; point at (255,0) pair if 2-byte def
57
add a,a ; a = # bytes in graphic definition in each column
59
.dofirstcol ; first column has no graphics on left, will use dummy bytes for left
61
push de ; save top of first column
64
push bc ; save height of column in bytes
70
push bc ; save width and rotation amount
71
ld b,c ; b = right shift + 1
72
ld c,(hl) ; c = graphic byte from col on left
76
ld a,(de) ; a = graphic byte in current col
89
ld (ix+0),a ; store shifted graphic in destination frame
105
.nextcol ; do rest of columns
111
; b' = height in pixels
112
; de = graphic definition for this column
113
; hl = graphic definition for column to left
114
; b = width remaining in characters
115
; c = right shift amount + 1
160
DEFC ASMDISP_SP1_PRESHIFTSPR_CALLEE = asmentry - sp1_PreShiftSpr_callee