From: Toni Wilen Date: Mon, 17 Dec 2007 17:07:48 +0000 (+0200) Subject: imported winuaesrc1450b18.zip X-Git-Tag: 2100~178 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=9651393cad4c78137dfc57255b9605fa2e354b96;p=francis%2Fwinuae.git imported winuaesrc1450b18.zip --- diff --git a/autoconf.c b/autoconf.c index cf599e66..d8842516 100644 --- a/autoconf.c +++ b/autoconf.c @@ -64,7 +64,7 @@ static uae_u32 REGPARAM2 rtarea_lget (uaecptr addr) special_mem |= S_READ; #endif addr &= 0xFFFF; - return (uae_u32)(rtarea_wget (addr) << 16) + rtarea_wget (addr+2); + return (uae_u32)(rtarea_wget (addr) << 16) + rtarea_wget (addr + 2); } static uae_u32 REGPARAM2 rtarea_wget (uaecptr addr) @@ -73,7 +73,7 @@ static uae_u32 REGPARAM2 rtarea_wget (uaecptr addr) special_mem |= S_READ; #endif addr &= 0xFFFF; - return (rtarea[addr]<<8) + rtarea[addr+1]; + return (rtarea[addr] << 8) + rtarea[addr + 1]; } static uae_u32 REGPARAM2 rtarea_bget (uaecptr addr) @@ -143,11 +143,13 @@ void dl (uae_u32 data) uae_u32 ds (const char *str) { - int len = strlen (str) + 1; + int len; + if (!str) + return addr (rt_straddr); + len = strlen (str) + 1; rt_straddr -= len; strcpy ((char *)rtarea + rt_straddr, str); - return addr (rt_straddr); } diff --git a/filesys.c b/filesys.c index bcb1d01c..f9da621a 100644 --- a/filesys.c +++ b/filesys.c @@ -4856,6 +4856,7 @@ static uae_u32 REGPARAM2 filesys_dev_bootfilesys (TrapContext *context) return 0; } +extern void picasso96_alloc (TrapContext*); static uae_u32 REGPARAM2 filesys_init_storeinfo (TrapContext *context) { int ret = -1; @@ -4863,6 +4864,7 @@ static uae_u32 REGPARAM2 filesys_init_storeinfo (TrapContext *context) { case 1: mountertask = m68k_areg (&context->regs, 1); + picasso96_alloc (context); break; case 2: ret = automountunit; @@ -5398,7 +5400,7 @@ void filesys_install (void) dw (RTS); org (rtarea_base + 0xFF48); - calltrap (deftrap2 (filesys_init_storeinfo, 0, "filesys_init_storeinfo")); + calltrap (deftrap2 (filesys_init_storeinfo, TRAPFLAG_EXTRA_STACK, "filesys_init_storeinfo")); dw (RTS); org (rtarea_base + 0xFF50); diff --git a/memory.c b/memory.c index 430d4734..a8c03071 100644 --- a/memory.c +++ b/memory.c @@ -874,7 +874,7 @@ static void dummylog(int rw, uaecptr addr, int size, uae_u32 val, int ins) /* extended rom */ if (addr >= 0xf00000 && addr <= 0xf7ffff) return; - /* motherbord ram */ + /* motherboard ram */ if (addr >= 0x08000000 && addr <= 0x08000007) return; if (addr >= 0x07f00000 && addr <= 0x07f00007) diff --git a/od-win32/avioutput.c b/od-win32/avioutput.c index 29464d35..6c01cfba 100644 --- a/od-win32/avioutput.c +++ b/od-win32/avioutput.c @@ -21,6 +21,8 @@ #include "options.h" #include "audio.h" #include "custom.h" +#include "memory.h" +#include "newcpu.h" #include "picasso96.h" #include "dxwrap.h" #include "win32.h" diff --git a/od-win32/dinput.c b/od-win32/dinput.c index 07da46d6..8e0a419d 100644 --- a/od-win32/dinput.c +++ b/od-win32/dinput.c @@ -1269,21 +1269,34 @@ static uae_u32 get_leds (void) return led; } +static void kbevt (uae_u8 vk, uae_u8 sc) +{ + if (0) { + INPUT inp[2] = { 0 }; + int i; + + for (i = 0; i < 2; i++) { + inp[i].type = INPUT_KEYBOARD; + inp[i].ki.wVk = vk; + } + inp[1].ki.dwFlags |= KEYEVENTF_KEYUP; + SendInput (1, inp, sizeof (INPUT)); + SendInput (1, inp + 1, sizeof (INPUT)); + } else { + keybd_event (vk, 0, 0, 0); + keybd_event (vk, 0, KEYEVENTF_KEYUP, 0); + } +} + static void set_leds (uae_u32 led) { if (os_winnt && currprefs.win32_kbledmode) { - if((oldusbleds & KBLED_NUMLOCK) != (led & KBLED_NUMLOCK)) { - keybd_event (VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY, 0); - keybd_event (VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); - } - if((oldusbleds & KBLED_CAPSLOCK) != (led & KBLED_CAPSLOCK)) { - keybd_event (VK_CAPITAL, 0x3a, KEYEVENTF_EXTENDEDKEY, 0); - keybd_event (VK_CAPITAL, 0x3a, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); - } - if((oldusbleds & KBLED_SCROLLLOCK) != (led & KBLED_SCROLLLOCK)) { - keybd_event (VK_SCROLL, 0x46, KEYEVENTF_EXTENDEDKEY, 0); - keybd_event (VK_SCROLL, 0x46, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); - } + if((oldusbleds & KBLED_NUMLOCK) != (led & KBLED_NUMLOCK)) + kbevt (VK_NUMLOCK, 0x45); + if((oldusbleds & KBLED_CAPSLOCK) != (led & KBLED_CAPSLOCK)) + kbevt (VK_CAPITAL, 0x3a); + if((oldusbleds & KBLED_SCROLLLOCK) != (led & KBLED_SCROLLLOCK)) + kbevt (VK_SCROLL, 0x46); oldusbleds = led; } else if (os_winnt && kbhandle != INVALID_HANDLE_VALUE) { #ifdef WINDDK @@ -1709,8 +1722,7 @@ static void unacquire_kb (int num) if (currprefs.keyboard_leds_in_use) { if (oldusedleds >= 0) { - if (!currprefs.win32_kbledmode) - set_leds (oldleds); + set_leds (oldleds); oldusedleds = oldleds; } #ifdef WINDDK diff --git a/od-win32/dxwrap.c b/od-win32/dxwrap.c index cffc547e..1278f494 100644 --- a/od-win32/dxwrap.c +++ b/od-win32/dxwrap.c @@ -21,12 +21,14 @@ #include "sysdeps.h" #include "options.h" +#include "custom.h" +#include "memory.h" +#include "newcpu.h" #include "picasso96.h" #include "dxwrap.h" #include "win32.h" #include "win32gfx.h" #include "machdep/rpt.h" -#include "custom.h" static BOOL bColourKeyAvailable = FALSE; static BOOL bOverlayAvailable = FALSE; diff --git a/od-win32/mman.c b/od-win32/mman.c index 59669adb..8e9ae12d 100644 --- a/od-win32/mman.c +++ b/od-win32/mman.c @@ -220,7 +220,7 @@ static key_t get_next_shmkey(void) key_t result = -1; int i; for (i = 0; i < MAX_SHMID; i++) { - if( shmids[i].key == -1) { + if (shmids[i].key == -1) { shmids[i].key = i; result = i; break; @@ -281,7 +281,7 @@ void *shmat(int shmid, void *shmaddr, int shmflg) if(!strcmp(shmids[shmid].name,"rtarea")) { shmaddr=natmem_offset + rtarea_base; got = TRUE; - size += 32; + size += BARRIER; } if(!strcmp(shmids[shmid].name,"fast")) { shmaddr=natmem_offset + 0x200000; @@ -326,7 +326,7 @@ void *shmat(int shmid, void *shmaddr, int shmflg) size += BARRIER; } if(!strcmp(shmids[shmid].name,"filesys")) { - result = xmalloc (size); + result = xcalloc (size, 1); shmids[shmid].attached=result; return result; } diff --git a/od-win32/picasso96_win.c b/od-win32/picasso96_win.c index 044f5ea7..07d170ee 100644 --- a/od-win32/picasso96_win.c +++ b/od-win32/picasso96_win.c @@ -100,6 +100,7 @@ static uae_u8 all_ones_bitmap, all_zeros_bitmap; /* yuk */ struct picasso96_state_struct picasso96_state; struct picasso_vidbuf_description picasso_vidinfo; +static struct PicassoResolution *newmodes; /* These are the maximum resolutions... They are filled in by GetSupportedResolutions() */ /* have to fill this in, otherwise problems occur on the Amiga side P96 s/w which expects @@ -310,14 +311,16 @@ static void DumpLine( struct Line *line ) static void ShowSupportedResolutions (void) { +#if 0 int i = 0; write_log ("-----------------\n"); - while (DisplayModes[i].depth >= 0) { - write_log ("%s\n", DisplayModes[i].name); + while (newmodes[i].depth >= 0) { + write_log ("%s\n", newmodes[i].name); i++; } write_log ("-----------------\n"); +#endif } static uae_u8 GetBytesPerPixel2(uae_u32 RGBfmt, char *file, int line) @@ -478,30 +481,6 @@ static int CopyLineStructureA2U(uaecptr amigamemptr, struct Line *line) return 0; } -static void CopyLibResolutionStructureU2A (struct LibResolution *libres, uaecptr amigamemptr) -{ - char *uaememptr = 0; - int i; - - uaememptr = gfxmem_xlate (amigamemptr); /* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */ - memset (uaememptr, 0, PSSO_LibResolution_sizeof); /* zero out our LibResolution structure */ - strcpy (uaememptr + PSSO_LibResolution_P96ID, libres->P96ID); - put_long (amigamemptr + PSSO_LibResolution_DisplayID, libres->DisplayID); - put_word (amigamemptr + PSSO_LibResolution_Width, libres->Width); - put_word (amigamemptr + PSSO_LibResolution_Height, libres->Height); - put_word (amigamemptr + PSSO_LibResolution_Flags, libres->Flags); - for (i = 0; i < MAXMODES; i++) - put_long (amigamemptr + PSSO_LibResolution_Modes + i * 4, libres->Modes[i]); -#if 0 - put_long (amigamemptr, libres->Node.ln_Succ); - put_long (amigamemptr + 4, libres->Node.ln_Pred); - put_byte (amigamemptr + 8, libres->Node.ln_Type); - put_byte (amigamemptr + 9, libres->Node.ln_Pri); -#endif - put_long (amigamemptr + 10, amigamemptr + PSSO_LibResolution_P96ID); - put_long (amigamemptr + PSSO_LibResolution_BoardInfo, libres->BoardInfo); -} - /* list is Amiga address of list, in correct endian format for UAE * node is Amiga address of node, in correct endian format for UAE */ static void AmigaListAddTail (uaecptr l, uaecptr n) @@ -1235,8 +1214,7 @@ long height, uae_u8 mask, BLIT_OPCODE opcode) return; } - tmp3 = tmp2 = tmp = xmalloc (linewidth * height); /* allocate enough -memory for the src-rect */ + tmp3 = tmp2 = tmp = xmalloc (linewidth * height); /* allocate enough memory for the src-rect */ if (!tmp) return; @@ -1573,8 +1551,7 @@ uae_u32 REGPARAM2 picasso_FindCard (struct regstruct *regs) if (allocated_gfxmem && !picasso96_state.CardFound) { /* Fill in MemoryBase, MemorySize */ put_long (AmigaBoardInfo + PSSO_BoardInfo_MemoryBase, gfxmem_start); - /* size of memory, minus a 32K chunk: 16K for pattern bitmaps, 16K for resolution list */ - put_long (AmigaBoardInfo + PSSO_BoardInfo_MemorySize, allocated_gfxmem - 32768); + put_long (AmigaBoardInfo + PSSO_BoardInfo_MemorySize, allocated_gfxmem); picasso96_state.CardFound = 1; /* mark our "card" as being found */ return -1; } else @@ -1583,7 +1560,8 @@ uae_u32 REGPARAM2 picasso_FindCard (struct regstruct *regs) static void FillBoardInfo (uaecptr amigamemptr, struct LibResolution *res, struct PicassoResolution *dm) { - char *uaememptr; + int i; + switch (dm->depth) { case 1: res->Modes[CHUNKY] = amigamemptr; @@ -1598,8 +1576,8 @@ static void FillBoardInfo (uaecptr amigamemptr, struct LibResolution *res, struc res->Modes[TRUEALPHA] = amigamemptr; break; } - uaememptr = gfxmem_xlate(amigamemptr); /* I know that amigamemptr is inside my gfxmem chunk, so I can just do the xlate() */ - memset(uaememptr, 0, PSSO_ModeInfo_sizeof); /* zero out our ModeInfo struct */ + for (i = 0; i < PSSO_ModeInfo_sizeof; i++) + put_byte (amigamemptr + i, 0); put_word (amigamemptr + PSSO_ModeInfo_Width, dm->res.width); put_word (amigamemptr + PSSO_ModeInfo_Height, dm->res.height); @@ -1695,8 +1673,8 @@ static int AssignModeID(int dm, int count, int *unkcnt) { int i, w, h; - w = DisplayModes[dm].res.width; - h = DisplayModes[dm].res.height; + w = newmodes[dm].res.width; + h = newmodes[dm].res.height; for (i = 0; mi[i].width > 0; i++) { if (w == mi[i].width && h == mi[i].height) return 0x50001000 | (mi[i].id * 0x10000); @@ -1704,30 +1682,131 @@ static int AssignModeID(int dm, int count, int *unkcnt) (*unkcnt)++; write_log ("P96: Non-unique mode %dx%d\n", w, h); return 0x51000000 - (*unkcnt) * 0x10000; -#if 0 - int result; - if(DisplayModes[i].res.width == 320 && DisplayModes[i].res.height == 200) - result = 0x50001000; - else if(DisplayModes[i].res.width == 320 && DisplayModes[i].res.height == 240) - result = 0x50011000; - else if(DisplayModes[i].res.width == 640 && DisplayModes[i].res.height == 400) - result = 0x50021000; - else if(DisplayModes[i].res.width == 640 && DisplayModes[i].res.height == 480) - result = 0x50031000; - else if(DisplayModes[i].res.width == 800 && DisplayModes[i].res.height == 600) - result = 0x50041000; - else if(DisplayModes[i].res.width == 1024 && DisplayModes[i].res.height == 768) - result = 0x50051000; - else if(DisplayModes[i].res.width == 1152 && DisplayModes[i].res.height == 864) - result = 0x50061000; - else if(DisplayModes[i].res.width == 1280 && DisplayModes[i].res.height == 1024) - result = 0x50071000; - else if(DisplayModes[i].res.width == 1600 && DisplayModes[i].res.height == 1280) - result = 0x50081000; - else - result = 0x50090000 + count * 0x10000; - return result; -#endif +} + +static uaecptr picasso96_amem, picasso96_amemend; + + +static void CopyLibResolutionStructureU2A (struct LibResolution *libres, uaecptr amigamemptr) +{ + int i; + + for (i = 0; i < PSSO_LibResolution_sizeof; i++) + put_byte (amigamemptr + i, 0); + for (i = 0; i < strlen (libres->P96ID); i++) + put_byte (amigamemptr + PSSO_LibResolution_P96ID + i, libres->P96ID[i]); + put_long (amigamemptr + PSSO_LibResolution_DisplayID, libres->DisplayID); + put_word (amigamemptr + PSSO_LibResolution_Width, libres->Width); + put_word (amigamemptr + PSSO_LibResolution_Height, libres->Height); + put_word (amigamemptr + PSSO_LibResolution_Flags, libres->Flags); + for (i = 0; i < MAXMODES; i++) + put_long (amigamemptr + PSSO_LibResolution_Modes + i * 4, libres->Modes[i]); + put_long (amigamemptr + 10, amigamemptr + PSSO_LibResolution_P96ID); + put_long (amigamemptr + PSSO_LibResolution_BoardInfo, libres->BoardInfo); +} + +static int missmodes[] = { 320, 200, 320, 240, 640, 400, 640, 480, -1 }; + +void picasso96_alloc (TrapContext *ctx) +{ + int i, j, size, cnt; + int misscnt; + + xfree (newmodes); + newmodes = NULL; + picasso96_amem = picasso96_amemend = 0; + if (currprefs.gfxmem_size == 0) + return; + misscnt = 0; + cnt = 0; + newmodes = xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES); + size = 0; + i = 0; + while (DisplayModes[i].depth >= 0) { + for (j = 0; missmodes[j * 2] >= 0; j++) { + if (DisplayModes[i].res.width == missmodes[j * 2 + 0] && DisplayModes[i].res.height == missmodes[j * 2 + 1]) { + missmodes[j * 2 + 0] = 0; + missmodes[j * 2 + 1] = 0; + } + } + i++; + } + + i = 0; + while (DisplayModes[i].depth >= 0) { + j = i; + size += PSSO_LibResolution_sizeof; + while (missmodes[misscnt * 2] == 0) + misscnt++; + if (missmodes[misscnt * 2] >= 0) { + int oldi = i; + if (DisplayModes[i].res.width > missmodes[misscnt * 2 + 0] || DisplayModes[i].res.height > missmodes[misscnt * 2 + 1]) { + int w = DisplayModes[i].res.width; + int h = DisplayModes[i].res.height; + do { + struct PicassoResolution *pr = &newmodes[cnt]; + memcpy (pr, &DisplayModes[i], sizeof (struct PicassoResolution)); + pr->res.width = missmodes[misscnt * 2 + 0]; + pr->res.height = missmodes[misscnt * 2 + 1]; + sprintf (pr->name, "%dx%dx%d FAKE", pr->res.width, pr->res.height, pr->depth * 8); + size += PSSO_ModeInfo_sizeof; + i++; + cnt++; + } while (DisplayModes[i].depth >= 0 + && w == DisplayModes[i].res.width + && h == DisplayModes[i].res.height); + + i = oldi; + misscnt++; + continue; + } + } + do { + memcpy (&newmodes[cnt], &DisplayModes[i], sizeof (struct PicassoResolution)); + size += PSSO_ModeInfo_sizeof; + i++; + cnt++; + } while (DisplayModes[i].depth >= 0 + && DisplayModes[i].res.width == DisplayModes[j].res.width + && DisplayModes[i].res.height == DisplayModes[j].res.height); + } + newmodes[cnt].depth = -1; + + for (i = 0; i < cnt; i++) { + switch (newmodes[i].depth) { + case 1: + if (newmodes[i].res.width > chunky.width) + chunky.width = newmodes[i].res.width; + if (newmodes[i].res.height > chunky.height) + chunky.height = newmodes[i].res.height; + break; + case 2: + if (newmodes[i].res.width > hicolour.width) + hicolour.width = newmodes[i].res.width; + if (newmodes[i].res.height > hicolour.height) + hicolour.height = newmodes[i].res.height; + break; + case 3: + if (newmodes[i].res.width > truecolour.width) + truecolour.width = newmodes[i].res.width; + if (newmodes[i].res.height > truecolour.height) + truecolour.height = newmodes[i].res.height; + break; + case 4: + if (newmodes[i].res.width > alphacolour.width) + alphacolour.width = newmodes[i].res.width; + if (newmodes[i].res.height > alphacolour.height) + alphacolour.height = newmodes[i].res.height; + break; + } + } + ShowSupportedResolutions (); + + m68k_dreg (&ctx->regs, 0) = size; + m68k_dreg (&ctx->regs, 1) = 65536 + 1; + picasso96_amem = CallLib (ctx, get_long (4), -0xC6); /* AllocMem */ + picasso96_amemend = picasso96_amem + size; + write_log("P96 RESINFO: %08X-%08X (%d,%d)\n", picasso96_amem, picasso96_amemend, cnt, size); } /**************************************** @@ -1750,10 +1829,16 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) { struct LibResolution res; int ModeInfoStructureCount = 1, LibResolutionStructureCount = 0; - int i, unkcnt; - - uaecptr amigamemptr = 0; + int i, j, unkcnt; + uaecptr amem; uaecptr AmigaBoardInfo = m68k_areg (regs, 2); + + if (!picasso96_amem) { + write_log ("P96: InitCard() but no resolution memory!\n"); + return 0; + } + amem = picasso96_amem; + put_word (AmigaBoardInfo + PSSO_BoardInfo_BitsPerCannon, DX_BitsPerCannon()); put_word (AmigaBoardInfo + PSSO_BoardInfo_RGBFormats, picasso96_pixel_format); put_long (AmigaBoardInfo + PSSO_BoardInfo_BoardType, BT_uaegfx); @@ -1775,13 +1860,13 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) i = 0; unkcnt = 0; - while (DisplayModes[i].depth >= 0) { - int j = i; + while (newmodes[i].depth >= 0) { + j = i; /* Add a LibResolution structure to the ResolutionsList MinList in our BoardInfo */ - res.DisplayID = AssignModeID(i, LibResolutionStructureCount, &unkcnt); + res.DisplayID = AssignModeID (i, LibResolutionStructureCount, &unkcnt); res.BoardInfo = AmigaBoardInfo; - res.Width = DisplayModes[i].res.width; - res.Height = DisplayModes[i].res.height; + res.Width = newmodes[i].res.width; + res.Height = newmodes[i].res.height; res.Flags = P96F_PUBLIC; memcpy (res.P96ID, "P96-0:", 6); sprintf (res.Name, "uaegfx:%dx%d", res.Width, res.Height); @@ -1793,26 +1878,27 @@ uae_u32 REGPARAM2 picasso_InitCard (struct regstruct *regs) do { /* Handle this display mode's depth */ - /* New: Only add the modes when there is enough P96 RTG memory to hold the bitmap */ - if((allocated_gfxmem - 32768) > - (DisplayModes[i].res.width * DisplayModes[i].res.height * DisplayModes[i].depth)) - { - amigamemptr = gfxmem_start + allocated_gfxmem - (PSSO_ModeInfo_sizeof * ModeInfoStructureCount++); - FillBoardInfo(amigamemptr, &res, &DisplayModes[i]); + if(allocated_gfxmem >= newmodes[i].res.width * newmodes[i].res.height * newmodes[i].depth) { + ModeInfoStructureCount++; + FillBoardInfo(amem, &res, &newmodes[i]); + amem += PSSO_ModeInfo_sizeof; } i++; - } while (DisplayModes[i].depth >= 0 - && DisplayModes[i].res.width == DisplayModes[j].res.width - && DisplayModes[i].res.height == DisplayModes[j].res.height); + } while (newmodes[i].depth >= 0 + && newmodes[i].res.width == newmodes[j].res.width + && newmodes[i].res.height == newmodes[j].res.height); - amigamemptr = gfxmem_start + allocated_gfxmem - 16384 + (PSSO_LibResolution_sizeof * LibResolutionStructureCount++); - CopyLibResolutionStructureU2A (&res, amigamemptr); + LibResolutionStructureCount++; + CopyLibResolutionStructureU2A (&res, amem); #if defined P96TRACING_ENABLED && P96TRACING_LEVEL > 1 - DumpLibResolutionStructure(amigamemptr); + DumpLibResolutionStructure(amem); #endif - AmigaListAddTail (AmigaBoardInfo + PSSO_BoardInfo_ResolutionsList, amigamemptr); + AmigaListAddTail (AmigaBoardInfo + PSSO_BoardInfo_ResolutionsList, amem); + amem += PSSO_LibResolution_sizeof; } + if (amem != picasso96_amemend) + write_log ("P96: display resolution list corruption %08x<>%08x", amem, picasso96_amemend); return -1; } @@ -3796,6 +3882,8 @@ addrbank gfxmem_bankx = { * Also put it in reset_drawing() for safe-keeping. */ void InitPicasso96 (void) { + int i; + have_done_picasso = 0; pixelcount = 0; palette_changed = 0; @@ -3804,51 +3892,15 @@ void InitPicasso96 (void) //fastscreen memset (&picasso96_state, 0, sizeof(struct picasso96_state_struct)); - if (1) { - int i, count; - - for (i = 0; i < 256; i++) { - p2ctab[i][0] = (((i & 128) ? 0x01000000 : 0) - | ((i & 64) ? 0x010000 : 0) - | ((i & 32) ? 0x0100 : 0) - | ((i & 16) ? 0x01 : 0)); - p2ctab[i][1] = (((i & 8) ? 0x01000000 : 0) - | ((i & 4) ? 0x010000 : 0) - | ((i & 2) ? 0x0100 : 0) - | ((i & 1) ? 0x01 : 0)); - } - count = 0; - while (DisplayModes[count].depth >= 0) - count++; - for (i = 0; i < count; i++) { - switch (DisplayModes[i].depth) { - case 1: - if (DisplayModes[i].res.width > chunky.width) - chunky.width = DisplayModes[i].res.width; - if (DisplayModes[i].res.height > chunky.height) - chunky.height = DisplayModes[i].res.height; - break; - case 2: - if (DisplayModes[i].res.width > hicolour.width) - hicolour.width = DisplayModes[i].res.width; - if (DisplayModes[i].res.height > hicolour.height) - hicolour.height = DisplayModes[i].res.height; - break; - case 3: - if (DisplayModes[i].res.width > truecolour.width) - truecolour.width = DisplayModes[i].res.width; - if (DisplayModes[i].res.height > truecolour.height) - truecolour.height = DisplayModes[i].res.height; - break; - case 4: - if (DisplayModes[i].res.width > alphacolour.width) - alphacolour.width = DisplayModes[i].res.width; - if (DisplayModes[i].res.height > alphacolour.height) - alphacolour.height = DisplayModes[i].res.height; - break; - } - } - //ShowSupportedResolutions (); + for (i = 0; i < 256; i++) { + p2ctab[i][0] = (((i & 128) ? 0x01000000 : 0) + | ((i & 64) ? 0x010000 : 0) + | ((i & 32) ? 0x0100 : 0) + | ((i & 16) ? 0x01 : 0)); + p2ctab[i][1] = (((i & 8) ? 0x01000000 : 0) + | ((i & 4) ? 0x010000 : 0) + | ((i & 2) ? 0x0100 : 0) + | ((i & 1) ? 0x01 : 0)); } } diff --git a/od-win32/rp.c b/od-win32/rp.c index 6cb5ab0d..f0efff1e 100644 --- a/od-win32/rp.c +++ b/od-win32/rp.c @@ -18,6 +18,9 @@ #include "sound.h" #include "disk.h" #include "xwin.h" +#include "custom.h" +#include "memory.h" +#include "newcpu.h" #include "picasso96_win.h" #include "win32.h" #include "win32gfx.h" diff --git a/od-win32/win32.h b/od-win32/win32.h index 0ac6f8f0..f800a715 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,10 +15,10 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEBETA 17 +#define WINUAEBETA 18 #define WINUAEPUBLICBETA 1 -#define WINUAEDATE MAKEBD(2007, 12, 15) -#define WINUAEEXTRA "" +#define WINUAEDATE MAKEBD(2007, 12, 17) +#define WINUAEEXTRA "RC" #define WINUAEREV "" #define IHF_WINDOWHIDDEN 6 diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index f09e7657..ddb09d81 100644 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -354,11 +354,13 @@ static int set_ddraw (void) write_log ( "set_ddraw: Trying %dx%d, bits=%d, refreshrate=%d\n", width, height, bits, freq ); ddrval = DirectDraw_SetDisplayMode (width, height, bits, freq); if (FAILED(ddrval)) { - write_log ("set_ddraw: failed, trying without forced refresh rate\n"); - ddrval = DirectDraw_SetDisplayMode (width, height, bits, 0); - if (FAILED(ddrval)) { - write_log ( "set_ddraw: Couldn't SetDisplayMode()\n" ); - goto oops; + if (ddrval == E_NOTIMPL) { + write_log ("set_ddraw: failed, trying without forced refresh rate\n"); + ddrval = DirectDraw_SetDisplayMode (width, height, bits, 0); + if (FAILED(ddrval)) { + write_log ( "set_ddraw: Couldn't SetDisplayMode()\n" ); + goto oops; + } } } @@ -2052,7 +2054,6 @@ static int create_windows (void) currentmode->native_width = rc.right - rc.left; currentmode->native_height = rc.bottom - rc.top; } - flags |= (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0); if (!borderless) { @@ -2074,8 +2075,26 @@ static int create_windows (void) y = rc.top; } + } else { + int i; + + for (i = 0; DisplayModes[i].depth >= 0; i++) { + struct PicassoResolution *pr = &DisplayModes[i]; + if (pr->res.width == currentmode->native_width && pr->res.height == currentmode->native_height) + break; + if (pr->res.width >= currentmode->native_width && pr->res.height >= currentmode->native_height) { + write_log ("FS: %dx%d -> %dx%d\n", currentmode->native_width, currentmode->native_height, + pr->res.width, pr->res.height); + currentmode->native_width = pr->res.width; + currentmode->native_height = pr->res.height; + break; + } + } + } + + hAmigaWnd = CreateWindowEx (dxfs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | exstyle | (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0), "AmigaPowah", "WinUAE", WS_CLIPCHILDREN | WS_CLIPSIBLINGS | (hMainWnd ? WS_VISIBLE | WS_CHILD : WS_VISIBLE | WS_POPUP | WS_SYSMENU | WS_MINIMIZEBOX), @@ -2214,7 +2233,8 @@ static BOOL doInit (void) if (!modefallback (0)) goto oops; close_windows (); - if (!DirectDraw_Start (displayGUID)) break; + if (!DirectDraw_Start (displayGUID)) + break; continue; } picasso_vidinfo.rowbytes = DirectDraw_GetSurfacePitch(); diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 3722c982..9a4203c9 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,26 +1,22 @@ - - - - -Dabei seit: 09.09.2005 15:28 It since: 09.09.2005 15:28 -Herkunft: Rheinland-Pfalz Source: Rhineland-Palatinate -Beiträge: 81 Posts: 81 - Hallo Leute im Amigaemuboard! Hi people in Amigaemuboard! - -Wie kann ich eigentlich im WinUAE den Schreibschutz für Amiga-Games deaktivieren? How can I actually WinUAE in the write protection for Amiga Games deactivate? -Muß den nicht bei einigen Amigaspielen die als ADF-Format vorliegen der Schreibschutz Do not some Amiga games as ADF-Format present the write protection -deaktiviert wwerden, um sie lauffähig machen zu können??? Disabled wwerden order to be able to run? Wie kann man den Schreibschutz How can you write protection -einer Diskette (ADF) deaktivieren? A diskette (ADF) disable? - -MfG Micro Micro MfG - +Beta 18: + +- moved Picasso96 resolution list from special reserved display RAM + area to regular Amiga RAM (allocated with AllocMem) This should be + 100% fix to display resolution list corruption in display prefs + utility. (if previous fix in b16 didn't fix it) +- following "fake" display resolutions added to Picasso96 resolution + list (if no native support): 320x200, 320x240, 640x400, 640x480. + In fullscreen selects next bigger supported resolution automatically. + Note: fullscreen display is not centered +- keyboard led emulation should not cause random key presses anymore + (but it still is quite unreliable) Beta 17: -- roms inside archive directory failed to load -- check that mouse buttons #4 and #5 are real buttons (not "Wheel -/+") - before adding default Left ALT + Cursor Left/Right mappings +- rom scan detected roms inside archive directory failed to load +- mouse buttons #4 and #5 default Left ALT + Cursor Left/Right mapping + fixed, was mapped to "Wheel +/-" if less than 5 buttons Beta 16: diff --git a/zfile.c b/zfile.c index 2c242f53..277db2c6 100644 --- a/zfile.c +++ b/zfile.c @@ -170,11 +170,13 @@ struct zfile *zfile_gunzip (struct zfile *z) i = 0; do { zfile_fread (name + i, 1, 1, z); - } while (name[i++]); + } while (i < MAX_DPATH - 1 && name[i++]); + name[i] = 0; } if (flags & 16) { /* skip comment */ i = 0; do { + b = 0; zfile_fread (&b, 1, 1, z); } while (b); }