1,8 → 1,12 |
|
//ld -T ld.x -s --shared --image-base 0 --file-alignment 32 -o test.exe test.obj core.lib |
#include "types.h" |
|
#include "common.h" |
#include <stdio.h> |
#include <malloc.h> |
#include <memory.h> |
|
#include "syscall.h" |
|
#include "ati2d.h" |
#include "accel_2d.h" |
|
12,26 → 16,14 |
|
static local_pixmap_t scr_pixmap; |
|
static void Init3DEngine(RHDPtr rhdPtr); |
|
/* |
void STDCALL (*SelectHwCursor)(cursor_t*)__asm__("SelectHwCursor"); |
void STDCALL (*SetHwCursor)(cursor_t*,int x,int y)__asm__("SetHwCursor"); |
void STDCALL (*HwCursorRestore)(int x, int y)__asm("HwCursorRestore"); |
cursor_t* IMPORT (*HwCursorCreate)(void)__asm("HwCursorCreate"); //params eax, ebx, ecx |
int __stdcall srv_2d(ioctl_t *io); |
|
void (__stdcall *old_select)(cursor_t*); |
void (__stdcall *old_set)(cursor_t*,int x,int y); |
void (__stdcall *old_restore)(int x, int y); |
cursor_t* (*old_create)(void); |
cursor_t* __create_cursor(void); |
*/ |
|
static void Init3DEngine(RHDPtr rhdPtr); |
|
u32 __stdcall drvEntry(int action) |
u32_t __stdcall drvEntry(int action) |
{ |
RHDPtr rhdPtr; |
u32 retval; |
u32_t retval; |
|
int i; |
|
65,26 → 57,17 |
if(!RHDPreInit()) |
return 0; |
|
// old_select = SelectHwCursor; |
// old_set = SetHwCursor; |
// old_restore = HwCursorRestore ; |
// old_create = HwCursorCreate; |
|
R5xx2DInit(); |
rhd.has_tcl = 1; |
|
// Init3DEngine(&rhd); |
|
//init_r500(); |
|
// SelectHwCursor = r500_SelectCursor; |
// SetHwCursor = r500_SetCursor; |
// HwCursorCreate = __create_cursor; |
// HwCursorRestore = r500_CursorRestore; |
|
retval = RegService("HDRAW", srv_2d); |
dbgprintf("reg service %s as: %x\n", "HDRAW", retval); |
|
// retval = RegService("HWCURSOR", srv_cursor); |
return retval; |
}; |
|
93,36 → 76,11 |
|
#define SRV_GETVERSION 0 |
|
/* |
int _stdcall srv_cursor(ioctl_t *io) |
{ |
u32 *inp; |
u32 *outp; |
|
inp = io->input; |
outp = io->output; |
|
switch(io->io_code) |
{ |
case SRV_GETVERSION: |
if(io->out_size==4) |
{ |
*(u32*)io->output = API_VERSION; |
return 0; |
} |
break; |
|
default: |
return ERR_PARAM; |
}; |
return ERR_PARAM; |
} |
*/ |
|
int _stdcall srv_2d(ioctl_t *io) |
{ |
u32 *inp; |
u32 *outp; |
u32_t *inp; |
u32_t *outp; |
|
inp = io->input; |
outp = io->output; |
137,21 → 95,42 |
} |
break; |
|
case DRAW_RECT: |
case PX_CREATE: |
if(io->inp_size==7) |
return CreatePixmap((pixmap_t*)inp); |
break; |
|
case PX_DESTROY: |
if(io->inp_size==7) |
return DestroyPixmap((pixmap_t*)inp); |
break; |
|
case PX_DRAW_RECT: |
if(io->inp_size==6) |
return DrawRect((draw_t*)inp); |
break; |
|
case FILL_RECT: |
case PX_FILL_RECT: |
if(io->inp_size==9) |
return FillRect((fill_t*)inp); |
break; |
/* |
case LINE_2P: |
|
case PX_BLIT: |
if(io->inp_size==8) |
return PixBlit((pixblit_t*)inp); |
break; |
|
case PX_BLIT_TRANSPARENT: |
if(io->inp_size==8) |
return TransBlit((pixblit_t*)inp); |
break; |
|
case PX_LINE: |
if(io->inp_size==6) |
return Line2P((draw_t*)inp); |
return Line((draw_t*)inp); |
break; |
|
/* |
case BLIT: |
if(io->inp_size==6) |
return Blit((blit_t*)inp); |
162,37 → 141,7 |
return RadeonComposite((blit_t*)inp); |
break; |
*/ |
case PX_CREATE: |
if(io->inp_size==7) |
return CreatePixmap((pixmap_t*)inp); |
break; |
|
case PIXBLIT: |
if(io->inp_size==8) |
return PixBlit((pixblit_t*)inp); |
break; |
|
// case PIXLOCK: |
// if(io->inp_size==6) |
// return LockPixmap((userpixmap_t*)inp); |
// break; |
|
// case PIXUNLOCK: |
// if(io->inp_size==6) |
// return UnlockPixmap((userpixmap_t*)inp); |
// break; |
|
case PIXDESTROY: |
if(io->inp_size==6) |
return DestroyPixmap((pixmap_t*)inp); |
break; |
|
case TRANSBLIT: |
if(io->inp_size==8) |
return TransBlit((pixblit_t*)inp); |
break; |
|
|
default: |
return ERR_PARAM; |
}; |
208,6 → 157,7 |
#include "r500.inc" |
|
#include "clip.inc" |
#include "pixmap.inc" |
#include "accel_2d.inc" |
#include "accel_3d.inc" |
|