~z88dk-team/z88dk-pkg/trunk

« back to all changes in this revision

Viewing changes to libsrc/sprites/software/sp1/zx81hr/sprites/sp1_PreShiftSpr_callee.asm

  • Committer: Bazaar Package Importer
  • Author(s): Krystian Wlosek, Krystian Wlosek
  • Date: 2008-03-25 11:46:11 UTC
  • mfrom: (1.1.2 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080325114611-u89smn2ccknl8avt
Tags: 1.8.ds1-2
[ Krystian Wlosek ]
* Enable 64bit architecture.
* Added '-m32' switch to CFLAGS and LDFLAGS for 64bit machines.
* Changed Architecture: to `any' in z88dk and z88dk-bin package.
* Added gcc-multilib to Build-Depends: for 64bit
* Fixed problem with x11.lib
  - created symlink from include/x11 to include/X11
  - improved Makefile for x11.lib
    patch debian/patches/03_libsrc_graphics_x11_Makefile.diff
* Fixed library ozansi.lib
  - patch debian/patches/03_libsrc_oz_ozinput_Makefile.diff
* Changed Copyright notice.
* Fixed gcc warnings:
  - in src/appmake dir - debian/patches/04_src_appmake.diff
  - in src/zcc/zcc.c - debian/patches/04_src_zcc_zcc.c.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
3
; zx81 hi-res version
 
4
 
 
5
XLIB sp1_PreShiftSpr_callee
 
6
XDEF ASMDISP_SP1_PRESHIFTSPR_CALLEE
 
7
 
 
8
.sp1_PreShiftSpr_callee
 
9
 
 
10
   pop af
 
11
   exx
 
12
   pop bc
 
13
   exx
 
14
   pop ix
 
15
   pop de
 
16
   pop bc
 
17
   ld b,c
 
18
   pop hl
 
19
   ld c,l
 
20
   pop hl
 
21
   push af
 
22
   ld h,l
 
23
   ld l,c
 
24
   exx
 
25
   ld a,c
 
26
   exx
 
27
 
 
28
.asmentry
 
29
 
 
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
 
38
 
 
39
.SP1PreShiftSpr
 
40
 
 
41
   and $07
 
42
   inc a
 
43
   ld c,a                    ; c = right shift amount + 1
 
44
   
 
45
   ld a,l
 
46
   inc h
 
47
   dec h
 
48
   ld hl,dummy1byte          ; point at two 0 bytes if 1-byte def
 
49
   jr z, onebyte
 
50
   add a,a
 
51
   ld hl,dummy2byte          ; point at (255,0) pair if 2-byte def
 
52
   
 
53
.onebyte
 
54
 
 
55
   add a,a
 
56
   add a,a
 
57
   add a,a                   ; a = # bytes in graphic definition in each column
 
58
      
 
59
.dofirstcol                  ; first column has no graphics on left, will use dummy bytes for left
 
60
 
 
61
   push de                   ; save top of first column
 
62
   exx
 
63
   ld b,a
 
64
   push bc                   ; save height of column in bytes
 
65
 
 
66
.firstcolloop
 
67
 
 
68
   exx
 
69
   
 
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
 
73
   ld a,1
 
74
   xor l
 
75
   ld l,a
 
76
   ld a,(de)                 ; a = graphic byte in current col
 
77
   inc de
 
78
   djnz firstsloop
 
79
   jp firstdoneshift
 
80
 
 
81
.firstsloop
 
82
 
 
83
   rr c
 
84
   rra
 
85
   djnz firstsloop
 
86
 
 
87
.firstdoneshift
 
88
 
 
89
   ld (ix+0),a               ; store shifted graphic in destination frame
 
90
   inc ix
 
91
   
 
92
   pop bc
 
93
   exx
 
94
   djnz, firstcolloop
 
95
 
 
96
   pop bc
 
97
   exx
 
98
   pop hl
 
99
   djnz nextcol
 
100
   
 
101
   push ix
 
102
   pop hl
 
103
   ret
 
104
 
 
105
.nextcol                     ; do rest of columns
 
106
 
 
107
   push de
 
108
   exx
 
109
   push bc
 
110
 
 
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
 
116
 
 
117
.colloop
 
118
 
 
119
   exx
 
120
   
 
121
   push bc
 
122
   ld b,c
 
123
   ld a,(de)
 
124
   inc de
 
125
   ld c,(hl)
 
126
   inc hl
 
127
   djnz sloop
 
128
   jp doneshift
 
129
 
 
130
.sloop
 
131
 
 
132
   rr c
 
133
   rra
 
134
   djnz sloop
 
135
 
 
136
.doneshift
 
137
 
 
138
   ld (ix+0),a
 
139
   inc ix
 
140
   
 
141
   pop bc
 
142
   exx
 
143
   djnz, colloop
 
144
 
 
145
   pop bc
 
146
   exx
 
147
   pop hl
 
148
   djnz nextcol
 
149
 
 
150
   push ix
 
151
   pop hl
 
152
   ret
 
153
 
 
154
   defb 0
 
155
.dummy1byte
 
156
   defb 0,0
 
157
.dummy2byte
 
158
   defb 255,0
 
159
 
 
160
DEFC ASMDISP_SP1_PRESHIFTSPR_CALLEE = asmentry - sp1_PreShiftSpr_callee