#include "ewrte.h"
#include "ewgfx.h"
#include "ewextpxl_RGB565.h"
#include "ew_bsp_display.h"
#include "ew_bsp_graphics.h"
Data Structures | |
struct | XGfxSurface |
struct | XGfxViewport |
Macros | |
#define | Err01 "Invalid framebuffer address!" |
#define | Err02 |
#define | Err03 "Could not allocate memory!" |
#define | Err04 "Invalid double-buffer address!" |
#define | Err05 "Requested operation with graphics accelerator failed!" |
#define | Err06 "Full screen update cannot be done within scratch-pad buffer!" |
#define | Err07 "Partial screen update cannot be combined with double buffering!" |
#define | EW_SURFACE_PREALLOCATED 0x01000000 |
#define | EW_SURFACE_MODIFIED_BY_CPU 0x02000000 |
#define | EW_SURFACE_MODIFIED_BY_GA 0x04000000 |
#define | EW_SURFACE_TRANSACTION_MASK 0x0000FFFF |
#define | EW_CACHE_LINE_SIZE 0 |
#define | EW_CACHE_ALIGNMENT 0 |
#define | EW_INVALIDATE_CACHE(addr, size) |
#define | EW_CLEAN_CACHE(addr, size) |
Functions | |
static void | GfxFlushGraphics (void) |
static void | GfxSelectSurfaces (unsigned long aDstSurfaceHandle, unsigned long aSrcSurfaceHandle) |
static void | TrackMemoryUsage (void) |
int | GfxInitGfx (void *aArgs) |
unsigned long | GfxInitViewport (int aWidth, int aHeight, int aExtentX, int aExtentY, int aExtentWidth, int aExtentHeight, int aOrient, int aOpacity, void *aDisplay1, void *aDisplay2, void *aDisplay3) |
void | GfxDoneViewport (unsigned long aHandle) |
unsigned long | GfxBeginUpdate (unsigned long aHandle) |
unsigned long | GfxBeginUpdateArea (unsigned long aHandle, int aX, int aY, int aWidth, int aHeight) |
void | GfxEndUpdate (unsigned long aHandle, int aX, int aY, int aWidth, int aHeight) |
unsigned long | GfxCreateSurface (int aFormat, int aWidth, int aHeight) |
unsigned long | GfxCreateConstSurface (int aFormat, int aWidth, int aHeight, XSurfaceMemory *aMemory) |
void | GfxDestroySurface (unsigned long aHandle) |
unsigned long | GfxLockSurface (unsigned long aHandle, int aX, int aY, int aWidth, int aHeight, int aIndex, int aCount, int aReadPixel, int aWritePixel, int aReadClut, int aWriteClut, XSurfaceMemory *aMemory) |
void | GfxUnlockSurface (unsigned long aSurfaceHandle, unsigned long aLockHandle, int aX, int aY, int aWidth, int aHeight, int aIndex, int aCount, int aWritePixel, int aWriteClut) |
void | GfxFillDriver (unsigned long aDstHandle, int aDstX, int aDstY, int aWidth, int aHeight, int aBlend, unsigned long *aColors) |
void | GfxCopyDriver (unsigned long aDstHandle, unsigned long aSrcHandle, int aDstX, int aDstY, int aSrcX, int aSrcY, int aWidth, int aHeight, int aBlend, unsigned long *aColors) |
void | GfxBlendDriver (unsigned long aDstHandle, unsigned long aSrcHandle, int aDstX, int aDstY, int aSrcX, int aSrcY, int aWidth, int aHeight, int aBlend, unsigned long *aColors) |
void | GfxUseGraphicsAccelerator (int aActive) |
int | GfxIsGraphicsAcceleratorUsed (void) |
Variables | |
static unsigned char | UseGraphicsAccelerator = 1 |
static unsigned short | TransactionNumber = 0 |
static void * | LoadedClutSurface = 0 |
int | EwResourcesMemory |
int | EwResourcesMemoryPeak |
int | EwObjectsMemory |
int | EwStringsMemory |
int | EwMemoryPeak |
#define Err01 "Invalid framebuffer address!" |
#define Err02 |
#define Err03 "Could not allocate memory!" |
#define Err04 "Invalid double-buffer address!" |
#define Err05 "Requested operation with graphics accelerator failed!" |
#define Err06 "Full screen update cannot be done within scratch-pad buffer!" |
#define Err07 "Partial screen update cannot be combined with double buffering!" |
#define EW_CACHE_ALIGNMENT 0 |
#define EW_CACHE_LINE_SIZE 0 |
#define EW_CLEAN_CACHE | ( | addr, | |
size | |||
) |
#define EW_INVALIDATE_CACHE | ( | addr, | |
size | |||
) |
#define EW_SURFACE_MODIFIED_BY_CPU 0x02000000 |
#define EW_SURFACE_MODIFIED_BY_GA 0x04000000 |
#define EW_SURFACE_PREALLOCATED 0x01000000 |
#define EW_SURFACE_TRANSACTION_MASK 0x0000FFFF |
unsigned long GfxBeginUpdate | ( | unsigned long | aHandle | ) |
References XGfxViewport::DoubleBuffer, Err06, EW_ERROR, EwBspDisplayWaitForCompletion(), XGfxViewport::FrameBuffer, GfxFlushGraphics(), and LoadedClutSurface.
unsigned long GfxBeginUpdateArea | ( | unsigned long | aHandle, |
int | aX, | ||
int | aY, | ||
int | aWidth, | ||
int | aHeight | ||
) |
References XGfxSurface::BytesPerPixel, XGfxViewport::DoubleBuffer, Err07, EW_ERROR, EwBspDisplayWaitForCompletion(), XGfxViewport::FrameBuffer, GfxFlushGraphics(), XGfxSurface::Height, LoadedClutSurface, XGfxSurface::OrigPixel, XGfxSurface::Pixel, and XGfxSurface::Width.
void GfxBlendDriver | ( | unsigned long | aDstHandle, |
unsigned long | aSrcHandle, | ||
int | aDstX, | ||
int | aDstY, | ||
int | aSrcX, | ||
int | aSrcY, | ||
int | aWidth, | ||
int | aHeight, | ||
int | aBlend, | ||
unsigned long * | aColors | ||
) |
References XGfxSurface::BytesPerPixel, XGfxSurface::Clut, EW_ALPHA, EW_BLUE, EW_GREEN, EW_PIXEL_FORMAT_ALPHA8, EW_PIXEL_FORMAT_INDEX8, EW_PIXEL_FORMAT_NATIVE, EW_PIXEL_FORMAT_RGB565, EW_PIXEL_FORMAT_SCREEN, EW_RED, EwBspGraphicsCopyBlend(), EwBspGraphicsLoadClut(), EwCopyAlpha8RowSolidBlend(), EwCopyIndex8RowBlend(), EwCopyIndex8RowSolidBlend(), EwCopyNativeRowBlend(), EwCopyNativeRowSolidBlend(), EwCopyRGB565RowSolidBlend(), EwEmulateCopy(), EwInitColorGradient(), EwScreenCopyAlpha8RowSolidBlend(), EwScreenCopyIndex8RowBlend(), EwScreenCopyIndex8RowSolidBlend(), EwScreenCopyNativeRowBlend(), EwScreenCopyNativeRowSolidBlend(), EwScreenCopyRGB565RowSolidBlend(), XGfxSurface::Format, GfxLockSurface(), GfxSelectSurfaces(), GfxUnlockSurface(), LoadedClutSurface, XGfxSurface::Pixel, UseGraphicsAccelerator, and XGfxSurface::Width.
void GfxCopyDriver | ( | unsigned long | aDstHandle, |
unsigned long | aSrcHandle, | ||
int | aDstX, | ||
int | aDstY, | ||
int | aSrcX, | ||
int | aSrcY, | ||
int | aWidth, | ||
int | aHeight, | ||
int | aBlend, | ||
unsigned long * | aColors | ||
) |
References XGfxSurface::BytesPerPixel, XGfxSurface::Clut, EW_ALPHA, EW_BLUE, EW_GREEN, EW_PIXEL_FORMAT_ALPHA8, EW_PIXEL_FORMAT_INDEX8, EW_PIXEL_FORMAT_NATIVE, EW_PIXEL_FORMAT_RGB565, EW_PIXEL_FORMAT_SCREEN, EW_RED, EwBspGraphicsCopy(), EwBspGraphicsLoadClut(), EwCopyAlpha8RowSolid(), EwCopyIndex8Row(), EwCopyIndex8RowSolid(), EwCopyNativeRow(), EwCopyNativeRowSolid(), EwCopyRGB565Row(), EwCopyRGB565RowSolid(), EwEmulateCopy(), EwInitColorGradient(), EwScreenCopyAlpha8RowSolid(), EwScreenCopyIndex8Row(), EwScreenCopyIndex8RowSolid(), EwScreenCopyNativeRow(), EwScreenCopyNativeRowSolid(), EwScreenCopyRGB565Row(), EwScreenCopyRGB565RowSolid(), XGfxSurface::Format, GfxLockSurface(), GfxSelectSurfaces(), GfxUnlockSurface(), LoadedClutSurface, XGfxSurface::Pixel, UseGraphicsAccelerator, and XGfxSurface::Width.
unsigned long GfxCreateConstSurface | ( | int | aFormat, |
int | aWidth, | ||
int | aHeight, | ||
XSurfaceMemory * | aMemory | ||
) |
References XGfxSurface::BytesPerPixel, XGfxSurface::Clut, XSurfaceMemory::Clut, EW_PIXEL_FORMAT_ALPHA8, EW_PIXEL_FORMAT_INDEX8, EW_PIXEL_FORMAT_NATIVE, EW_PIXEL_FORMAT_RGB565, EW_SURFACE_PREALLOCATED, EwAllocVideo(), EwResourcesMemory, EwZero(), XGfxSurface::Flags, XGfxSurface::Format, XGfxSurface::Height, XSurfaceMemory::Pitch1X, XSurfaceMemory::Pitch1Y, XGfxSurface::Pixel, XSurfaceMemory::Pixel1, TrackMemoryUsage(), and XGfxSurface::Width.
unsigned long GfxCreateSurface | ( | int | aFormat, |
int | aWidth, | ||
int | aHeight | ||
) |
References XGfxSurface::AllocSize, XGfxSurface::BytesPerPixel, XGfxSurface::Clut, EW_CACHE_ALIGNMENT, EW_CACHE_LINE_SIZE, EW_PIXEL_FORMAT_ALPHA8, EW_PIXEL_FORMAT_INDEX8, EW_PIXEL_FORMAT_NATIVE, EW_PIXEL_FORMAT_RGB565, EW_PIXEL_FORMAT_SCREEN, EwAllocVideo(), EwResourcesMemory, EwZero(), XGfxSurface::Flags, XGfxSurface::Format, XGfxSurface::Height, XGfxSurface::Pixel, TrackMemoryUsage(), and XGfxSurface::Width.
void GfxDestroySurface | ( | unsigned long | aHandle | ) |
References XGfxSurface::AllocSize, EW_SURFACE_TRANSACTION_MASK, EwFreeVideo(), EwResourcesMemory, XGfxSurface::Flags, GfxFlushGraphics(), and TransactionNumber.
void GfxDoneViewport | ( | unsigned long | aHandle | ) |
References XGfxViewport::DoubleBuffer, EwBspGraphicsDone(), EwFree(), EwResourcesMemory, XGfxViewport::FrameBuffer, and GfxFlushGraphics().
void GfxEndUpdate | ( | unsigned long | aHandle, |
int | aX, | ||
int | aY, | ||
int | aWidth, | ||
int | aHeight | ||
) |
References XGfxSurface::BytesPerPixel, XGfxViewport::DoubleBuffer, EW_CLEAN_CACHE, EW_SURFACE_MODIFIED_BY_CPU, EwBspDisplayCommitBuffer(), XGfxSurface::Flags, XGfxViewport::FrameBuffer, GfxFlushGraphics(), XGfxSurface::Height, XGfxSurface::OrigHeight, XGfxSurface::OrigPixel, XGfxSurface::Pixel, and XGfxSurface::Width.
void GfxFillDriver | ( | unsigned long | aDstHandle, |
int | aDstX, | ||
int | aDstY, | ||
int | aWidth, | ||
int | aHeight, | ||
int | aBlend, | ||
unsigned long * | aColors | ||
) |
References aBlend, XGfxSurface::BytesPerPixel, EW_ALPHA, EW_BLUE, EW_GREEN, EW_PIXEL_FORMAT_SCREEN, EW_RED, EwBspGraphicsFill(), EwBspGraphicsFillBlend(), EwEmulateFill(), EwFillRowSolid(), EwFillRowSolidBlend(), EwInitColorGradient(), EwScreenFillRowSolid(), EwScreenFillRowSolidBlend(), XGfxSurface::Format, GfxLockSurface(), GfxSelectSurfaces(), GfxUnlockSurface(), XGfxSurface::Pixel, UseGraphicsAccelerator, and XGfxSurface::Width.
References EwBspGraphicsWaitForCompletion().
int GfxInitGfx | ( | void * | aArgs | ) |
References EW_DISCARD_BITMAPS, EW_DISCARD_BITMAPS_IF_ANIMATED_ONLY, EW_DISCARD_BITMAPS_IF_NOT_USED_IN_CURRENT_UPDATE, EW_DISCARD_BITMAPS_IF_NOT_USED_IN_RECENT_UPDATES, EW_LAZY_LOAD_BITMAPS, EW_LAZY_LOAD_BITMAPS_IF_ANIMATED_ONLY, EW_MAX_GLYPH_SURFACE_HEIGHT, EW_MAX_GLYPH_SURFACE_WIDTH, EW_MAX_ISSUE_TASKS, EW_MAX_STRING_CACHE_SIZE, EW_MAX_SURFACE_CACHE_SIZE, EW_UNUSED_ARG, EwDiscardBitmaps, EwDiscardBitmapsIfAnimatedOnly, EwDiscardBitmapsIfNotUsedInCurrentUpdate, EwDiscardBitmapsIfNotUsedInRecentUpdates, EwLazyLoadBitmaps, EwLazyLoadBitmapsIfAnimatedOnly, EwMaxGlyphSurfaceHeight, EwMaxGlyphSurfaceWidth, EwMaxIssueTasks, EwMaxStringCacheSize, EwMaxSurfaceCacheSize, and EwPreserveFramebufferContent.
unsigned long GfxInitViewport | ( | int | aWidth, |
int | aHeight, | ||
int | aExtentX, | ||
int | aExtentY, | ||
int | aExtentWidth, | ||
int | aExtentHeight, | ||
int | aOrient, | ||
int | aOpacity, | ||
void * | aDisplay1, | ||
void * | aDisplay2, | ||
void * | aDisplay3 | ||
) |
References aOpacity, XGfxSurface::BytesPerPixel, XGfxViewport::DoubleBuffer, Err01, Err02, Err03, Err04, Err05, EW_ERROR, EW_PIXEL_FORMAT_SCREEN, EW_SURFACE_PREALLOCATED, EW_UNUSED_ARG, EwAlloc(), EwAllocVideo(), EwBspGraphicsInit(), EwResourcesMemory, EwZero(), XGfxSurface::Flags, XGfxSurface::Format, XGfxViewport::FrameBuffer, XGfxSurface::Height, XGfxSurface::OrigHeight, XGfxSurface::OrigPixel, XGfxSurface::Pixel, TrackMemoryUsage(), and XGfxSurface::Width.
int GfxIsGraphicsAcceleratorUsed | ( | void | ) |
References UseGraphicsAccelerator.
unsigned long GfxLockSurface | ( | unsigned long | aHandle, |
int | aX, | ||
int | aY, | ||
int | aWidth, | ||
int | aHeight, | ||
int | aIndex, | ||
int | aCount, | ||
int | aReadPixel, | ||
int | aWritePixel, | ||
int | aReadClut, | ||
int | aWriteClut, | ||
XSurfaceMemory * | aMemory | ||
) |
References XGfxSurface::BytesPerPixel, XGfxSurface::Clut, XSurfaceMemory::Clut, EW_INVALIDATE_CACHE, EW_SURFACE_MODIFIED_BY_CPU, EW_SURFACE_MODIFIED_BY_GA, EW_SURFACE_TRANSACTION_MASK, EW_UNUSED_ARG, EwZero(), XGfxSurface::Flags, GfxFlushGraphics(), XGfxSurface::Height, XSurfaceMemory::Pitch1X, XSurfaceMemory::Pitch1Y, XGfxSurface::Pixel, XSurfaceMemory::Pixel1, TransactionNumber, and XGfxSurface::Width.
|
static |
References XGfxSurface::BytesPerPixel, EW_CLEAN_CACHE, EW_SURFACE_MODIFIED_BY_CPU, EW_SURFACE_MODIFIED_BY_GA, EW_SURFACE_TRANSACTION_MASK, XGfxSurface::Flags, XGfxSurface::Height, XGfxSurface::Pixel, TransactionNumber, and XGfxSurface::Width.
void GfxUnlockSurface | ( | unsigned long | aSurfaceHandle, |
unsigned long | aLockHandle, | ||
int | aX, | ||
int | aY, | ||
int | aWidth, | ||
int | aHeight, | ||
int | aIndex, | ||
int | aCount, | ||
int | aWritePixel, | ||
int | aWriteClut | ||
) |
void GfxUseGraphicsAccelerator | ( | int | aActive | ) |
References EwMemoryPeak, EwObjectsMemory, EwResourcesMemory, EwResourcesMemoryPeak, and EwStringsMemory.
int EwMemoryPeak |
int EwObjectsMemory |
int EwResourcesMemory |
int EwResourcesMemoryPeak |
int EwStringsMemory |
|
static |
|
static |
|
static |