Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / hidds / nvidia / nvidiabitmap.c
blobcf2bfe6201f6182f5166eb3b61c14a2bf65e825c
1 /*
2 Copyright © 2004-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: NVidia bitmap class
6 Lang: English
7 */
9 #include <exec/types.h>
10 #include <exec/memory.h>
12 #include <hidd/hidd.h>
13 #include <hidd/graphics.h>
15 #include <proto/exec.h>
16 #include <proto/oop.h>
17 #include <proto/utility.h>
19 #include <aros/symbolsets.h>
21 #include "nv.h"
22 #include "nv_dma.h"
24 #define DEBUG 0
25 #include <aros/debug.h>
27 #define _sd (&((LIBBASETYPEPTR)cl->UserData)->sd)
29 #undef HiddPCIDeviceAttrBase
30 #undef HiddGfxAttrBase
31 #undef HiddPixFmtAttrBase
32 #undef HiddSyncAttrBase
33 #undef HiddBitMapAttrBase
34 #define HiddPCIDeviceAttrBase (_sd->pciAttrBase)
35 #define HiddNVidiaBitMapAttrBase (_sd->nvBitMapAttrBase)
36 #define HiddBitMapAttrBase (_sd->bitMapAttrBase)
37 #define HiddPixFmtAttrBase (_sd->pixFmtAttrBase)
38 #define HiddGfxAttrBase (_sd->gfxAttrBase)
39 #define HiddSyncAttrBase (_sd->syncAttrBase)
41 /* Class methods */
43 OOP_Object *NVOnBM__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg)
45 EnterFunc(bug("[NVBitMap] OnBitmap::New()\n"));
47 o = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
48 D(bug("o=%p, cl=%p\n", o, cl));
50 if (o)
52 nvBitMap *bm = OOP_INST_DATA(cl, o);
54 IPTR fb;
55 IPTR width, height, depth;
56 UBYTE bytesPerPixel;
58 OOP_Object *pf;
60 InitSemaphore(&bm->bmLock);
62 D(bug("[NVBitMap] Super called. o=%p\n", o));
64 bm->onbm = TRUE;
66 OOP_GetAttr(o, aHidd_BitMap_Width, &width);
67 OOP_GetAttr(o, aHidd_BitMap_Height, &height);
68 OOP_GetAttr(o, aHidd_BitMap_PixFmt, (APTR)&pf);
69 OOP_GetAttr(pf, aHidd_PixFmt_Depth, &depth);
71 fb = GetTagData(aHidd_BitMap_FrameBuffer, FALSE, msg->attrList);
73 D(bug("[NVBitmap] width=%d height=%d depth=%d\n", width, height, depth));
75 if (width == 0 || height == 0 || depth == 0)
77 bug("[NVBitMap] size mismatch!\n");
80 if (depth <= 8)
81 bytesPerPixel = 1;
82 else if (depth <= 16)
83 bytesPerPixel = 2;
84 else
85 bytesPerPixel = 4;
87 if (fb)
89 width = 640;
90 height = 480;
91 bytesPerPixel = 2;
92 depth = 16;
95 bm->width = width;
96 bm->height = height;
97 bm->pitch = (width * bytesPerPixel + 63) & ~63;
98 bm->depth = depth;
99 bm->bpp = bytesPerPixel;
101 bm->framebuffer = AllocBitmapArea(_sd, bm->width, bm->height,
102 bm->bpp, TRUE);
104 bm->fbgfx = TRUE;
105 bm->BitMap = o;
106 bm->usecount = 0;
108 switch(bm->depth)
110 case 32:
111 case 24:
112 bm->surface_format = SURFACE_FORMAT_DEPTH24;
113 bm->pattern_format = PATTERN_FORMAT_DEPTH24;
114 bm->rect_format = RECT_FORMAT_DEPTH24;
115 bm->line_format = LINE_FORMAT_DEPTH24;
116 break;
117 case 16:
118 case 15:
119 bm->surface_format = SURFACE_FORMAT_DEPTH16;
120 bm->pattern_format = PATTERN_FORMAT_DEPTH16;
121 bm->rect_format = RECT_FORMAT_DEPTH16;
122 bm->line_format = LINE_FORMAT_DEPTH16;
123 break;
124 default:
125 bm->surface_format = SURFACE_FORMAT_DEPTH8;
126 bm->pattern_format = PATTERN_FORMAT_DEPTH8;
127 bm->rect_format = RECT_FORMAT_DEPTH8;
128 bm->line_format = LINE_FORMAT_DEPTH8;
129 break;
132 if (fb && bm->framebuffer != 0xffffffff)
134 bm->state = (struct CardState *)AllocPooled(_sd->memPool,
135 sizeof(struct CardState));
137 bzero(_sd->Card.FrameBuffer + bm->framebuffer, 640*480*2);
139 if (bm->state)
141 LOCK_HW
143 InitMode(_sd, bm->state, 640, 480, 16, 25200, bm->framebuffer,
144 640, 480,
145 656, 752, 800,
146 490, 492, 525);
148 LoadState(_sd, bm->state);
149 DPMS(_sd, _sd->dpms);
151 UNLOCK_HW
153 return o;
156 else if (bm->framebuffer != 0xffffffff)
158 HIDDT_ModeID modeid;
159 OOP_Object *sync;
161 /* We should be able to get modeID from the bitmap */
162 OOP_GetAttr(o, aHidd_BitMap_ModeID, &modeid);
164 D(bug("[NVBitMap] BM_ModeID=%x\n", modeid));
166 if (modeid != vHidd_ModeID_Invalid)
168 IPTR pixel;
169 IPTR hdisp, vdisp, hstart, hend, htotal, vstart, vend, vtotal;
171 /* Get Sync and PixelFormat properties */
172 struct pHidd_Gfx_GetMode __getmodemsg = {
173 modeID: modeid,
174 syncPtr: &sync,
175 pixFmtPtr: &pf,
176 }, *getmodemsg = &__getmodemsg;
178 getmodemsg->mID = OOP_GetMethodID(IID_Hidd_Gfx, moHidd_Gfx_GetMode);
179 OOP_DoMethod(_sd->nvobject, (OOP_Msg)getmodemsg);
181 OOP_GetAttr(sync, aHidd_Sync_PixelClock, &pixel);
182 OOP_GetAttr(sync, aHidd_Sync_HDisp, &hdisp);
183 OOP_GetAttr(sync, aHidd_Sync_VDisp, &vdisp);
184 OOP_GetAttr(sync, aHidd_Sync_HSyncStart, &hstart);
185 OOP_GetAttr(sync, aHidd_Sync_VSyncStart, &vstart);
186 OOP_GetAttr(sync, aHidd_Sync_HSyncEnd, &hend);
187 OOP_GetAttr(sync, aHidd_Sync_VSyncEnd, &vend);
188 OOP_GetAttr(sync, aHidd_Sync_HTotal, &htotal);
189 OOP_GetAttr(sync, aHidd_Sync_VTotal, &vtotal);
191 bm->state = (struct CardState *)AllocPooled(_sd->memPool,
192 sizeof(struct CardState));
194 pixel /= 1000;
196 if (bm->state)
198 LOCK_HW
200 InitMode(_sd, bm->state, bm->pitch/bytesPerPixel, height, depth, pixel, bm->framebuffer,
201 hdisp, vdisp,
202 hstart, hend, htotal,
203 vstart, vend, vtotal);
205 LoadState(_sd, bm->state);
206 DPMS(_sd, _sd->dpms);
208 UNLOCK_HW
210 return o;
214 OOP_MethodID disp_mid = OOP_GetMethodID(IID_Root, moRoot_Dispose);
215 OOP_CoerceMethod(cl, o, (OOP_Msg) &disp_mid);
218 return NULL;
221 OOP_Object *NVOffBM__Root__New(OOP_Class *cl, OOP_Object *o, struct pRoot_New *msg)
223 EnterFunc(bug("[NVBitMap] OffBitmap::New()\n"));
225 o = (OOP_Object *)OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
227 if (o)
229 nvBitMap *bm = OOP_INST_DATA(cl, o);
231 IPTR width, height, depth;
232 UBYTE bytesPerPixel;
234 OOP_Object *pf;
236 InitSemaphore(&bm->bmLock);
238 bm->onbm = FALSE;
240 OOP_GetAttr(o, aHidd_BitMap_Width, &width);
241 OOP_GetAttr(o, aHidd_BitMap_Height, &height);
242 OOP_GetAttr(o, aHidd_BitMap_PixFmt, (APTR)&pf);
243 OOP_GetAttr(pf, aHidd_PixFmt_Depth, &depth);
244 D(bug("[NVBitmap] width=%d height=%d depth=%d\n", width, height, depth));
246 if (width == 0 || height == 0 || depth == 0)
248 bug("[NVBitMap] size mismatch!\n");
251 if (depth <= 8)
252 bytesPerPixel = 1;
253 else if (depth <= 16)
254 bytesPerPixel = 2;
255 else
256 bytesPerPixel = 4;
258 bm->width = width;
259 bm->height = height;
260 bm->pitch = (width * bytesPerPixel + 63) & ~63;
261 bm->depth = depth;
262 bm->state = NULL;
263 bm->bpp = bytesPerPixel;
265 bm->framebuffer = AllocBitmapArea(_sd, bm->width, bm->height,
266 bm->bpp, TRUE);
268 if (bm->framebuffer == -1)
270 bm->framebuffer = (IPTR)AllocMem(bm->pitch * bm->height,
271 MEMF_PUBLIC | MEMF_CLEAR);
272 bm->fbgfx = FALSE;
274 else
275 bm->fbgfx = TRUE;
277 bm->BitMap = o;
278 bm->usecount = 0;
280 switch(bm->depth)
282 case 32:
283 case 24:
284 bm->surface_format = SURFACE_FORMAT_DEPTH24;
285 bm->pattern_format = PATTERN_FORMAT_DEPTH24;
286 bm->rect_format = RECT_FORMAT_DEPTH24;
287 bm->line_format = LINE_FORMAT_DEPTH24;
288 break;
289 case 16:
290 case 15:
291 bm->surface_format = SURFACE_FORMAT_DEPTH16;
292 bm->pattern_format = PATTERN_FORMAT_DEPTH16;
293 bm->rect_format = RECT_FORMAT_DEPTH16;
294 bm->line_format = LINE_FORMAT_DEPTH16;
295 break;
296 default:
297 bm->surface_format = SURFACE_FORMAT_DEPTH8;
298 bm->pattern_format = PATTERN_FORMAT_DEPTH8;
299 bm->rect_format = RECT_FORMAT_DEPTH8;
300 bm->line_format = LINE_FORMAT_DEPTH8;
301 break;
304 if ((bm->framebuffer != 0xffffffff) && (bm->framebuffer != 0))
306 return o;
310 OOP_MethodID disp_mid = OOP_GetMethodID(IID_Root, moRoot_Dispose);
311 OOP_CoerceMethod(cl, o, (OOP_Msg) &disp_mid);
313 return NULL;
317 VOID NVBM__Root__Dispose(OOP_Class *cl, OOP_Object *o, OOP_Msg msg)
319 nvBitMap *bm = OOP_INST_DATA(cl, o);
321 LOCK_BITMAP
322 LOCK_HW
323 NVDmaKickoff(&_sd->Card);
324 NVSync(_sd);
326 if (bm->fbgfx)
328 FreeBitmapArea(_sd, bm->framebuffer, bm->width, bm->height, bm->bpp);
330 bm->framebuffer = -1;
331 bm->fbgfx = 0;
333 else
334 FreeMem((APTR)bm->framebuffer, bm->pitch * bm->height);
336 if (bm->state)
337 FreePooled(_sd->memPool, bm->state, sizeof(struct CardState));
339 bm->state = NULL;
341 UNLOCK_HW
342 UNLOCK_BITMAP
344 OOP_DoSuperMethod(cl, o, msg);
347 void NVBM__Root__Get(OOP_Class *cl, OOP_Object *o, struct pRoot_Get *msg)
349 nvBitMap *bm = OOP_INST_DATA(cl, o);
350 ULONG idx;
352 if (IS_NVBM_ATTR(msg->attrID, idx))
354 switch (idx)
356 case aoHidd_nvBitMap_Drawable:
357 if (bm->fbgfx)
358 *msg->storage = bm->framebuffer + (IPTR)_sd->Card.FrameBuffer;
359 else
360 *msg->storage = bm->framebuffer;
361 break;
363 default:
364 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
367 else
369 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
373 VOID NVBM__Hidd_BitMap__Clear(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_Clear *msg)
375 nvBitMap *bm = OOP_INST_DATA(cl, o);
377 LOCK_BITMAP
379 D(bug("[NVBitMap] Clear()\n"));
381 if (bm->fbgfx)
383 LOCK_HW
385 bm->usecount++;
387 _sd->Card.DMAKickoffCallback = NVDMAKickoffCallback;
389 NVDmaStart(&_sd->Card, SURFACE_FORMAT, 4);
390 NVDmaNext(&_sd->Card, bm->surface_format);
391 NVDmaNext(&_sd->Card, (bm->pitch << 16) | _sd->src_pitch);
392 NVDmaNext(&_sd->Card, _sd->src_offset);
393 NVDmaNext(&_sd->Card, bm->framebuffer);
395 _sd->surface_format = bm->surface_format;
396 _sd->dst_pitch = bm->pitch;
397 _sd->dst_offset = bm->framebuffer;
399 NVDmaStart(&_sd->Card, RECT_FORMAT, 1);
400 NVDmaNext(&_sd->Card, bm->rect_format);
401 _sd->rect_format = bm->rect_format;
403 NVSetRopSolid(_sd, vHidd_GC_DrawMode_Copy, ~0 << bm->depth);
404 NVDmaStart(&_sd->Card, RECT_SOLID_COLOR, 1);
405 NVDmaNext(&_sd->Card, GC_BG(msg->gc));
407 NVDmaStart(&_sd->Card, RECT_SOLID_RECTS(0), 2);
408 NVDmaNext(&_sd->Card, 0);
409 NVDmaNext(&_sd->Card, (bm->width << 16) | (bm->height));
411 NVDmaKickoff(&_sd->Card);
412 //NVSync(_sd);
414 UNLOCK_HW
416 else
418 ULONG *ptr = (ULONG*)bm->framebuffer;
419 ULONG val=0;
420 int i = bm->width * bm->height * bm->bpp / 4;
422 if (_sd->gpu_busy)
424 LOCK_HW
425 NVSync(_sd);
426 UNLOCK_HW
429 switch (bm->bpp)
431 case 1:
432 val = GC_BG(msg->gc) & 0xff;
433 val |= val << 8;
434 val |= val << 16;
435 break;
436 case 2:
437 val = GC_BG(msg->gc) << 16 | (GC_BG(msg->gc) & 0xffff);
438 break;
439 default:
440 val = GC_BG(msg->gc);
441 break;
446 *ptr++ = val;
447 } while(--i);
451 UNLOCK_BITMAP
455 VOID NVBM__Hidd_BitMap__PutPixel(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_PutPixel *msg)
457 nvBitMap *bm = OOP_INST_DATA(cl, o);
459 LOCK_BITMAP
461 UBYTE *ptr = (UBYTE*)((IPTR)bm->framebuffer + bm->bpp * msg->x + bm->pitch * msg->y);
463 if (bm->fbgfx)
465 ptr += (IPTR)_sd->Card.FrameBuffer;
466 if (_sd->gpu_busy)
468 LOCK_HW
469 NVSync(_sd);
470 UNLOCK_HW
474 switch (bm->bpp)
476 case 1:
477 *ptr = msg->pixel;
478 break;
479 case 2:
480 *(UWORD*)ptr = msg->pixel;
481 break;
482 case 4:
483 *(ULONG*)ptr = msg->pixel;
484 break;
487 UNLOCK_BITMAP
490 HIDDT_Pixel NVBM__Hidd_BitMap__GetPixel(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_GetPixel *msg)
492 HIDDT_Pixel pixel=0;
493 nvBitMap *bm = OOP_INST_DATA(cl, o);
495 LOCK_BITMAP
497 UBYTE *ptr = (UBYTE*)((IPTR)bm->framebuffer + bm->bpp * msg->x + bm->pitch * msg->y);
499 if (bm->fbgfx)
501 ptr += (IPTR)_sd->Card.FrameBuffer;
502 if (_sd->gpu_busy)
504 LOCK_HW
505 NVSync(_sd);
506 UNLOCK_HW
510 switch (bm->bpp)
512 case 1:
513 pixel = *ptr;
514 break;
515 case 2:
516 pixel = *(UWORD*)ptr;
517 break;
518 case 4:
519 pixel = *(ULONG*)ptr;
520 break;
523 UNLOCK_BITMAP
525 /* Get pen number from colortab */
526 return pixel;
529 VOID NVBM__Hidd_BitMap__FillRect(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_DrawRect *msg)
531 nvBitMap *bm = OOP_INST_DATA(cl, o);
533 LOCK_BITMAP
535 D(bug("[NVBitMap] FillRect(%p,%d,%d,%d,%d)\n",
536 bm->framebuffer, msg->minX, msg->minY, msg->maxX, msg->maxY));
538 if (bm->fbgfx)
540 LOCK_HW
542 bm->usecount++;
544 _sd->Card.DMAKickoffCallback = NVDMAKickoffCallback;
545 _sd->gpu_busy = TRUE;
547 NVDmaStart(&_sd->Card, SURFACE_FORMAT, 4);
548 NVDmaNext(&_sd->Card, bm->surface_format);
549 NVDmaNext(&_sd->Card, (bm->pitch << 16) | _sd->src_pitch);
550 NVDmaNext(&_sd->Card, _sd->src_offset);
551 NVDmaNext(&_sd->Card, bm->framebuffer);
553 _sd->surface_format = bm->surface_format;
554 _sd->dst_pitch = bm->pitch;
555 _sd->dst_offset = bm->framebuffer;
557 NVDmaStart(&_sd->Card, RECT_FORMAT, 1);
558 NVDmaNext(&_sd->Card, bm->rect_format);
559 _sd->rect_format = bm->rect_format;
561 NVSetRopSolid(_sd, GC_DRMD(msg->gc), ~0 << bm->depth);
562 NVDmaStart(&_sd->Card, RECT_SOLID_COLOR, 1);
563 NVDmaNext(&_sd->Card, GC_FG(msg->gc));
565 NVDmaStart(&_sd->Card, RECT_SOLID_RECTS(0), 2);
566 NVDmaNext(&_sd->Card, (msg->minX << 16) | (msg->minY & 0xffff));
567 NVDmaNext(&_sd->Card, ((msg->maxX - msg->minX + 1) << 16)
568 | ((msg->maxY - msg->minY + 1) & 0xffff));
570 NVDmaKickoff(&_sd->Card);
572 // if ((msg->maxX - msg->minX) * (msg->maxY - msg->minY) > 512)
573 // NVSync(_sd);
575 UNLOCK_HW
577 else
579 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
582 UNLOCK_BITMAP
585 ULONG NVBM__Hidd_BitMap__BytesPerLine(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_BytesPerLine *msg)
587 nvBitMap *bm = OOP_INST_DATA(cl, o);
589 return (bm->bpp * msg->width + 63) & ~63;
592 VOID NVBM__Hidd_BitMap__DrawLine(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_DrawLine *msg)
594 OOP_Object *gc = msg->gc;
595 nvBitMap *bm = OOP_INST_DATA(cl, o);
597 LOCK_BITMAP
599 D(bug("[NVBitmap] DrawLine(%p, %d, %d, %d, %d)\n",
600 bm->framebuffer, msg->x1, msg->y1, msg->x2, msg->y2));
602 if ((GC_LINEPAT(gc) != (UWORD)~0) || !bm->fbgfx)
604 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
606 else
608 LOCK_HW
610 bm->usecount++;
613 _sd->Card.DMAKickoffCallback = NVDMAKickoffCallback;
614 _sd->gpu_busy = TRUE;
616 NVDmaStart(&_sd->Card, SURFACE_OFFSET_DST, 1);
617 NVDmaNext(&_sd->Card, bm->framebuffer);
618 _sd->dst_offset = bm->framebuffer;
620 NVDmaStart(&_sd->Card, SURFACE_PITCH, 1);
621 NVDmaNext(&_sd->Card, (bm->pitch << 16) | _sd->src_pitch);
622 _sd->dst_pitch = bm->pitch;
624 if (GC_DOCLIP(gc))
626 NVDmaStart(&_sd->Card, CLIP_POINT, 2);
627 NVDmaNext(&_sd->Card, (GC_CLIPY1(gc) << 16) | GC_CLIPX1(gc));
628 NVDmaNext(&_sd->Card, ((GC_CLIPY2(gc)-GC_CLIPY1(gc)+1) << 16) |
629 (GC_CLIPX2(gc)-GC_CLIPX1(gc)+1));
632 NVSetRopSolid(_sd, GC_DRMD(gc), ~0 << bm->depth);
633 NVDmaStart(&_sd->Card, LINE_FORMAT, 2);
634 NVDmaNext(&_sd->Card, bm->line_format);
635 NVDmaNext(&_sd->Card, GC_FG(gc));
637 NVDmaStart(&_sd->Card, LINE_LINES(0), 4);
638 NVDmaNext(&_sd->Card, (msg->y1 << 16) | (msg->x1 & 0xffff));
639 NVDmaNext(&_sd->Card, (msg->y2 << 16) | (msg->x2 & 0xffff));
640 NVDmaNext(&_sd->Card, (msg->y2 << 16) | (msg->x2 & 0xffff));
641 NVDmaNext(&_sd->Card, ((msg->y2 + 1) << 16) | ((msg->x2 + 1) & 0xffff));
643 if (GC_DOCLIP(gc))
645 NVDmaStart(&_sd->Card, CLIP_POINT, 2);
646 NVDmaNext(&_sd->Card, 0x00000000);
647 NVDmaNext(&_sd->Card, 0xff00ff00);
650 NVDmaKickoff(&_sd->Card);
652 UNLOCK_HW
655 UNLOCK_BITMAP
658 VOID NVBM__Hidd_BitMap__PutImageLUT(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_PutImageLUT *msg)
660 nvBitMap *bm = OOP_INST_DATA(cl, o);
662 LOCK_BITMAP
664 IPTR VideoData = bm->framebuffer;
666 if (bm->fbgfx)
668 VideoData += (IPTR)_sd->Card.FrameBuffer;
670 if (_sd->gpu_busy)
672 LOCK_HW
673 NVSync(_sd);
674 UNLOCK_HW
678 switch(bm->bpp)
680 case 2:
682 struct pHidd_BitMap_CopyLUTMemBox16 __m = {
683 _sd->mid_CopyLUTMemBox16,
684 msg->pixels,
687 (APTR)VideoData,
688 msg->x,
689 msg->y,
690 msg->width,
691 msg->height,
692 msg->modulo,
693 bm->pitch,
694 msg->pixlut
695 }, *m = &__m;
697 OOP_DoMethod(o, (OOP_Msg)m);
699 break;
701 case 4:
703 struct pHidd_BitMap_CopyLUTMemBox32 __m = {
704 _sd->mid_CopyLUTMemBox32,
705 msg->pixels,
708 (APTR)VideoData,
709 msg->x,
710 msg->y,
711 msg->width,
712 msg->height,
713 msg->modulo,
714 bm->pitch,
715 msg->pixlut
716 }, *m = &__m;
718 OOP_DoMethod(o, (OOP_Msg)m);
720 break;
722 default:
723 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
724 break;
726 } /* switch(data->bytesperpix) */
728 UNLOCK_BITMAP
732 VOID NVBM__Hidd_BitMap__BlitColorExpansion(OOP_Class *cl, OOP_Object *o,
733 struct pHidd_BitMap_BlitColorExpansion *msg)
735 nvBitMap *bm = OOP_INST_DATA(cl, o);
737 LOCK_BITMAP
739 if ((OOP_OCLASS(msg->srcBitMap) == _sd->planarbmclass) && bm->fbgfx)
741 struct planarbm_data *planar = OOP_INST_DATA(OOP_OCLASS(msg->srcBitMap), msg->srcBitMap);
742 HIDDT_Pixel bg, fg;
743 ULONG cemd;
744 ULONG expand;
745 ULONG skipleft = msg->srcX - (msg->srcX & ~31);
746 ULONG mask = ~0 << bm->depth;
748 cemd = GC_COLEXP(msg->gc);
749 bg = GC_BG(msg->gc) | mask;
750 fg = GC_FG(msg->gc) | mask;
752 ULONG bw = (msg->width + 31 + skipleft) & ~31;
753 ULONG x = msg->destX, y = msg->destY, w = msg->width, h = msg->height;
755 LOCK_HW
757 bm->usecount++;
759 _sd->gpu_busy = TRUE;
761 NVDmaStart(&_sd->Card, SURFACE_FORMAT, 4);
762 NVDmaNext(&_sd->Card, bm->surface_format);
763 NVDmaNext(&_sd->Card, (bm->pitch << 16) | (_sd->src_pitch));
764 NVDmaNext(&_sd->Card, _sd->src_offset);
765 NVDmaNext(&_sd->Card, bm->framebuffer);
767 NVDmaStart(&_sd->Card, RECT_FORMAT, 1);
768 NVDmaNext(&_sd->Card, bm->rect_format);
770 _sd->surface_format = bm->surface_format;
771 _sd->dst_pitch = bm->pitch;
772 _sd->dst_offset = bm->framebuffer;
774 NVSetRopSolid(_sd, GC_DRMD(msg->gc), ~0 << bm->depth);
776 if (cemd & vHidd_GC_ColExp_Transparent)
778 NVDmaStart(&_sd->Card, RECT_EXPAND_ONE_COLOR_CLIP, 5);
779 NVDmaNext(&_sd->Card, (y << 16) | ((x) & 0xffff));
780 NVDmaNext(&_sd->Card, ((y + h) << 16) | ((x + w) & 0xffff));
781 NVDmaNext(&_sd->Card, fg);
782 NVDmaNext(&_sd->Card, (h << 16) | bw);
783 NVDmaNext(&_sd->Card, (y << 16) | ((x-skipleft) & 0xffff));
784 expand = RECT_EXPAND_ONE_COLOR_DATA(0);
786 else
788 NVDmaStart(&_sd->Card, RECT_EXPAND_TWO_COLOR_CLIP, 7);
789 NVDmaNext(&_sd->Card, (y << 16) | ((x) & 0xffff));
790 NVDmaNext(&_sd->Card, ((y + h) << 16) | ((x + w) & 0xffff));
791 NVDmaNext(&_sd->Card, bg);
792 NVDmaNext(&_sd->Card, fg);
793 NVDmaNext(&_sd->Card, (h << 16) | bw);
794 NVDmaNext(&_sd->Card, (h << 16) | bw);
795 NVDmaNext(&_sd->Card, (y << 16) | ((x-skipleft) & 0xffff));
796 expand = RECT_EXPAND_TWO_COLOR_DATA(0);
799 ULONG i,j;
800 ULONG *ptr = (ULONG*)planar->planes[0];
802 ptr += (planar->bytesperrow * msg->srcY >> 2) +
803 (msg->srcX >> 5);
805 if ((bw >> 5) * h < RECT_EXPAND_ONE_COLOR_DATA_MAX_DWORDS)
807 NVDmaStart(&_sd->Card, expand, (bw >> 5) * h);
808 for (i = 0; i < h; i++)
810 for (j=0; j < (bw >> 5); j++)
812 NVDmaNext(&_sd->Card, ptr[j]);
814 ptr += planar->bytesperrow >> 2;
817 else
819 for (i = 0; i < h; i++)
821 NVDmaStart(&_sd->Card, expand, (bw >> 5));
823 for (j=0; j < (bw >> 5); j++)
825 NVDmaNext(&_sd->Card, ptr[j]);
827 ptr += planar->bytesperrow >> 2;
831 NVDmaStart(&_sd->Card, BLIT_POINT_SRC, 1);
832 NVDmaNext(&_sd->Card, 0);
833 NVDmaKickoff(&_sd->Card);
835 UNLOCK_HW
837 else
838 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
840 UNLOCK_BITMAP
843 VOID NVBM__Hidd_BitMap__DrawRect(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_DrawRect *msg)
845 OOP_Object *gc = msg->gc;
846 nvBitMap *bm = OOP_INST_DATA(cl, o);
847 UWORD addX, addY;
849 LOCK_BITMAP
851 D(bug("[NVBitmap] DrawRect(%p, %d, %d, %d, %d)\n",
852 bm->framebuffer, msg->minX, msg->minY, msg->maxX, msg->maxY));
854 if (msg->minX == msg->maxX) addX = 1; else addX = 0;
855 if (msg->minY == msg->maxY) addY = 1; else addY = 0;
857 if ((GC_LINEPAT(gc) != (UWORD)~0) || !bm->fbgfx)
859 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
861 else
863 LOCK_HW
865 _sd->gpu_busy = TRUE;
866 bm->usecount++;
869 _sd->Card.DMAKickoffCallback = NVDMAKickoffCallback;
871 NVDmaStart(&_sd->Card, SURFACE_OFFSET_DST, 1);
872 NVDmaNext(&_sd->Card, bm->framebuffer);
873 _sd->dst_offset = bm->framebuffer;
875 NVDmaStart(&_sd->Card, SURFACE_PITCH, 1);
876 NVDmaNext(&_sd->Card, (bm->pitch << 16) | _sd->src_pitch);
877 _sd->dst_pitch = bm->pitch;
879 if (GC_DOCLIP(gc))
881 NVDmaStart(&_sd->Card, CLIP_POINT, 2);
882 NVDmaNext(&_sd->Card, (GC_CLIPY1(gc) << 16) | GC_CLIPX1(gc));
883 NVDmaNext(&_sd->Card, ((GC_CLIPY2(gc)-GC_CLIPY1(gc)+1) << 16) |
884 (GC_CLIPX2(gc)-GC_CLIPX1(gc)+1));
887 NVSetRopSolid(_sd, GC_DRMD(gc), ~0 << bm->depth);
888 NVDmaStart(&_sd->Card, LINE_FORMAT, 2);
889 NVDmaNext(&_sd->Card, bm->line_format);
890 NVDmaNext(&_sd->Card, GC_FG(gc));
892 NVDmaStart(&_sd->Card, LINE_LINES(0), 8);
894 NVDmaNext(&_sd->Card, (msg->minY << 16) | (msg->minX & 0xffff));
895 NVDmaNext(&_sd->Card, (msg->minY << 16) | (msg->maxX & 0xffff));
897 NVDmaNext(&_sd->Card, ((msg->minY + addY) << 16) | (msg->maxX & 0xffff));
898 NVDmaNext(&_sd->Card, ((msg->maxY << 16)) | (msg->maxX & 0xffff));
900 NVDmaNext(&_sd->Card, ((msg->maxY << 16)) | ((msg->maxX - addX) & 0xffff));
901 NVDmaNext(&_sd->Card, ((msg->maxY << 16)) | ((msg->minX) & 0xffff));
903 NVDmaNext(&_sd->Card, ((msg->maxY - addY) << 16) | (msg->minX & 0xffff));
904 NVDmaNext(&_sd->Card, ((msg->minY + addY) << 16) | (msg->minX & 0xffff));
906 if (GC_DOCLIP(gc))
908 NVDmaStart(&_sd->Card, CLIP_POINT, 2);
909 NVDmaNext(&_sd->Card, 0x00000000);
910 NVDmaNext(&_sd->Card, 0xff00ff00);
913 NVDmaKickoff(&_sd->Card);
915 UNLOCK_HW
918 UNLOCK_BITMAP
921 VOID NVBM__Hidd_BitMap__DrawPolygon(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_DrawPolygon *msg)
923 OOP_Object *gc = msg->gc;
924 nvBitMap *bm = OOP_INST_DATA(cl, o);
925 ULONG i;
927 LOCK_BITMAP
929 if ((GC_LINEPAT(gc) != (UWORD)~0) || !bm->fbgfx)
931 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
933 else
935 LOCK_HW
937 bm->usecount++;
940 _sd->Card.DMAKickoffCallback = NVDMAKickoffCallback;
941 _sd->gpu_busy = TRUE;
943 NVDmaStart(&_sd->Card, SURFACE_OFFSET_DST, 1);
944 NVDmaNext(&_sd->Card, bm->framebuffer);
945 _sd->dst_offset = bm->framebuffer;
947 NVDmaStart(&_sd->Card, SURFACE_PITCH, 1);
948 NVDmaNext(&_sd->Card, (bm->pitch << 16) | _sd->src_pitch);
949 _sd->dst_pitch = bm->pitch;
951 if (GC_DOCLIP(gc))
953 NVDmaStart(&_sd->Card, CLIP_POINT, 2);
954 NVDmaNext(&_sd->Card, (GC_CLIPY1(gc) << 16) | GC_CLIPX1(gc));
955 NVDmaNext(&_sd->Card, ((GC_CLIPY2(gc)-GC_CLIPY1(gc)+1) << 16) |
956 (GC_CLIPX2(gc)-GC_CLIPX1(gc)+1));
959 NVSetRopSolid(_sd, GC_DRMD(gc), ~0 << bm->depth);
960 NVDmaStart(&_sd->Card, LINE_FORMAT, 2);
961 NVDmaNext(&_sd->Card, bm->line_format);
962 NVDmaNext(&_sd->Card, GC_FG(gc));
964 for(i = 2; i < (2 * msg->n); i = i + 2)
966 NVDmaStart(&_sd->Card, LINE_LINES(0), 2);
967 NVDmaNext(&_sd->Card, (msg->coords[i - 1] << 16) | msg->coords[i - 2]);
968 NVDmaNext(&_sd->Card, (msg->coords[i + 1] << 16) | msg->coords[i]);
971 if (GC_DOCLIP(gc))
973 NVDmaStart(&_sd->Card, CLIP_POINT, 2);
974 NVDmaNext(&_sd->Card, 0x00000000);
975 NVDmaNext(&_sd->Card, 0x7f007f00);
978 NVDmaKickoff(&_sd->Card);
980 UNLOCK_HW
983 UNLOCK_BITMAP
986 VOID NVBM__Hidd_BitMap__PutImage(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_PutImage *msg)
988 nvBitMap *bm = OOP_INST_DATA(cl, o);
990 LOCK_BITMAP
992 IPTR VideoData = bm->framebuffer;
994 if (bm->fbgfx)
996 VideoData += (IPTR)_sd->Card.FrameBuffer;
998 if (_sd->gpu_busy)
1000 LOCK_HW
1001 NVSync(_sd);
1002 UNLOCK_HW
1006 switch(msg->pixFmt)
1008 case vHidd_StdPixFmt_Native:
1009 switch(bm->bpp)
1011 case 1:
1013 struct pHidd_BitMap_CopyMemBox8 __m = {
1014 _sd->mid_CopyMemBox8,
1015 msg->pixels,
1018 (APTR)VideoData,
1019 msg->x,
1020 msg->y,
1021 msg->width,
1022 msg->height,
1023 msg->modulo,
1024 bm->pitch
1025 }, *m = &__m;
1027 OOP_DoMethod(o, (OOP_Msg)m);
1029 break;
1031 case 2:
1033 struct pHidd_BitMap_CopyMemBox16 __m = {
1034 _sd->mid_CopyMemBox16,
1035 msg->pixels,
1038 (APTR)VideoData,
1039 msg->x,
1040 msg->y,
1041 msg->width,
1042 msg->height,
1043 msg->modulo,
1044 bm->pitch
1045 }, *m = &__m;
1047 OOP_DoMethod(o, (OOP_Msg)m);
1049 break;
1051 case 4:
1053 struct pHidd_BitMap_CopyMemBox32 __m = {
1054 _sd->mid_CopyMemBox32,
1055 msg->pixels,
1058 (APTR)VideoData,
1059 msg->x,
1060 msg->y,
1061 msg->width,
1062 msg->height,
1063 msg->modulo,
1064 bm->pitch
1065 }, *m = &__m;
1067 OOP_DoMethod(o, (OOP_Msg)m);
1069 break;
1071 } /* switch(data->bytesperpix) */
1072 break;
1074 case vHidd_StdPixFmt_Native32:
1075 switch(bm->bpp)
1077 case 1:
1079 struct pHidd_BitMap_PutMem32Image8 __m = {
1080 _sd->mid_PutMem32Image8,
1081 msg->pixels,
1082 (APTR)VideoData,
1083 msg->x,
1084 msg->y,
1085 msg->width,
1086 msg->height,
1087 msg->modulo,
1088 bm->pitch
1089 }, *m = &__m;
1090 OOP_DoMethod(o, (OOP_Msg)m);
1092 break;
1094 case 2:
1096 struct pHidd_BitMap_PutMem32Image16 __m = {
1097 _sd->mid_PutMem32Image16,
1098 msg->pixels,
1099 (APTR)VideoData,
1100 msg->x,
1101 msg->y,
1102 msg->width,
1103 msg->height,
1104 msg->modulo,
1105 bm->pitch
1106 }, *m = &__m;
1107 OOP_DoMethod(o, (OOP_Msg)m);
1109 break;
1111 case 4:
1113 struct pHidd_BitMap_CopyMemBox32 __m = {
1114 _sd->mid_CopyMemBox32,
1115 msg->pixels,
1118 (APTR)VideoData,
1119 msg->x,
1120 msg->y,
1121 msg->width,
1122 msg->height,
1123 msg->modulo,
1124 bm->pitch
1125 }, *m = &__m;
1127 OOP_DoMethod(o, (OOP_Msg)m);
1129 break;
1131 } /* switch(data->bytesperpix) */
1132 break;
1134 default:
1135 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
1136 break;
1138 } /* switch(msg->pixFmt) */
1140 UNLOCK_BITMAP
1143 VOID NVBM__Hidd_BitMap__GetImage(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_GetImage *msg)
1145 nvBitMap *bm = OOP_INST_DATA(cl, o);
1147 LOCK_BITMAP
1149 IPTR VideoData = bm->framebuffer;
1151 if (bm->fbgfx)
1153 VideoData += (IPTR)_sd->Card.FrameBuffer;
1154 if (_sd->gpu_busy)
1156 LOCK_HW
1157 NVSync(_sd);
1158 UNLOCK_HW
1163 switch(msg->pixFmt)
1165 case vHidd_StdPixFmt_Native:
1166 switch(bm->bpp)
1168 case 1:
1170 struct pHidd_BitMap_CopyMemBox8 __m = {
1171 _sd->mid_CopyMemBox8,
1172 (APTR)VideoData,
1173 msg->x,
1174 msg->y,
1175 msg->pixels,
1178 msg->width,
1179 msg->height,
1180 bm->pitch,
1181 msg->modulo
1182 }, *m = &__m;
1184 OOP_DoMethod(o, (OOP_Msg)m);
1186 break;
1188 case 2:
1190 struct pHidd_BitMap_CopyMemBox16 __m = {
1191 _sd->mid_CopyMemBox16,
1192 (APTR)VideoData,
1193 msg->x,
1194 msg->y,
1195 msg->pixels,
1198 msg->width,
1199 msg->height,
1200 bm->pitch,
1201 msg->modulo
1202 }, *m = &__m;
1204 OOP_DoMethod(o, (OOP_Msg)m);
1206 break;
1208 case 4:
1210 struct pHidd_BitMap_CopyMemBox32 __m = {
1211 _sd->mid_CopyMemBox32,
1212 (APTR)VideoData,
1213 msg->x,
1214 msg->y,
1215 msg->pixels,
1218 msg->width,
1219 msg->height,
1220 bm->pitch,
1221 msg->modulo
1222 }, *m = &__m;
1224 OOP_DoMethod(o, (OOP_Msg)m);
1226 break;
1228 } /* switch(data->bytesperpix) */
1229 break;
1231 case vHidd_StdPixFmt_Native32:
1232 switch(bm->bpp)
1234 case 1:
1236 struct pHidd_BitMap_GetMem32Image8 __m = {
1237 _sd->mid_GetMem32Image8,
1238 (APTR)VideoData,
1239 msg->x,
1240 msg->y,
1241 msg->pixels,
1242 msg->width,
1243 msg->height,
1244 bm->pitch,
1245 msg->modulo
1246 }, *m = &__m;
1248 OOP_DoMethod(o, (OOP_Msg)m);
1250 break;
1252 case 2:
1254 struct pHidd_BitMap_GetMem32Image16 __m = {
1255 _sd->mid_GetMem32Image16,
1256 (APTR)VideoData,
1257 msg->x,
1258 msg->y,
1259 msg->pixels,
1260 msg->width,
1261 msg->height,
1262 bm->pitch,
1263 msg->modulo
1264 }, *m = &__m;
1266 OOP_DoMethod(o, (OOP_Msg)m);
1268 break;
1270 case 4:
1272 struct pHidd_BitMap_CopyMemBox32 __m = {
1273 _sd->mid_CopyMemBox32,
1274 (APTR)VideoData,
1275 msg->x,
1276 msg->y,
1277 msg->pixels,
1280 msg->width,
1281 msg->height,
1282 bm->pitch,
1283 msg->modulo
1284 }, *m = &__m;
1286 OOP_DoMethod(o, (OOP_Msg)m);
1288 break;
1290 } /* switch(data->bytesperpix) */
1291 break;
1293 default:
1294 OOP_DoSuperMethod(cl, o, (OOP_Msg)msg);
1295 break;
1297 } /* switch(msg->pixFmt) */
1299 UNLOCK_BITMAP
1303 VOID NVBM__Hidd_BitMap__PutTemplate(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_PutTemplate *msg)
1305 nvBitMap *bm = OOP_INST_DATA(cl, o);
1307 LOCK_BITMAP
1309 IPTR VideoData = bm->framebuffer;
1311 if (bm->fbgfx)
1313 VideoData += (IPTR)_sd->Card.FrameBuffer;
1314 if (_sd->gpu_busy)
1316 LOCK_HW
1317 NVSync(_sd);
1318 UNLOCK_HW
1323 switch(bm->bpp)
1325 case 1:
1327 struct pHidd_BitMap_PutMemTemplate8 __m = {
1328 _sd->mid_PutMemTemplate8,
1329 msg->gc,
1330 msg->masktemplate,
1331 msg->modulo,
1332 msg->srcx,
1333 (APTR)VideoData,
1334 bm->pitch,
1335 msg->x,
1336 msg->y,
1337 msg->width,
1338 msg->height,
1339 msg->inverttemplate
1340 }, *m = &__m;
1342 OOP_DoMethod(o, (OOP_Msg)m);
1344 break;
1346 case 2:
1348 struct pHidd_BitMap_PutMemTemplate16 __m = {
1349 _sd->mid_PutMemTemplate16,
1350 msg->gc,
1351 msg->masktemplate,
1352 msg->modulo,
1353 msg->srcx,
1354 (APTR)VideoData,
1355 bm->pitch,
1356 msg->x,
1357 msg->y,
1358 msg->width,
1359 msg->height,
1360 msg->inverttemplate
1361 }, *m = &__m;
1363 OOP_DoMethod(o, (OOP_Msg)m);
1365 break;
1367 case 4:
1369 struct pHidd_BitMap_PutMemTemplate32 __m = {
1370 _sd->mid_PutMemTemplate32,
1371 msg->gc,
1372 msg->masktemplate,
1373 msg->modulo,
1374 msg->srcx,
1375 (APTR)VideoData,
1376 bm->pitch,
1377 msg->x,
1378 msg->y,
1379 msg->width,
1380 msg->height,
1381 msg->inverttemplate
1382 }, *m = &__m;
1384 OOP_DoMethod(o, (OOP_Msg)m);
1386 break;
1388 } /* switch(bm->bpp) */
1390 UNLOCK_BITMAP
1393 VOID NVBM__Hidd_BitMap__PutPattern(OOP_Class *cl, OOP_Object *o, struct pHidd_BitMap_PutPattern *msg)
1395 nvBitMap *bm = OOP_INST_DATA(cl, o);
1397 LOCK_BITMAP
1399 IPTR VideoData = bm->framebuffer;
1401 if (bm->fbgfx)
1403 VideoData += (IPTR)_sd->Card.FrameBuffer;
1404 if (_sd->gpu_busy)
1406 LOCK_HW
1407 NVSync(_sd);
1408 UNLOCK_HW
1413 switch(bm->bpp)
1415 case 1:
1417 struct pHidd_BitMap_PutMemPattern8 __m = {
1418 _sd->mid_PutMemPattern8,
1419 msg->gc,
1420 msg->pattern,
1421 msg->patternsrcx,
1422 msg->patternsrcy,
1423 msg->patternheight,
1424 msg->patterndepth,
1425 msg->patternlut,
1426 msg->invertpattern,
1427 msg->mask,
1428 msg->maskmodulo,
1429 msg->masksrcx,
1430 (APTR)VideoData,
1431 bm->pitch,
1432 msg->x,
1433 msg->y,
1434 msg->width,
1435 msg->height
1436 }, *m = &__m;
1438 OOP_DoMethod(o, (OOP_Msg)m);
1440 break;
1442 case 2:
1444 struct pHidd_BitMap_PutMemPattern16 __m = {
1445 _sd->mid_PutMemPattern16,
1446 msg->gc,
1447 msg->pattern,
1448 msg->patternsrcx,
1449 msg->patternsrcy,
1450 msg->patternheight,
1451 msg->patterndepth,
1452 msg->patternlut,
1453 msg->invertpattern,
1454 msg->mask,
1455 msg->maskmodulo,
1456 msg->masksrcx,
1457 (APTR)VideoData,
1458 bm->pitch,
1459 msg->x,
1460 msg->y,
1461 msg->width,
1462 msg->height
1463 }, *m = &__m;
1465 OOP_DoMethod(o, (OOP_Msg)m);
1467 break;
1469 case 4:
1471 struct pHidd_BitMap_PutMemPattern32 __m = {
1472 _sd->mid_PutMemPattern32,
1473 msg->gc,
1474 msg->pattern,
1475 msg->patternsrcx,
1476 msg->patternsrcy,
1477 msg->patternheight,
1478 msg->patterndepth,
1479 msg->patternlut,
1480 msg->invertpattern,
1481 msg->mask,
1482 msg->maskmodulo,
1483 msg->masksrcx,
1484 (APTR)VideoData,
1485 bm->pitch,
1486 msg->x,
1487 msg->y,
1488 msg->width,
1489 msg->height
1490 }, *m = &__m;
1492 OOP_DoMethod(o, (OOP_Msg)m);
1494 break;
1496 } /* switch(bm->bpp) */
1498 UNLOCK_BITMAP
1502 BOOL NVBM__Hidd_BitMap__ObtainDirectAccess(OOP_Class *cl, OOP_Object *o,
1503 struct pHidd_BitMap_ObtainDirectAccess *msg)
1505 nvBitMap *bm = OOP_INST_DATA(cl, o);
1506 LOCK_BITMAP
1508 IPTR VideoData = bm->framebuffer;
1510 if (bm->fbgfx)
1512 VideoData += (IPTR)_sd->Card.FrameBuffer;
1513 if (_sd->gpu_busy)
1515 LOCK_HW
1516 NVSync(_sd);
1517 UNLOCK_HW
1521 *msg->addressReturn = (UBYTE*)VideoData;
1522 *msg->widthReturn = bm->pitch / bm->bpp;
1523 *msg->heightReturn = bm->height;
1524 *msg->bankSizeReturn = *msg->memSizeReturn = bm->pitch * bm->height;
1526 return TRUE;
1529 VOID NVBM__Hidd_BitMap__ReleaseDirectAccess(OOP_Class *cl, OOP_Object *o,
1530 struct pHidd_BitMap_ReleaseDirectAccess *msg)
1532 nvBitMap *bm = OOP_INST_DATA(cl, o);
1536 UNLOCK_BITMAP
1540 static int Init_BMMethodIDs(LIBBASETYPEPTR LIBBASE)
1542 LIBBASE->sd.mid_CopyMemBox8 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_CopyMemBox8);
1543 LIBBASE->sd.mid_CopyMemBox16 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_CopyMemBox16);
1544 LIBBASE->sd.mid_CopyMemBox32 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_CopyMemBox32);
1545 LIBBASE->sd.mid_PutMem32Image8 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_PutMem32Image8);
1546 LIBBASE->sd.mid_PutMem32Image16 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_PutMem32Image16);
1547 LIBBASE->sd.mid_GetMem32Image8 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_GetMem32Image8);
1548 LIBBASE->sd.mid_GetMem32Image16 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_GetMem32Image16);
1549 LIBBASE->sd.mid_Clear = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_Clear);
1550 LIBBASE->sd.mid_PutMemTemplate8 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_PutMemTemplate8);
1551 LIBBASE->sd.mid_PutMemTemplate16 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_PutMemTemplate16);
1552 LIBBASE->sd.mid_PutMemTemplate32 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_PutMemTemplate32);
1553 LIBBASE->sd.mid_PutMemPattern8 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_PutMemPattern8);
1554 LIBBASE->sd.mid_PutMemPattern16 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_PutMemPattern16);
1555 LIBBASE->sd.mid_PutMemPattern32 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_PutMemPattern32);
1556 LIBBASE->sd.mid_CopyLUTMemBox16 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_CopyLUTMemBox16);
1557 LIBBASE->sd.mid_CopyLUTMemBox32 = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_CopyLUTMemBox32);
1558 LIBBASE->sd.mid_GetImage = OOP_GetMethodID(IID_Hidd_BitMap, moHidd_BitMap_GetImage);
1560 return TRUE;
1563 ADD2INITLIB(Init_BMMethodIDs, 0)