#define USE_HARDWARESPRITE 1
#define P96TRACING_ENABLED 0
+#define P96TRACING_LEVEL 0
#define P96TRACING_SETUP_ENABLED 0
#define P96SPRTRACING_ENABLED 0
return;
gfx_lock ();
setupcursor_needed = 1;
+ LPDIRECT3DTEXTURE9 cursorsurfaced3d = D3D_getcursorsurface();
if (cursorsurfaced3d) {
if (SUCCEEDED (hr = cursorsurfaced3d->LockRect (0, &locked, NULL, 0))) {
dptr = (uae_u8*)locked.pBits;
i++;
continue;
}
+ // Not even 256 color mode fits in VRAM? Ignore it completely.
+ if (DisplayModes[i].res.width * DisplayModes[i].res.height > gfxmem_bank.allocated_size - 256) {
+ i++;
+ continue;
+ }
j = i;
size += PSSO_LibResolution_sizeof;
while (missmodes[misscnt * 2] == 0)
inituaegfxfuncs(ctx, uaegfx_rom, ABI);
}
-static void addmode(TrapContext *ctx, uaecptr AmigaBoardInfo, uaecptr *amem, struct LibResolution *res, int w, int h, const TCHAR *name, int display, int *unkcnt)
+static bool addmode(TrapContext *ctx, uaecptr AmigaBoardInfo, uaecptr *amem, struct LibResolution *res, int w, int h, const TCHAR *name, int display, int *unkcnt)
{
int depth;
+ bool added = false;
if (display > 0) {
res->DisplayID = 0x51000000 + display * 0x100000;
for (depth = 8; depth <= 32; depth++) {
if (!p96depth (depth))
continue;
- if(gfxmem_bank.allocated_size >= w * h * (depth + 7) / 8) {
+ if(gfxmem_bank.allocated_size >= w * h * ((depth + 7) / 8)) {
FillBoardInfo(ctx, *amem, res, w, h, depth);
*amem += PSSO_ModeInfo_sizeof;
+ added = true;
}
}
+ return added;
}
/****************************************
static uae_u32 REGPARAM2 picasso_InitCard (TrapContext *ctx)
{
int LibResolutionStructureCount = 0;
- int i, j, unkcnt, cnt;
+ int i, unkcnt, cnt;
uaecptr amem;
uaecptr AmigaBoardInfo = trap_get_areg(ctx, 0);
unkcnt = cnt = 0;
while (newmodes[i].depth >= 0) {
struct LibResolution res = { 0 };
- TCHAR *s;
- j = i;
- addmode(ctx, AmigaBoardInfo, &amem, &res, newmodes[i].res.width, newmodes[i].res.height, NULL, 0, &unkcnt);
- s = au (res.Name);
- write_log (_T("%2d: %08X %4dx%4d %s\n"), ++cnt, res.DisplayID, res.Width, res.Height, s);
- xfree (s);
- while (newmodes[i].depth >= 0
- && newmodes[i].res.width == newmodes[j].res.width
- && newmodes[i].res.height == newmodes[j].res.height)
- i++;
+ int j = i;
+ if (addmode(ctx, AmigaBoardInfo, &amem, &res, newmodes[i].res.width, newmodes[i].res.height, NULL, 0, &unkcnt)) {
+ TCHAR *s;
+ s = au (res.Name);
+ write_log (_T("%2d: %08X %4dx%4d %s\n"), ++cnt, res.DisplayID, res.Width, res.Height, s);
+ xfree (s);
+ while (newmodes[i].depth >= 0
+ && newmodes[i].res.width == newmodes[j].res.width
+ && newmodes[i].res.height == newmodes[j].res.height)
+ i++;
- LibResolutionStructureCount++;
- CopyLibResolutionStructureU2A(ctx, &res, amem);
+ LibResolutionStructureCount++;
+ CopyLibResolutionStructureU2A(ctx, &res, amem);
#if P96TRACING_ENABLED && P96TRACING_LEVEL > 1
- DumpLibResolutionStructurectx, (amem);
+ DumpLibResolutionStructure(ctx, amem);
#endif
- AmigaListAddTail(ctx, AmigaBoardInfo + PSSO_BoardInfo_ResolutionsList, amem);
- amem += PSSO_LibResolution_sizeof;
+ AmigaListAddTail(ctx, AmigaBoardInfo + PSSO_BoardInfo_ResolutionsList, amem);
+ amem += PSSO_LibResolution_sizeof;
+ } else {
+ write_log (_T("--: %08X %4dx%4d Not enough VRAM\n"), res.DisplayID, res.Width, res.Height);
+ i++;
+ }
}
#if MULTIDISPLAY
for (i = 0; Displays[i].name; i++) {
* This function is called whenever another ModeInfo has to be set. This
* function simply sets up the CRTC and TS registers to generate the
* timing used for that screen mode. You should not set the DAC, clocks
-* or linear start adress. They will be set when appropriate by their
+* or linear start address. They will be set when appropriate by their
* own functions.
*/
static uae_u32 REGPARAM2 picasso_SetGC (TrapContext *ctx)