diff -ruN MPlayer-1.0pre3/Makefile MPlayer-1.0pre3.custom/Makefile
--- MPlayer-1.0pre3.orig/Makefile    Tue Dec  9 06:33:31 2003
+++ MPlayer-1.0pre3/Makefile     Thu Dec 11 16:18:27 2003
@@ -17,7 +17,7 @@

 # These subdirectories require installation due to binaries within them.
 ifeq ($(VIDIX),yes)
-SUBDIRS += libdha vidix
+SUBDIRS += vidix
 DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
 endif

@@ -45,7 +45,7 @@
 PARTS += libfaad2
 endif
 ifeq ($(VIDIX),yes)
-PARTS += libdha vidix
+PARTS += vidix
 endif
 ifeq ($(FAME),yes)
 PARTS += libfame
@@ -81,7 +81,7 @@
 COMMON_DEPS += libfaad2/libfaad2.a
 endif
 ifeq ($(VIDIX),yes)
-COMMON_DEPS += libdha/libdha.so vidix/libvidix.a
+COMMON_DEPS += vidix/libvidix.a
 endif
 ifeq ($(FAME),yes)
 COMMON_DEPS += libfame/libfame.a
ddiff -ruN MPlayer-1.0pre3.orig/configure MPlayer-1.0pre3/configure
--- MPlayer-1.0pre3.orig/configure	Tue Dec  9 06:33:31 2003
+++ MPlayer-1.0pre3/configure	Thu Dec 11 17:29:38 2003
@@ -2151,7 +2151,7 @@
 #include <sys/types.h>
 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
 EOF
-cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
+cc_check && _wordsize="32" && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
 echores "$_wordsize"
 
 
@@ -2289,6 +2289,8 @@
 EOF
 if mingw32 ; then
   _ld_pthread=''
+elif true ; then
+  _ld_pthread='-lpthread'
 elif ( cc_check && $TMPO ) ; then              # QNX
   _ld_pthread=''
 elif ( cc_check -lpthread && $TMPO ) ; then
@@ -4574,9 +4576,10 @@
   return 0;
 }
 EOF
-  if cc_check -I- $_inc_faad $_ld_faad -lm && "$TMPO" >> "$TMPLOG" ; then
-    _faad_version=`"$TMPO"`
-    _faad_tempversion=`"$TMPO" | sed -e 's/^\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/\1\2/'`
+  #if cc_check -I- $_inc_faad $_ld_faad -lm && "$TMPO" >> "$TMPLOG" ; then
+  if true ; then
+    _faad_version="2.0 RC1 "
+    _faad_tempversion=`echo "2.0 RC1 " | sed -e 's/^\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/\1\2/'`
     _def_faad_version="#define FAADVERSION $_faad_tempversion"
     echores "$_faad_version"
   else
diff -ruN MPlayer-1.0pre3.orig/loader/wine/mmreg.h MPlayer-1.0pre3/loader/wine/mmreg.h
--- MPlayer-1.0pre3.orig/loader/wine/mmreg.h	Sat Sep 14 04:43:17 2002
+++ MPlayer-1.0pre3/loader/wine/mmreg.h	Thu Dec 11 17:59:09 2003
@@ -96,7 +96,7 @@
   WORD          nBlockSize WINE_PACKED;
   WORD          nFramesPerBlock WINE_PACKED;
   WORD          nCodecDelay WINE_PACKED;
-} MPEGLAYER3WAVEFORMAT;
+} WINE_PACKED MPEGLAYER3WAVEFORMAT;
 
 /* WAVE form wFormatTag IDs */
 
diff -ruN MPlayer-1.0pre3.orig/vidix/drivers/Makefile MPlayer-1.0pre3/vidix/drivers/Makefile
--- MPlayer-1.0pre3.orig/vidix/drivers/Makefile	Thu Oct 23 01:45:33 2003
+++ MPlayer-1.0pre3/vidix/drivers/Makefile	Thu Dec 11 17:13:01 2003
@@ -58,7 +58,14 @@
 SIS_LIBS=-L../../libdha -ldha
 SIS_CFLAGS=$(OPTFLAGS) -fPIC -I. -I..
 
-all:    $(CYBERBLADE_VID) $(RADEON_VID) $(RAGE128_VID) $(MACH64_VID) $(NVIDIA_VID) $(GENFB_VID) $(MGA_VID) $(MGA_CRTC2_VID) $(PM3_VID) $(SIS_VID)
+W100_VID=w100_vid.so
+W100_SRCS=w100_vid.c
+W100_OBJS=w100_vid.o
+W100_LIBS=-L$(QPEDIR)/lib -lqte -lqpe -ljpeg
+W100_CFLAGS=$(OPTFLAGS) -fPIC -I. -I..
+
+#all:    $(CYBERBLADE_VID) $(RADEON_VID) $(RAGE128_VID) $(MACH64_VID) $(NVIDIA_VID) $(GENFB_VID) $(MGA_VID) $(MGA_CRTC2_VID) $(PM3_VID) $(SIS_VID)
+all:    $(W100_VID)
 
 
 .SUFFIXES: .c .o
@@ -124,6 +131,12 @@
 
 $(SIS_VID):     $(SIS_OBJS)
 	$(CC) -shared $(SIS_OBJS) $(SIS_LIBS) -Wl,-soname,$(SIS_VID) -o $(SIS_VID) 
+
+$(W100_OBJS):    $(W100_SRCS)
+	$(CC) -c $(W100_CFLAGS) -o $@ $<
+
+$(W100_VID):     $(W100_OBJS)
+	$(CC) -shared $(W100_OBJS) $(W100_LIBS) -Wl,-soname,$(W100_VID) -o $(W100_VID)
 
 clean:
 	rm -f *.o *.so *~
diff -ruN MPlayer-1.0pre3.orig/vidix/drivers/w100_vid.c MPlayer-1.0pre3/vidix/drivers/w100_vid.c
--- MPlayer-1.0pre3.orig/vidix/drivers/w100_vid.c	Thu Jan  1 09:00:00 1970
+++ MPlayer-1.0pre3/vidix/drivers/w100_vid.c	Thu Dec 11 16:24:01 2003
@@ -0,0 +1,375 @@
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
+#include <unistd.h>
+
+#include "../vidix.h"
+#include "../fourcc.h"
+#include "../../config.h"
+#include "w100api_fake.h"
+
+#define UNUSED(v) ((void)(v))
+
+static uint16_t st_overlayHandle;
+
+static vidix_capability_t w100_cap =
+{
+    "ATI W100 driver",
+    "AGAWA Koji <kaoru-K@self-core.org>",
+    TYPE_OUTPUT,
+    { 0, 0, 0, 0 },                     /* reserved */
+    480,                                /* max width */
+    640,                                /* max height */
+    4,                                  /* min width */
+    4,                                  /* min height */
+    -1,                                 /* max framerate */
+    FLAG_EQUALIZER,                     /* flags */
+    0x1002,                             /* VENDOR_ATI(libdha/pci_vendors.h) */
+    -1,                                 /* device id */
+    { 0, 0, 0, 0 }                      /* reserved */
+};
+
+unsigned int vixGetVersion(void)
+{
+    return VIDIX_VERSION;
+}
+
+int vixProbe(int verbose, int force)
+{
+    UNUSED(verbose);
+    UNUSED(force);
+    return 0;
+}
+
+int vixInit(void)
+{
+    if (AtiCore_ProcessAttach()) {
+        if (AtiCore_AllocOverlay(&st_overlayHandle))
+            return 0;
+    }
+
+    return ENOSYS;
+}
+
+void vixDestroy(void)
+{
+    AtiCore_SetOverlayOnOff(st_overlayHandle, 0);
+    AtiCore_ReleaseOverlay(st_overlayHandle);
+    AtiCore_ProcessDetach();
+}
+
+int vixGetCapability(vidix_capability_t *to)
+{
+    memcpy(to, &w100_cap, sizeof(vidix_capability_t));
+    return 0;
+}
+
+static int is_supported_fourcc(uint32_t fourcc)
+{
+    switch(fourcc) {
+    case IMGFMT_YV12:
+        return 1;
+    default:
+        return 0;
+    }
+}
+
+int vixQueryFourcc(vidix_fourcc_t *to)
+{
+    if (is_supported_fourcc(to->fourcc)) {
+        to->depth = VID_DEPTH_1BPP | VID_DEPTH_2BPP |
+            VID_DEPTH_4BPP | VID_DEPTH_8BPP |
+            VID_DEPTH_12BPP| VID_DEPTH_15BPP|
+            VID_DEPTH_16BPP| VID_DEPTH_24BPP|
+            VID_DEPTH_32BPP;
+        to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK;
+/*         to->flags = VID_CAP_EXPAND | VID_CAP_SHRINK | VID_CAP_COLORKEY; */
+        return 0;
+    } else
+        to->depth = to->flags = 0;
+
+    return ENOSYS;
+}
+
+int vixGetGrKeys(vidix_grkey_t *grkey)
+{
+    UNUSED(grkey);
+    return 0;
+}
+
+int vixSetGrKeys(const vidix_grkey_t *grkey)
+{
+    UNUSED(grkey);
+    return 0;
+}
+
+static vidix_video_eq_t st_equal =
+{
+    VEQ_CAP_BRIGHTNESS,
+    0, 0, 0, 0, 0, 0, 0, 0
+};
+
+int vixPlaybackGetEq(vidix_video_eq_t * eq)
+{
+    memcpy(eq, &st_equal, sizeof(st_equal));
+    return 0;
+}
+
+int vixPlaybackSetEq(const vidix_video_eq_t * eq)
+{
+    int br;
+
+    if (eq->cap & VEQ_CAP_BRIGHTNESS)
+        st_equal.brightness = eq->brightness;
+    if (eq->cap & VEQ_CAP_CONTRAST)
+        st_equal.contrast = eq->contrast;
+    if (eq->cap & VEQ_CAP_SATURATION)
+        st_equal.saturation = eq->saturation;
+    if (eq->cap & VEQ_CAP_HUE)
+        st_equal.hue = eq->hue;
+    if (eq->cap & VEQ_CAP_RGB_INTENSITY) {
+        st_equal.red_intensity   = eq->red_intensity;
+        st_equal.green_intensity = eq->green_intensity;
+        st_equal.blue_intensity  = eq->blue_intensity;
+    }
+    st_equal.flags = eq->flags;
+
+    br = (st_equal.brightness + 1000) * 127 / 2000;
+    if (br < 0)
+        br = 0;
+    if (br > 127)
+        br = 127;
+    if (br > 64)
+        br -= 64;
+    else
+        br += 64;
+
+    AtiCore_SetDisplayBrightness(br);
+
+    return 0;
+}
+
+static uint32_t st_frameOffsets[VID_PLAY_MAXFRAMES];
+static vidix_playback_t st_playbackInfo;
+static ATI_OVERLAYPROP st_overlayProp;
+
+int vixConfigPlayback(vidix_playback_t *info)
+{
+    int src_w, src_h;
+    int drw_w, drw_h;
+    int y_pitch, uv_pitch;
+    int i, ret, newNumFrames;
+    ATI_CLIPRECT clipRect;
+    uint32_t base;
+    uint32_t internalVramSize, internalVramAddr;
+    uint32_t externalVramSize, externalVramAddr;
+    int useExternalVram = 0;
+
+    if (!is_supported_fourcc(info->fourcc))
+        return -1;
+
+    src_w = info->src.w;
+    src_h = info->src.h;
+    drw_w = info->dest.w;
+    drw_h = info->dest.h;
+
+    switch (info->fourcc) {
+    case IMGFMT_YV12:
+        y_pitch = (src_w + 15) & ~15;
+        uv_pitch = ((src_w / 2) + 7) & ~7;
+        info->offset.y = 0;
+        info->offset.v = y_pitch * src_h;
+        info->offset.u = info->offset.v + uv_pitch * (src_h / 2);
+        info->frame_size = y_pitch * src_h + 2 * uv_pitch * (src_h / 2);
+        break;
+    default:
+        return -1;
+    }
+/*     fprintf(stderr, "w100_vid: num_frames:%d\n", info->num_frames); */
+/*     fprintf(stderr, "w100_vid: y_pitch:%d\n", y_pitch); */
+
+/*     fprintf(stderr, "w100_vid: struct info {\n"); */
+/*     fprintf(stderr, "w100_vid:   src.x:%d. src.y:%d. src.w:%d, src.h:%d,\n", */
+/*             info->src.x, info->src.y, info->src.w, info->src.h); */
+/*     fprintf(stderr, "w100_vid:   dest.x:%d. dest.y:%d. dest.w:%d, dest.h:%d,\n", */
+/*             info->dest.x, info->dest.y, info->dest.w, info->dest.h); */
+/*     fprintf(stderr, "w100_vid:   offset.y:%d, offset.v:%d offset.y:%d\n", */
+/*             info->offset.y, info->offset.v, info->offset.u); */
+/*     fprintf(stderr, "w100_vid:   frame_size:%d,\n", info->frame_size); */
+
+    GetAvailableVideoMem(&internalVramSize, &externalVramSize);
+    AtiCore_SetupMemoryTransfer(0, &internalVramAddr);
+    AtiCore_TerminateMemoryTransfer();
+    AtiCore_SetupMemoryTransfer(0xF000000, &externalVramAddr);
+    AtiCore_TerminateMemoryTransfer();
+
+/*     info->num_frames = 1; */
+    useExternalVram =  (getenv("MPLAYER_W100_USEEXTVRAM") ? 1 : 0);
+
+    if (useExternalVram) {
+        /* $B%U%l!<%`%P%C%U%!$H$7$FMxMQ$5$l$F$$$kItJ,$O;H$o$J$$(B */
+        base = 640 * 480 * 2;
+        newNumFrames = (externalVramSize - (640 * 480 * 2))
+            / info->frame_size;
+
+        /* FIXME: $B30It(B VRAM $B$K%*!<%P%l%$$r3NJ]$9$k$H!"(BVGA/QVGA $BLd$o$:(B
+         $BI=<($,GH>u$KMp$l$k!#(B @SL-C700/C750 */
+    } else {
+        /* $B%U%l!<%`%P%C%U%!It$b;H$o$J$$$H!"(BVRAM $BMFNL$,B-$j$J$$(B */
+/*         base = 320 * 240 * 2; */
+        base = 320 * 4 * 2;
+        memset((void *)internalVramAddr, 0x00, 320 * 4 * 2);
+        newNumFrames = internalVramSize / info->frame_size;
+    }
+
+    if (newNumFrames > info->num_frames)
+        newNumFrames = info->num_frames;
+    if (newNumFrames > VID_PLAY_MAXFRAMES)
+        newNumFrames = VID_PLAY_MAXFRAMES;
+    info->num_frames = newNumFrames;
+
+    info->dga_addr =
+        (void *)(useExternalVram ? externalVramAddr : internalVramAddr);
+/*     fprintf(stderr, "w100_vid:   num_frames:%d,\n", info->num_frames); */
+
+    info->dest.pitch.y = 16;
+    info->dest.pitch.u = 16;
+    info->dest.pitch.v = 16;
+
+/*     fprintf(stderr, "w100_vid: }\n"); */
+/*     fprintf(stderr, "w100_vid: base:%d\n", base); */
+
+    for (i = 0; i < info->num_frames; ++i) {
+        info->offsets[i] = base + info->frame_size * i;
+        st_frameOffsets[i] = info->offsets[i]
+            + (useExternalVram ? 0xF000000 : 0);
+    }
+
+    st_overlayProp.lpSrcBitmap = (void *)st_frameOffsets[0];
+    st_overlayProp.XCoord = 0;
+    st_overlayProp.YCoord = 0;
+    st_overlayProp.SrcPitch = y_pitch;
+    st_overlayProp.SrcHeight = src_h;
+    st_overlayProp.OverlayWidth = y_pitch;
+    st_overlayProp.OverlayHeight = src_h;
+    st_overlayProp.lpOverlayKey = 0;
+    st_overlayProp.OverlayFormat = OVLTYPE_YUV420;
+
+    ret = AtiCore_SetupOverlay(st_overlayHandle, &st_overlayProp);
+/*     printf("w100_vid: AtiCore_SetupOverlay: ret=%d\n", ret); */
+
+    clipRect.X_Top_Left = 0;
+    clipRect.Y_Top_Left = 0;
+    clipRect.X_Bottom_Right = st_overlayProp.SrcPitch;
+    clipRect.Y_Bottom_Right = st_overlayProp.SrcHeight;
+    AtiCore_SetDstClippingRect(&clipRect);
+    clipRect.X_Bottom_Right = info->src.w;
+    clipRect.Y_Bottom_Right = info->src.h;
+    AtiCore_SetSrcClippingRect(&clipRect);
+
+/*     AtiCore_SetOverlayPos(st_overlayHandle, info->dest.x, info->dest.y); */
+    AtiCore_SetOverlayPos(st_overlayHandle, 4, 0);
+
+    AtiCore_SetRopOperation(ROP3_SRCCOPY);
+    AtiCore_SetDstType(DSTTYPE_8BPP);
+    AtiCore_SetSrcType(SRCTYPE_EQU_DST);
+
+    vixPlaybackSetEq(&st_equal);
+
+    memcpy(&st_playbackInfo, info, sizeof(*info));
+
+/*     fprintf(stderr, "w100_vid: ---- vixConfigPlayback complete.\n"); */
+
+    return 0;
+}
+
+int vixPlaybackOn(void)
+{
+    AtiCore_SetOverlayOnOff(st_overlayHandle, 1);
+
+    return 0;
+}
+
+int vixPlaybackOff(void)
+{
+    AtiCore_SetOverlayOnOff(st_overlayHandle, 0);
+
+    return 0;
+}
+
+int vixPlaybackFrameSelect(unsigned int frame)
+{
+    st_overlayProp.lpSrcBitmap = (void *)st_frameOffsets[frame];
+    AtiCore_SetupOverlay(st_overlayHandle, &st_overlayProp);
+
+#if 0
+    ATI_STRETCH stretchOptions;
+    ATI_POINT dpPoint;
+    ATI_RECT srcRect, dstRect;
+    int ret;
+
+/*     fprintf(stderr, "w100_vid: vixPlaybackFrameSelect(frame=%d)\n", frame); */
+/*     fprintf(stderr, "w100_vid:   dga_addr:0x%08x, offset:%d,\n", */
+/*             st_playbackInfo.dga_addr, st_frameOffsets[frame]); */
+
+    stretchOptions.Count = 1;
+    stretchOptions.ScaleXFactor = 4;
+    stretchOptions.ScaleYFactor = 4;
+    stretchOptions.BlendOn = 0;
+    stretchOptions.dummy1 = 0;
+
+    dpPoint.XCoord = 0;
+    dpPoint.YCoord = 0;
+
+    srcRect.XCoord = st_playbackInfo.src.x;
+    srcRect.YCoord = st_playbackInfo.src.y;
+    srcRect.Width = st_playbackInfo.src.w;
+    srcRect.Height = st_playbackInfo.src.h;
+    fprintf(stderr, "%d, %d, %d, %d\n", srcRect.XCoord, srcRect.YCoord,
+            srcRect.Width, srcRect.Height);
+
+    dstRect.XCoord = 0;
+    dstRect.YCoord = 0;
+    dstRect.Width = 432;//st_playbackInfo.src.w;
+    dstRect.Height = 592;//st_playbackInfo.src.h;
+
+#if 1
+    while (AtiCore_WaitComplete(100) != 1)
+        ;
+
+	AtiCore_SetRopOperation( ROP3_SRCCOPY );
+	AtiCore_SetDstType( DSTTYPE_8BPP );
+	AtiCore_SetSrcType( SRCTYPE_EQU_DST );
+
+    ret = AtiCore_SetSrcPitchOffset(st_playbackInfo.src.w,
+                                    st_frameOffsets[frame]);
+    fprintf(stderr, "AtiCore_SetSrcPitchOffset(%d, %x) %d\n",
+            st_playbackInfo.src.w, st_frameOffsets[frame], ret);
+    ret = AtiCore_SetDstPitchOffset(432, 0);
+/*     printf("AtiCore_SetDstPitchOffset: ret=%d\n", ret); */
+
+/*     ret = AtiCore_BitBltFilpRotate(0, &srcRect, &dstRect); */
+    ret = AtiCore_StretchBlt(&stretchOptions, &dpPoint, &srcRect);
+    fprintf(stderr, "AtiCore_StretchBlt: ret=%d\n", ret);
+
+#else
+    {
+        int y, srcOffset = 0, dstOffset = 0;
+        fprintf(stderr, "%d %d %d\n", st_playbackInfo.src.h,
+                st_playbackInfo.src.w, 0);
+        for (y = 0; y < st_playbackInfo.src.h; ++y) {
+            memcpy(
+                0xF1100000 + dstOffset,
+                st_playbackInfo.dga_addr + st_playbackInfo.offsets[frame] + srcOffset,
+                st_playbackInfo.src.w);
+            srcOffset += st_playbackInfo.src.w;
+            dstOffset += 432;
+        }
+    }
+#endif
+#endif
+
+    return 0;
+}
diff -ruN MPlayer-1.0pre3.orig/vidix/drivers/w100api_fake.h MPlayer-1.0pre3/vidix/drivers/w100api_fake.h
--- MPlayer-1.0pre3.orig/vidix/drivers/w100api_fake.h	Thu Jan  1 09:00:00 1970
+++ MPlayer-1.0pre3/vidix/drivers/w100api_fake.h	Thu Dec 11 16:24:01 2003
@@ -0,0 +1,336 @@
+/* -*- mode: c++; tab-width: 4 -*- */
+
+/* $Id$ */
+
+/*
+ * Copyright (c) 2003 AGAWA Koji <kaoru-k@self-core.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software withough specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file w100api_fake.h
+ * @brief 
+ *
+ * 
+ *
+ * @author AGAWA Koji
+ * @date $Date$
+ * @version $Revision$
+ */
+
+#ifndef W100API_FAKE_H_INCLUDED
+#define W100API_FAKE_H_INCLUDED
+
+#ifdef __cplusplus
+# define EXTERN_C_BEGIN extern "C" {
+# define EXTERN_C_END }
+#else
+# define EXTERN_C_BEGIN
+# define EXTERN_C_END
+#endif
+
+EXTERN_C_BEGIN
+
+// DP_GUI_MASTER_CNTL.GMC_Dst_DataType
+// DP_DATATYPE.Dp_Dst_DataType
+/* #define DSTTYPE_8BPP            2       // 8 bpp grey scale */
+/* #define DSTTYPE_16BPP_1555      3       //16 bpp aRGB 1555 */
+/* #define DSTTYPE_16BPP_444       5       //16 bpp aRGB 4444 */
+#define DSTTYPE_8BPP            1
+
+// DP_GUI_MASTER_CNTL.GMC_Src_DataType
+// DP_DATATYPE.Dp_Src_DataType
+#define SRCTYPE_1BPP_OPA        0       //mono (expanded to frgd, bkgd)
+#define SRCTYPE_1BPP_TRA        1       //mono (expanded to frgd, leave_alone)
+#define SRCTYPE_EQU_DST         3       //color (same as DST)
+#define SRCTYPE_SOLID_COLOR_BLT 4       //solid color for Blt (use frgd)
+#define SRCTYPE_4BPP            5       //4 bpp
+#define SRCTYPE_12BPP_PACKED    6       //12 bpp packed
+
+#define ROP3_SRCCOPY            0xCC
+
+#define OVLTYPE_YUV420          0x07
+
+typedef struct {
+    /* 順序と型が未確定 */
+    int16_t XCoord;
+    int16_t YCoord;
+} ATI_POINT;
+
+typedef struct {
+    /* 順序と型が未確定 */
+    int16_t XCoord;
+    int16_t YCoord;
+    int16_t Width;
+    int16_t Height;
+} ATI_RECT;
+
+typedef struct {
+    int16_t X_Top_Left;                  // x coordinate of top left corner
+    int16_t Y_Top_Left;                  // y coordinate of top left corner
+    int16_t X_Bottom_Right;              // x coordinate of bottom right corner
+    int16_t Y_Bottom_Right;              // y coordinate of bottom right corner
+} ATI_CLIPRECT;
+
+typedef struct {
+    /* 順序と型が未確定 */
+    uint32_t Count;                        /* +0 */
+    uint8_t ScaleXFactor;                 /* +4 確定 */
+    uint8_t ScaleYFactor;                 /* +5 確定 */
+    uint8_t BlendOn;                      /* +6 確定 */
+    uint8_t dummy1;
+} ATI_STRETCH;                          /* 8bytes? */
+
+typedef struct {
+    uint32_t *lpSrcBitmap;
+    uint16_t XCoord;                      /* +4  確定 */
+    uint16_t YCoord;                      /* +6  確定 */
+    uint16_t SrcPitch;                    /* +8  確定 */
+    uint16_t SrcHeight;                   /* +10 確定 */
+    uint16_t OverlayWidth;
+    uint16_t OverlayHeight;
+    uint32_t lpOverlayKey;                /* +16 確定 */
+    uint8_t OverlayFormat;               /* +20 確定 */
+    uint8_t dummy1;
+    uint16_t dummy2;
+} ATI_OVERLAYPROP;                      /* 24bytes? */
+
+typedef struct {
+    int HInvert;
+    int VInvert;
+} ATI_EXTVIDEOPROP;
+
+typedef struct {
+    ATI_EXTVIDEOPROP ExtVideoProp;
+} ATI_UNKNOWN1;
+
+typedef struct {
+	uint8_t HExpansion;                   /* +8  確定 */
+    uint8_t VExpansion;                   /* +9  確定 */
+    uint8_t RConversion;                  /* +12 確定 */
+/*     ATI_UNKNOWN1 x; */
+} ATI_EXTENDEDOVERLAYPROP;              /* 16byte? */
+
+/**
+ * アクセラレーションの利用を開始する。
+ *
+ * @return              1:success, 0:fail
+ */
+int AtiCore_ProcessAttach(void);
+
+/**
+ * アクセラレーションの利用を終了する。
+ *
+ * @return              *不明*
+ */
+int AtiCore_ProcessDetach(void);
+
+/**
+ * サーフェスをビデオメモリ上に作成する。
+ *
+ * @arg     handle      (返値)サーフェスのハンドル
+ * @arg     offset      (返値)サーフェスのオフセット
+ * @arg     size        サーフェスのサイズ
+ * @arg     direction   (0:低位から高位へ, 1:高位から低位へ)向かって確保
+ * @return              1:success, 0:fail
+ */
+int AtiCore_AllocateSurface(uint16_t *handle, uint32_t *offset,
+                            uint32_t size, uint32_t direction);
+
+/**
+ * サーフェスを破棄する。
+ *
+ * @arg     handle      サーフェスのハンドル
+ * @return              1:success, 0:fail
+ */
+int AtiCore_DestroySurface(uint16_t handle);
+
+/*8
+ * @param   rop         8ビットのフラグと思われる
+ */
+int AtiCore_SetRopOperation(uint32_t rop);
+
+int AtiCore_SetDstType(uint32_t);
+int AtiCore_SetSrcType(uint32_t);
+int AtiCore_SetSrcClippingRect(ATI_CLIPRECT *cliprect);
+int AtiCore_SetDstClippingRect(ATI_CLIPRECT *cliprect);
+int AtiCore_SetSrcPitchOffset(int pitch, int offset);
+int AtiCore_SetDstPitchOffset(int pitch, int offset);
+
+int AtiCore_BitBltFilpRotate(int blt090Rotate,
+                             ATI_RECT *dstRect, ATI_RECT *srcRect);
+int AtiCore_StretchBlt(ATI_STRETCH *option,
+                       ATI_POINT *point, ATI_RECT *srcRect);
+
+
+/**
+ * (BitBltなどの)処理が完了するのを待つ。
+ *
+ * @param   nsec        ウェイト時間(msec)
+ * @return              1:処理が完了した, 0:処理はまだ終わっていない
+ */
+int AtiCore_WaitComplete(int msec);
+
+/**
+ * オーバレイを作成する。
+ *
+ * @param   handle      (返値)オーバレイのハンドル
+ * @return              1:success, 0:fail
+ */
+int AtiCore_AllocOverlay(uint16_t *handle);
+
+int AtiCore_ReleaseOverlay(uint16_t handle);
+
+/**
+ * @return              1:success, 0:fail
+ */
+int AtiCore_SetupOverlay(uint16_t handle, ATI_OVERLAYPROP *prop);
+
+int AtiCore_SetupOverlayExtended(uint16_t handle, ATI_EXTENDEDOVERLAYPROP *prop);
+
+/**
+ * @return              1:success, 0:fail
+ */
+int AtiCore_SetOverlayOnOff(uint16_t handle, int isShow);
+
+int AtiCore_SetOverlayPos(uint16_t handle, uint16_t x, uint16_t y);
+
+int AtiCore_SetupMemoryTransfer(uint32_t offset, uint32_t *regdata);
+int AtiCore_TerminateMemoryTransfer(void);
+
+int AtiCore_GetFrontBufferPitchOffset(uint32_t *pitch, uint32_t *offset);
+
+/**
+ * @return              1:success, 0:fail
+ */
+int AtiCore_SetDisplayBrightness(int brightness);
+
+/**
+ * @return              1:success, 0:fail
+ */
+int GetAvailableVideoMem(uint32_t *internal, uint32_t *external);
+/*
+Dump of assembler code for function GetAvailableVideoMem:
+0x404e643c <GetAvailableVideoMem>:      mov     r12, sp
+0x404e6440 <GetAvailableVideoMem+4>:    stmdb   sp!, {r4, r5, r11, r12, lr, pc}
+0x404e6444 <GetAvailableVideoMem+8>:    sub     r11, r12, #4    ; 0x4
+0x404e6448 <GetAvailableVideoMem+12>:   mov     r5, r1
+0x404e644c <GetAvailableVideoMem+16>:   
+    ldr r4, [pc, #92]   ; 0x404e64b0 <GetAvailableVideoMem+116>
+0x404e6450 <GetAvailableVideoMem+20>:   mov     r1, #420        ; 0x1a4
+0x404e6454 <GetAvailableVideoMem+24>:   ldr     r2, [r4]
+0x404e6458 <GetAvailableVideoMem+28>:   sub     sp, sp, #4      ; 0x4
+0x404e645c <GetAvailableVideoMem+32>:   add     r12, r2, #80    ; 0x50
+0x404e6460 <GetAvailableVideoMem+36>:   ldmda   r12, {r3, r12}
+0x404e6464 <GetAvailableVideoMem+40>:   sub     r3, r12, r3
+0x404e6468 <GetAvailableVideoMem+44>:   mov     r2, #4  ; 0x4
+0x404e646c <GetAvailableVideoMem+48>:   add     r3, r3, #1      ; 0x1
+0x404e6470 <GetAvailableVideoMem+52>:   str     r3, [r0]
+0x404e6474 <GetAvailableVideoMem+56>:   mov     r0, #0  ; 0x0
+0x404e6478 <GetAvailableVideoMem+60>:   mov     r3, #30720      ; 0x7800
+0x404e647c <GetAvailableVideoMem+64>:   str     r3, [r11, -#24]
+0x404e6480 <GetAvailableVideoMem+68>:   sub     r3, r11, #24    ; 0x18
+0x404e6484 <GetAvailableVideoMem+72>:   bl      0x404e84f0 <WriteRegDirect>
+0x404e6488 <GetAvailableVideoMem+76>:   mov     r3, #0  ; 0x0
+0x404e648c <GetAvailableVideoMem+80>:   str     r3, [r5]
+0x404e6490 <GetAvailableVideoMem+84>:   
+    ldr r1, [pc, #28]   ; 0x404e64b4 <GetAvailableVideoMem+120>
+0x404e6494 <GetAvailableVideoMem+88>:   ldr     r2, [r4]
+0x404e6498 <GetAvailableVideoMem+92>:   ldrh    r3, [r2, #14]
+0x404e649c <GetAvailableVideoMem+96>:   cmp     r3, r1
+0x404e64a0 <GetAvailableVideoMem+100>:  moveq   r3, #2097152    ; 0x200000
+0x404e64a4 <GetAvailableVideoMem+104>:  streq   r3, [r5]
+0x404e64a8 <GetAvailableVideoMem+108>:  mov     r0, #1  ; 0x1
+0x404e64ac <GetAvailableVideoMem+112>:  
+    b   0x404e64b8 <GetAvailableVideoMem+124>
+0x404e64b0 <GetAvailableVideoMem+116>:  submis  pc, r12, r12, asr r5
+0x404e64b4 <GetAvailableVideoMem+120>:  andeq   r5, r0, r1, asr #14
+0x404e64b8 <GetAvailableVideoMem+124>:  ldmdb   r11, {r4, r5, r11, sp, pc}
+End of assembler dump.
+*/
+
+
+/* ================================================================ */
+/* from libqte.so.2.3.2 */
+/*
+AtiCore_AlphaBlend
+AtiCore_BitBlt
+AtiCore_BrushType
+AtiCore_CursorOnOff
+AtiCore_DrawPixel
+AtiCore_Flush
+AtiCore_GammaCorrection
+AtiCore_GetCRC
+AtiCore_GetCursorPos
+AtiCore_GetDeviceInfo
+AtiCore_GetGPIO_Data
+AtiCore_GetGraphicExtended
+AtiCore_GetGraphicWindowPos
+AtiCore_GetLargestVideoMemBlock
+AtiCore_GetLastError
+AtiCore_GetMultiCRC
+AtiCore_GetOverlayPos
+AtiCore_GetPitchOffsetProperty
+AtiCore_Host
+AtiCore_LoadCursorBitMap
+AtiCore_PaintRect
+AtiCore_PolyScanline
+AtiCore_Polyline
+AtiCore_ProcessAttachMinimal
+AtiCore_ProcessAttachSpecialMode
+AtiCore_ProcessDetachMinimal
+AtiCore_ProcessDetachSpecialMode
+AtiCore_ReadCfgReg
+AtiCore_ReadMem
+AtiCore_ReadReg
+AtiCore_ScanlineShading
+AtiCore_SetApertures
+AtiCore_SetBkgColour
+AtiCore_SetBytePixelOrder
+AtiCore_SetCursorPos
+AtiCore_SetDisplayParameters
+AtiCore_SetDriverBehaviour
+AtiCore_SetFrgColour
+AtiCore_SetFrontBuffer
+AtiCore_SetGPIO_Data
+AtiCore_SetGraphicWindowOnOff
+AtiCore_SetGraphicWindowPos
+AtiCore_SetOverlayPosUsingGraphicWindowXY
+AtiCore_SetPartialCursor
+AtiCore_SetupGraphicExtended
+AtiCore_SetupGraphicWindow
+AtiCore_SetupPM4
+AtiCore_SmallText
+AtiCore_SubmitPM4Packet
+AtiCore_TransBitBlt
+AtiCore_WriteCfgReg
+AtiCore_WriteMem
+AtiCore_WriteReg
+ */
+
+EXTERN_C_END
+
+#endif /* W100API_FAKE_H_INCLUDED */

