Subversion Repositories pentevo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
716 lvd 1
#include "std.h"
2
 
3
#include "emul.h"
4
#include "vars.h"
5
#include "draw.h"
6
#include "dxrframe.h"
7
#include "dxrcopy.h"
8
#include "dxr_atmf.h"
9
 
10
// small
11
void rend_atmframe8(unsigned char *dst, unsigned pitch)
12
{
13
   if (!conf.updateb)
14
       return;
15
   unsigned char *src = rbuf;
16
   unsigned scx = temp.scx, delta = scx/4;
17
   unsigned top = (temp.scy-200)/2;
18
   unsigned y;
19
   for (y = 0; y < top; y++)
20
   {
21
      line8(dst, src, t.sctab8[0]); dst += pitch;
22
      src += delta;
23
   }
24
   temp.scx = (scx-320)/2;
25
   unsigned r_start = scx - temp.scx;
26
   unsigned scr_offs = r_start*2;
27
   unsigned atr_offs = r_start/4;
28
   for (y = 0; y < 200; y++)
29
   {
30
      line8(dst, src, t.sctab8[0]);
31
      line8(dst+scr_offs, src + atr_offs, t.sctab8[0]);
32
      dst += pitch,
33
      src += delta;
34
   }
35
   temp.scx = scx;
36
   for (y = 0; y < top; y++)
37
   {
38
      line8(dst, src, t.sctab8[0]); dst += pitch;
39
      src += delta;
40
   }
41
}
42
 
43
void rend_atmframe16(unsigned char *dst, unsigned pitch)
44
{
45
   if (!conf.updateb)
46
       return;
47
   unsigned char *src = rbuf;
48
   unsigned scx = temp.scx, delta = scx/4;
49
   unsigned top = (temp.scy-200)/2;
50
   unsigned y;
51
   for (y = 0; y < top; y++)
52
   {
53
      line16(dst, src, t.sctab16d[0]); dst += pitch;
54
      src += delta;
55
   }
56
   temp.scx = (scx-320)/2;
57
   unsigned r_start = scx - temp.scx;
58
   unsigned scr_offs = r_start*4;
59
   unsigned atr_offs = r_start/4;
60
 
61
   for (y = 0; y < 200; y++)
62
   {
63
      line16(dst, src, t.sctab16[0]);
64
      line16(dst+scr_offs, src + atr_offs, t.sctab16d[0]);
65
      dst += pitch,
66
      src += delta;
67
   }
68
 
69
   temp.scx = scx;
70
   for (y = 0; y < top; y++)
71
   {
72
      line16(dst, src, t.sctab16[0]); dst += pitch;
73
      src += delta;
74
   }
75
}
76
 
77
void rend_atmframe32(unsigned char *dst, unsigned pitch)
78
{
79
   if (!conf.updateb)
80
       return;
81
   unsigned char *src = rbuf;
82
   unsigned scx = temp.scx, delta = scx/4;
83
   unsigned top = (temp.scy-200)/2;
84
   unsigned y;
85
   for (y = 0; y < top; y++)
86
   {
87
      line32(dst, src, t.sctab32[0]); dst += pitch;
88
      src += delta;
89
   }
90
   temp.scx = (scx-320)/2;
91
   unsigned r_start = scx - temp.scx;
92
   unsigned scr_offs = r_start*8;
93
   unsigned atr_offs = r_start/4;
94
   for (y = 0; y < 200; y++)
95
   {
96
      line32(dst, src, t.sctab32[0]);
97
      line32(dst+scr_offs, src + atr_offs, t.sctab32[0]);
98
      dst += pitch,
99
      src += delta;
100
   }
101
   temp.scx = scx;
102
   for (y = 0; y < top; y++)
103
   {
104
      line32(dst, src, t.sctab32[0]); dst += pitch;
105
      src += delta;
106
   }
107
}
108
 
109
 
110
// double
111
void rend_atmframe_8d1(unsigned char *dst, unsigned pitch)
112
{
113
   if (!conf.updateb) return;
114
   unsigned char *src = rbuf; unsigned scx = temp.scx, delta = scx/4;
115
   unsigned top = (temp.scy-200)/2;
116
   unsigned y; //Alone Coder 0.36.7
117
   for (/*unsigned*/ y = 0; y < top; y++) {
118
      line8d(dst, src, t.sctab8d[0]); dst += pitch;
119
      src += delta;
120
   }
121
   temp.scx = (scx-320)/2;
122
   unsigned r_start = scx - temp.scx,
123
            scr_offs = r_start*2,
124
            atr_offs = r_start/4;
125
   for (y = 0; y < 200; y++) {
126
      line8d(dst, src, t.sctab8d[0]);
127
      line8d(dst+scr_offs, src + atr_offs, t.sctab8d[0]);
128
      dst += pitch; src += delta;
129
   }
130
   temp.scx = scx;
131
   for (y = 0; y < top; y++) {
132
      line8d(dst, src, t.sctab8d[0]); dst += pitch;
133
      src += delta;
134
   }
135
}
136
 
137
void rend_atmframe_8d(unsigned char *dst, unsigned pitch)
138
{
139
   if (!conf.updateb) return;
140
   unsigned char *src = rbuf; unsigned scx = temp.scx, delta = scx/4;
141
   unsigned top = (temp.scy-200)/2;
142
   unsigned y; //Alone Coder 0.36.7
143
   for (/*unsigned*/ y = 0; y < top; y++) {
144
      line8d(dst, src, t.sctab8d[0]); dst += pitch;
145
      line8d(dst, src, t.sctab8d[1]); dst += pitch;
146
      src += delta;
147
   }
148
   temp.scx = (scx-320)/2;
149
   unsigned r_start = scx - temp.scx,
150
            scr_offs = r_start*2,
151
            atr_offs = r_start/4;
152
   for (y = 0; y < 200; y++) {
153
      line8d(dst, src, t.sctab8d[0]);
154
      line8d(dst+scr_offs, src + atr_offs, t.sctab8d[0]);
155
      dst += pitch,
156
      line8d(dst, src, t.sctab8d[1]);
157
      line8d(dst+scr_offs, src + atr_offs, t.sctab8d[1]);
158
      dst += pitch,
159
      src += delta;
160
   }
161
   temp.scx = scx;
162
   for (y = 0; y < top; y++) {
163
      line8d(dst, src, t.sctab8d[0]); dst += pitch;
164
      line8d(dst, src, t.sctab8d[1]); dst += pitch;
165
      src += delta;
166
   }
167
}
168
 
169
void rend_atmframe_16d1(unsigned char *dst, unsigned pitch)
170
{
171
   if (!conf.updateb) return;
172
   unsigned char *src = rbuf; unsigned scx = temp.scx, delta = scx/4;
173
   unsigned top = (temp.scy-200)/2;
174
   unsigned y; //Alone Coder 0.36.7
175
   for (/*unsigned*/ y = 0; y < top; y++) {
176
      line16d(dst, src, t.sctab16d[0]); dst += pitch;
177
      src += delta;
178
   }
179
   temp.scx = (scx-320)/2;
180
   unsigned r_start = scx - temp.scx,
181
            scr_offs = r_start*4,
182
            atr_offs = r_start/4;
183
   for (y = 0; y < 200; y++) {
184
      line16d(dst, src, t.sctab16d[0]);
185
      line16d(dst+scr_offs, src + atr_offs, t.sctab16d[0]);
186
      dst += pitch; src += delta;
187
   }
188
   temp.scx = scx;
189
   for (y = 0; y < top; y++) {
190
      line16d(dst, src, t.sctab16d[0]); dst += pitch;
191
      src += delta;
192
   }
193
}
194
 
195
void rend_atmframe_16d(unsigned char *dst, unsigned pitch)
196
{
197
   if (!conf.updateb) return;
198
   unsigned char *src = rbuf; unsigned scx = temp.scx, delta = scx/4;
199
   unsigned top = (temp.scy-200)/2;
200
   unsigned y; //Alone Coder 0.36.7
201
   for (/*unsigned*/ y = 0; y < top; y++) {
202
      line16d(dst, src, t.sctab16d[0]); dst += pitch;
203
      line16d(dst, src, t.sctab16d[1]); dst += pitch;
204
      src += delta;
205
   }
206
   temp.scx = (scx-320)/2;
207
   unsigned r_start = scx - temp.scx,
208
            scr_offs = r_start*4,
209
            atr_offs = r_start/4;
210
   for (y = 0; y < 200; y++) {
211
      line16d(dst, src, t.sctab16d[0]);
212
      line16d(dst+scr_offs, src + atr_offs, t.sctab16d[0]);
213
      dst += pitch,
214
      line16d(dst, src, t.sctab16d[1]);
215
      line16d(dst+scr_offs, src + atr_offs, t.sctab16d[1]);
216
      dst += pitch,
217
      src += delta;
218
   }
219
   temp.scx = scx;
220
   for (y = 0; y < top; y++) {
221
      line16d(dst, src, t.sctab16d[0]); dst += pitch;
222
      line16d(dst, src, t.sctab16d[1]); dst += pitch;
223
      src += delta;
224
   }
225
}
226
 
227
void rend_atmframe_32d1(unsigned char *dst, unsigned pitch)
228
{
229
   if (!conf.updateb) return;
230
   unsigned char *src = rbuf; unsigned scx = temp.scx, delta = scx/4;
231
   unsigned top = (temp.scy-200)/2;
232
   unsigned y; //Alone Coder 0.36.7
233
   for (/*unsigned*/ y = 0; y < top; y++) {
234
      line32d(dst, src, t.sctab32[0]); dst += pitch;
235
      src += delta;
236
   }
237
   temp.scx = (scx-320)/2;
238
   unsigned r_start = scx - temp.scx,
239
            scr_offs = r_start*8,
240
            atr_offs = r_start/4;
241
   for (y = 0; y < 200; y++) {
242
      line32d(dst, src, t.sctab32[0]);
243
      line32d(dst+scr_offs, src + atr_offs, t.sctab32[0]);
244
      dst += pitch; src += delta;
245
   }
246
   temp.scx = scx;
247
   for (y = 0; y < top; y++) {
248
      line32d(dst, src, t.sctab32[0]); dst += pitch;
249
      src += delta;
250
   }
251
}
252
 
253
void rend_atmframe_32d(unsigned char *dst, unsigned pitch)
254
{
255
   if (!conf.updateb) return;
256
   unsigned char *src = rbuf; unsigned scx = temp.scx, delta = scx/4;
257
   unsigned top = (temp.scy-200)/2;
258
   unsigned y; //Alone Coder 0.36.7
259
   for (/*unsigned*/ y = 0; y < top; y++) {
260
      line32d(dst, src, t.sctab32[0]); dst += pitch;
261
      line32d(dst, src, t.sctab32[1]); dst += pitch;
262
      src += delta;
263
   }
264
   temp.scx = (scx-320)/2;
265
   unsigned r_start = scx - temp.scx,
266
            scr_offs = r_start*8,
267
            atr_offs = r_start/4;
268
   for (y = 0; y < 200; y++) {
269
      line32d(dst, src, t.sctab32[0]);
270
      line32d(dst+scr_offs, src + atr_offs, t.sctab32[0]);
271
      dst += pitch,
272
      line32d(dst, src, t.sctab32[1]);
273
      line32d(dst+scr_offs, src + atr_offs, t.sctab32[1]);
274
      dst += pitch,
275
      src += delta;
276
   }
277
   temp.scx = scx;
278
   for (y = 0; y < top; y++) {
279
      line32d(dst, src, t.sctab32[0]); dst += pitch;
280
      line32d(dst, src, t.sctab32[1]); dst += pitch;
281
      src += delta;
282
   }
283
}