some fixes to accented characters
[tangerine.git] / rom / hyperlayers / layersstrap_init.c
blobbcc3cba4a268b8dff6d13fd32d6bec34fe960e84
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: layers.library Resident and initialization.
6 Lang: english
7 */
9 #include <exec/types.h>
10 #include <exec/resident.h>
11 #include <graphics/gfxbase.h>
12 #include <proto/exec.h>
13 #include "libdefs.h"
14 #include "layers_extfuncs.h"
16 #include <graphics/clip.h>
17 #include <graphics/regions.h>
18 #include <graphics/layers.h>
19 #include <aros/asmcall.h>
21 #define DEBUG 0
22 #include <aros/debug.h>
23 #undef kprintf
25 extern const UBYTE Layers_name[];
26 extern const UBYTE Layers_version[];
27 extern UBYTE Layers_dearray[];
28 int Layers_start(void);
29 void patchlist(void);
30 extern const char END;
32 int Layers_entry(void)
34 /* If the library was executed by accident return error code. */
35 return -1;
38 struct SpecialResident
40 struct Resident res;
41 ULONG magiccookie;
42 UBYTE *statusarray;
43 UWORD maxslot;
46 #define SR_COOKIE 0x4afa4afb
48 const struct SpecialResident Layers_resident =
51 RTC_MATCHWORD,
52 (struct Resident *)&Layers_resident,
53 (APTR)&END,
54 RTF_COLDSTART,
55 LIBVERSION,
56 NT_LIBRARY,
57 63, /* priority; just after layers.library */
58 (STRPTR)Layers_name,
59 (STRPTR)&Layers_version[6],
60 &Layers_start
62 SR_COOKIE, /* magic cookie to recognize a patchable library */
63 Layers_dearray, /* pointer to array of function status bytes */
64 36 /* highest vector slot in this library */
67 UBYTE Layers_dearray[] =
69 /* 36 functions in layers.library V40 (plus one for offset 0) */
70 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0- 9 */
71 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 10- 19 */
72 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20- 29 */
73 1, 1, 1, 1, 1, 1, 1 /* 30- 39 */
76 const UBYTE Layers_name[]="layers.strap";
78 const UBYTE Layers_version[]="$VER: layers.strap 41.2 (02.11.1997)";
80 #define SetFunc(offset,name) \
81 { \
82 if(Layers_dearray[offset]) \
83 SetFunction((struct Library *)LayersBase, (offset * -6), (APTR)&AROS_SLIB_ENTRY(name,Layers)); \
86 /* use this to disable a setfunc that doesn't work yet */
87 #define SetFunc0(offset,name) /* eps */
89 /* use this to disable a setfunc that works (to keep the 2 types apart), so
90 * the malfunctioning function can be isolated
91 * If this doesn't make sense, don't worry. :-)
93 #define SetFunc1(offset,name) /* eps */
95 int Layers_start(void)
97 struct Library *LayersBase;
98 struct Library *SysBase = *(void **)4;
100 D(bug("\nlayers.strap installing...\n"));
101 D(patchlist());
103 if( (LayersBase = OpenLibrary("layers.library", 37)))
106 * fc = functions correctly (according to observations or test program)
107 * ni = not implemented
109 SetFunc1( 5, InitLayers); // fc
110 SetFunc1( 6, CreateUpfrontLayer); // fc
111 SetFunc1( 7, CreateBehindLayer); // fc
112 SetFunc0( 8, UpfrontLayer); // ni
113 SetFunc0( 9, BehindLayer); // ni
114 SetFunc1(10, MoveLayer); // fc
115 SetFunc1(11, SizeLayer); // fc
116 SetFunc0(12, ScrollLayer); // ni
117 SetFunc0(13, BeginUpdate); // ni
118 SetFunc0(14, EndUpdate); // ni
119 SetFunc0(15, DeleteLayer); // ni
120 SetFunc1(16, LockLayer); // fc
121 SetFunc1(17, UnlockLayer); // fc
122 SetFunc0(18, LockLayers); // ni
123 SetFunc0(19, UnlockLayers); // ni
124 SetFunc1(20, LockLayerInfo); // fc
125 SetFunc1(21, SwapBitsRastPortClipRect); // fc
126 SetFunc1(22, WhichLayer); // fc
127 SetFunc1(23, UnlockLayerInfo); // fc
128 SetFunc1(24, NewLayerInfo); // fc
129 SetFunc1(25, DisposeLayerInfo); // fc
130 SetFunc1(26, FattenLayerInfo); // fc
131 SetFunc1(27, ThinLayerInfo); // fc
132 SetFunc0(28, MoveLayerInFrontOf); // ni
133 SetFunc0(29, InstallClipRegion); // ni
134 SetFunc0(30, MoveSizeLayer); // ni
135 SetFunc1(31, CreateUpfrontHookLayer); // fc
136 SetFunc0(32, CreateBehindHookLayer); // ni
137 SetFunc1(33, InstallLayerHook); // fc
138 SetFunc1(34, InstallLayerInfoHook); // fc
139 SetFunc1(35, SortLayerCR); // fc
140 SetFunc1(36, DoHookClipRects); // fc
143 * General note about these functions: superbitmap handling is untested!
146 CloseLibrary(LayersBase);
149 return 0;
152 D(void patchlist(void)
154 int i;
156 for(i = 1; i < Layers_resident.maxslot; i++)
157 kprintf(Layers_dearray[i] ? "+" : "-");
159 kprintf("\n\n");