screen_to_screen blit works! (if softcursor used, NM2097 and NM2160)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7054 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
This file may be used under the terms of the Be Sample Code License.
|
This file may be used under the terms of the Be Sample Code License.
|
||||||
|
|
||||||
Other authors:
|
Other authors:
|
||||||
Rudolf Cornelissen 4/2003-1/2004
|
Rudolf Cornelissen 4/2003-3/2004
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MODULE_BIT 0x00200000
|
#define MODULE_BIT 0x00200000
|
||||||
@@ -134,7 +134,7 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
|
|||||||
nm_crtc_dpms(display,h,v);
|
nm_crtc_dpms(display,h,v);
|
||||||
|
|
||||||
/* set up acceleration for this mode */
|
/* set up acceleration for this mode */
|
||||||
// nm_acc_init();
|
nm_acc_init();
|
||||||
|
|
||||||
/* log currently selected output */
|
/* log currently selected output */
|
||||||
nm_general_output_select();
|
nm_general_output_select();
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#include "nm_std.h"
|
#include "nm_std.h"
|
||||||
|
|
||||||
|
static status_t nm_acc_wait_fifo(uint32 n);
|
||||||
|
|
||||||
/*acceleration notes*/
|
/*acceleration notes*/
|
||||||
|
|
||||||
/*functions Be's app_server uses:
|
/*functions Be's app_server uses:
|
||||||
@@ -21,21 +23,25 @@ blit
|
|||||||
status_t nm_acc_wait_idle()
|
status_t nm_acc_wait_idle()
|
||||||
{
|
{
|
||||||
/* wait until engine completely idle */
|
/* wait until engine completely idle */
|
||||||
switch (si->ps.card_type)
|
while (ACCR(STATUS) & 0x00000001)
|
||||||
{
|
{
|
||||||
case NM2097:
|
/* snooze a bit so I do not hammer the bus */
|
||||||
case NM2160:
|
snooze (100);
|
||||||
while (ACCR(STATUS) & 0x00000001)
|
|
||||||
{
|
|
||||||
/* snooze a bit so I do not hammer the bus */
|
|
||||||
snooze (100);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* wait for enough room in fifo */
|
||||||
|
static status_t nm_acc_wait_fifo(uint32 n)
|
||||||
|
{
|
||||||
|
while (((ACCR(STATUS) & 0x0000ff00) >> 8) < n)
|
||||||
|
{
|
||||||
|
/* snooze a bit so I do not hammer the bus */
|
||||||
|
snooze (10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* AFAIK this must be done for every new screenmode.
|
/* AFAIK this must be done for every new screenmode.
|
||||||
* Engine required init. */
|
* Engine required init. */
|
||||||
status_t nm_acc_init()
|
status_t nm_acc_init()
|
||||||
@@ -91,6 +97,13 @@ status_t nm_acc_init()
|
|||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* enable engine FIFO */
|
||||||
|
//fixme: does not work yet..
|
||||||
|
si->engine.control |= (1 << 27);
|
||||||
|
|
||||||
|
/* setup buffer startadress */
|
||||||
|
//fixme! setup..
|
||||||
|
|
||||||
/* fixme?: setup clipping */
|
/* fixme?: setup clipping */
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -101,22 +114,28 @@ status_t nm_acc_blit(uint16 xs,uint16 ys,uint16 xd,uint16 yd,uint16 w,uint16 h)
|
|||||||
{
|
{
|
||||||
/* make sure the previous command (if any) is completed */
|
/* make sure the previous command (if any) is completed */
|
||||||
nm_acc_wait_idle();
|
nm_acc_wait_idle();
|
||||||
|
//does not work yet:
|
||||||
|
// nm_acc_wait_fifo(4);
|
||||||
|
|
||||||
if ((yd < ys) || ((yd == ys) && (xd < xs)))
|
if ((yd < ys) || ((yd == ys) && (xd < xs)))
|
||||||
{
|
{
|
||||||
/* start with upper left corner */
|
/* start with upper left corner */
|
||||||
ACCW(BLTCNTL, si->engine.control);
|
/* use ROP GXcopy (b16-19), and use XY coord. system (b24-25) */
|
||||||
|
ACCW(BLTCNTL, si->engine.control | 0x830c0000);
|
||||||
|
/* send command and exexute */
|
||||||
ACCW(SRCSTARTOFF, ((ys << 16) | (xs & 0x0000ffff)));
|
ACCW(SRCSTARTOFF, ((ys << 16) | (xs & 0x0000ffff)));
|
||||||
ACCW(DSTSTARTOFF, ((yd << 16) | (xd & 0x0000ffff)));
|
ACCW(DSTSTARTOFF, ((yd << 16) | (xd & 0x0000ffff)));
|
||||||
ACCW(XYEXT, ((h << 16) | (w & 0x0000ffff)));
|
ACCW(XYEXT, (((h + 1) << 16) | ((w + 1) & 0x0000ffff)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* start with lower right corner */
|
/* start with lower right corner */
|
||||||
ACCW(BLTCNTL, (si->engine.control | 0x00000013));
|
/* use ROP GXcopy (b16-19), and use XY coord. system (b24-25) */
|
||||||
ACCW(SRCSTARTOFF, (((ys + (h - 1)) << 16) | ((xs + (w - 1)) & 0x0000ffff)));
|
ACCW(BLTCNTL, (si->engine.control | 0x830c0013));
|
||||||
ACCW(DSTSTARTOFF, (((yd + (h - 1)) << 16) | ((xd + (w - 1)) & 0x0000ffff)));
|
/* send command and exexute */
|
||||||
ACCW(XYEXT, ((h << 16) | (w & 0x0000ffff)));
|
ACCW(SRCSTARTOFF, (((ys + h) << 16) | ((xs + w) & 0x0000ffff)));
|
||||||
|
ACCW(DSTSTARTOFF, (((yd + h) << 16) | ((xd + w) & 0x0000ffff)));
|
||||||
|
ACCW(XYEXT, (((h + 1) << 16) | ((w + 1) & 0x0000ffff)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Author:
|
/* Author:
|
||||||
Rudolf Cornelissen 4/2003-1/2004
|
Rudolf Cornelissen 4/2003-3/2004
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MODULE_BIT 0x00008000
|
#define MODULE_BIT 0x00008000
|
||||||
|
|||||||
Reference in New Issue
Block a user