source: buchla-68k/orig/GEMDOS/BLT.C

Last change on this file was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 1.3 KB
Line 
1/*
2 =============================================================================
3 blt.c -- block image transfer functions for the Atari
4 Version 1 -- 1988-08-15 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "osbind.h"
9
10extern short gl_hres; /* horizontal resolution */
11
12cpy_raster(src, dst, width )
13register short *src, *dst, width;
14{
15 if ((long)src > (long)dst) {
16
17 while (width--)
18 *dst++ = *src++;
19
20 } else {
21
22 while (width--)
23 *(dst + width) = *(src + width);
24 }
25}
26
27cpy_block(src_x, src_y, src_w, src_h, dst_x, dst_y )
28short src_x, src_y;
29register short src_w, src_h;
30short dst_x, dst_y;
31{
32 register short *pbase, *src_base, *dst_base;
33
34 pbase = (short *)Physbase();
35
36 if (src_y > dst_y) {
37
38 (long)src_base = (long)pbase + (src_y * gl_hres) + src_x;
39 (long)dst_base = (long)pbase + (dst_y * gl_hres) + dst_x;
40
41 while (src_h--) {
42
43 cpy_raster(src_base, dst_base, src_w);
44 src_base += gl_hres;
45 dst_base += gl_hres;
46 }
47
48 } else {
49
50 (long)src_base = (long)pbase + ((src_y + src_h) * gl_hres);
51 (long)dst_base = (long)pbase + ((dst_y + src_h) * gl_hres);
52
53 while (src_h--) {
54
55 cpy_raster(src_base, dst_base, src_w);
56 src_base -= gl_hres;
57 dst_base -= gl_hres;
58 }
59 }
60}
61
Note: See TracBrowser for help on using the repository browser.