]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1500b9.zip
authorToni Wilen <twilen@winuae.net>
Tue, 18 Mar 2008 18:16:54 +0000 (20:16 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:39:23 +0000 (21:39 +0200)
25 files changed:
akiko.c
cia.c
custom.c
debug.c
drawing.c
gencpu.c
genlinetoscr.c
include/drawing.h
include/gfxfilter.h
include/readcpu.h
jit/gencomp.c
memory.c
newcpu.c
od-win32/direct3d.c
od-win32/dxwrap.c
od-win32/picasso96_win.c
od-win32/win32.h
od-win32/win32_scale2x.c
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/winuaechangelog.txt
p96_blit.c
readcpu.c
savestate.c
table68k

diff --git a/akiko.c b/akiko.c
index b59cb733fe9bd0c21a3323b60a25367509905f3f..d808262bc0e045021b6f68e0a38add71e68d900e 100755 (executable)
--- a/akiko.c
+++ b/akiko.c
@@ -404,7 +404,7 @@ static int cd_hunt;
 static void checkint (void)
 {
     if (cdrom_status1 & cdrom_status2)
-       irq();
+       irq ();
 }
 
 static void set_status(uae_u32 status)
@@ -962,7 +962,7 @@ static void cdrom_run_read (void)
     }
     cdrom_sector_counter++;
     if (cdrom_readmask_w == 0)
-       set_status(CDSTATUS_DATASECTOR);
+       set_status (CDSTATUS_DATASECTOR);
 
 }
 
@@ -1061,14 +1061,14 @@ void AKIKO_hsync_handler (void)
            gui_cd_led (0, 1);
        cdrom_run_read ();
        framecounter = 1000000 / (74 * 75 * cdrom_speed);
-       set_status(CDSTATUS_FRAME);
+       set_status (CDSTATUS_FRAME);
     }
     if (cdrom_playing) {
        static int frame2counter;
        if (cdrom_audiotimeout > 0) {
            cdrom_audiotimeout--;
            if (cdrom_audiotimeout == 0) {
-               set_status(CDSTATUS_DATA_AVAILABLE);
+               set_status (CDSTATUS_DATA_AVAILABLE);
                cdrom_playing = 0;
                cdrom_result_buffer[1] = 0;
                cdrom_return_data (2);
@@ -1496,6 +1496,8 @@ void akiko_reset (void)
 
     cdrom_speed = 1;
     cdrom_current_sector = -1;
+    cdrom_command_offset_complete = 0;
+    cdrom_command_offset_todo = 0;
 
     if (akiko_thread_running > 0) {
        akiko_thread_running = 0;
@@ -1631,8 +1633,11 @@ uae_u8 *restore_akiko(uae_u8 *src)
     uae_u32 v;
     int i;
 
-    if (!currprefs.cs_cd32cd)
-       return NULL;
+    if (!currprefs.cs_cd32cd) {
+       changed_prefs.cs_cd32c2p = changed_prefs.cs_cd32cd = changed_prefs.cs_cd32nvram = 1;
+       currprefs.cs_cd32c2p = currprefs.cs_cd32cd = currprefs.cs_cd32nvram = 1;
+       akiko_init ();
+    }
 
     restore_u16 ();
     restore_u16 ();
@@ -1693,8 +1698,10 @@ void restore_akiko_finish(void)
     sys_command_cd_pause (DF_IOCTL, unitnum, 0);
     sys_command_cd_stop (DF_IOCTL, unitnum);
     sys_command_cd_pause (DF_IOCTL, unitnum, 1);
-    if (cdrom_playing)
+    if (cdrom_playing) {
+        sys_command_cd_pause (DF_IOCTL, unitnum, 0);
        sys_command_cd_play (DF_IOCTL, unitnum, last_play_pos, last_play_end, 0);
+    }
 }
 
 #endif
diff --git a/cia.c b/cia.c
index 2f581ec1688037f77e285050e1a312699e84a6fc..e2b052700463965dcf64510e4e32a0f6e3049b47 100755 (executable)
--- a/cia.c
+++ b/cia.c
@@ -1082,9 +1082,11 @@ void CIA_reset (void)
        DISK_select (ciabprb);
     }
 #ifdef CD32
-    akiko_reset ();
-    if (!akiko_init ())
-       currprefs.cs_cd32cd = changed_prefs.cs_cd32cd = 0;
+    if (savestate_state != STATE_RESTORE) {
+       akiko_reset ();
+       if (!akiko_init ())
+           currprefs.cs_cd32cd = changed_prefs.cs_cd32cd = 0;
+    }
 #endif
 }
 
index 40c160839238da3bf37d25a751421e99a0f719e7..744bddafc6e762b3ddb15e78805bc9aae92e5f85 100755 (executable)
--- a/custom.c
+++ b/custom.c
 
 //#define CUSTOM_DEBUG
 #define SPRITE_DEBUG 0
-#define SPRITE_DEBUG_MINY 0x6a
-#define SPRITE_DEBUG_MAXY 0x70
+#define SPRITE_DEBUG_MINY 0xb0
+#define SPRITE_DEBUG_MAXY 0xf8
 #define SPR0_HPOS 0x15
 #define MAX_SPRITES 8
 #define SPRITE_COLLISIONS
 #define SPEEDUP
 
+#define SPRBORDER 0
+
 #include "sysconfig.h"
 #include "sysdeps.h"
 
@@ -78,7 +80,7 @@ void uae_abort (const char *format,...)
     _vsnprintf(buffer, sizeof (buffer) - 1, format, parms );
     va_end (parms);
     if (nomore) {
-       write_log (buffer);
+       write_log ("%s\n", buffer);
        return;
     }
     gui_message (buffer);
@@ -1933,7 +1935,7 @@ static void record_sprite (int line, int num, int sprxp, uae_u16 *data, uae_u16
     attachment =  (spr[num & ~1].armed && ((sprctl[num | 1] & 0x80) || (!(currprefs.chipset_mask & CSMASK_AGA) && (sprctl[num & ~1] & 0x80))));
 
     /* Try to coalesce entries if they aren't too far apart  */
-    if (! next_sprite_forced && e[-1].max + sprite_width >= sprxp && (attachment || ((bplcon4 >> 4) & 15) == ((bplcon4 >> 0) & 15))) {
+    if (!next_sprite_forced && e[-1].max + sprite_width >= sprxp && (attachment || ((bplcon4 >> 4) & 15) == ((bplcon4 >> 0) & 15))) {
        e--;
     } else {
        next_sprite_entry++;
@@ -1987,22 +1989,43 @@ static void record_sprite (int line, int num, int sprxp, uae_u16 *data, uae_u16
     }
 }
 
-STATIC_INLINE int SSCAN2_H10 (int x)
+static void add_sprite (int *countp, int num, int sprxp, int window_xp, int posns[], int nrs[], int window_width)
 {
-    if (fmode & 0x8000)
-       return x & ~(0x100 << sprite_buffer_res);
-    return x;
+    int count = *countp;
+    int j, bestp;
+#ifdef AGA
+    if ( !(bplcon3 & 2) && /* sprites outside playfields enabled? */
+        ((thisline_decision.diwfirstword >= 0 && window_xp + window_width < thisline_decision.diwfirstword)
+        || (thisline_decision.diwlastword >= 0 && window_xp > thisline_decision.diwlastword)))
+           return;
+#endif
+    /* Sort the sprites in order of ascending X position before recording them.  */
+    for (bestp = 0; bestp < count; bestp++) {
+        if (posns[bestp] > sprxp)
+           break;
+       if (posns[bestp] == sprxp && nrs[bestp] < num)
+           break;
+    }
+    for (j = count; j > bestp; j--) {
+        posns[j] = posns[j - 1];
+        nrs[j] = nrs[j - 1];
+    }
+    posns[j] = sprxp;
+    nrs[j] = num;
+    count++;
+    *countp = count;
 }
 
 static void decide_sprites (int hpos)
 {
-    int nrs[MAX_SPRITES], posns[MAX_SPRITES];
+    int nrs[MAX_SPRITES * 2], posns[MAX_SPRITES * 2];
     int count, i;
      /* apparantly writes to custom registers happen in the 3/4th of cycle
       * and sprite xpos comparator sees it immediately */
     int point = hpos * 2 - 3;
     int width = sprite_width;
     int window_width = (width << lores_shift) >> sprres;
+    int sscanmask = 0x100 << sprite_buffer_res;
 
     if (nodraw () || hpos < 0x14 || nr_armed == 0 || point == last_sprite_point)
        return;
@@ -2012,10 +2035,12 @@ static void decide_sprites (int hpos)
 
     count = 0;
     for (i = 0; i < MAX_SPRITES; i++) {
-       int sprxp = SSCAN2_H10 (spr[i].xpos);
+       int sprxp = (fmode & 0x8000) ? (spr[i].xpos & ~sscanmask) : spr[i].xpos;
        int hw_xp = sprxp >> sprite_buffer_res;
        int window_xp = coord_hw_to_window_x (hw_xp) + (DIW_DDF_OFFSET << lores_shift);
-       int j, bestp;
+
+       if (spr[i].xpos < 0)
+           continue;
 
        if (!((debug_sprite_mask) & (1 << i)))
            continue;
@@ -2023,33 +2048,22 @@ static void decide_sprites (int hpos)
        if (! spr[i].armed)
            continue;
 
-       if (sprxp < 0 || hw_xp <= last_sprite_point || hw_xp > point)
-           continue;
+       if (hw_xp > last_sprite_point && hw_xp <= point)
+           add_sprite (&count, i, sprxp, window_xp, posns, nrs, window_width);
 
-#ifdef AGA
-       if ( !(bplcon3 & 2) && /* sprites outside playfields enabled? */
-           ((thisline_decision.diwfirstword >= 0 && window_xp + window_width < thisline_decision.diwfirstword)
-           || (thisline_decision.diwlastword >= 0 && window_xp > thisline_decision.diwlastword)))
-           continue;
-#endif
-       /* Sort the sprites in order of ascending X position before recording them.  */
-       for (bestp = 0; bestp < count; bestp++) {
-           if (posns[bestp] > sprxp)
-               break;
-           if (posns[bestp] == sprxp && nrs[bestp] < i)
-               break;
-       }
-       for (j = count; j > bestp; j--) {
-           posns[j] = posns[j-1];
-           nrs[j] = nrs[j-1];
+       /* SSCAN2-bit is fun.. */
+       if ((fmode & 0x8000) && !(sprxp & sscanmask)) {
+           sprxp |= sscanmask;
+           hw_xp = sprxp >> sprite_buffer_res;
+           window_xp = coord_hw_to_window_x (hw_xp) + (DIW_DDF_OFFSET << lores_shift);
+           if (hw_xp > last_sprite_point && hw_xp <= point)
+               add_sprite (&count, MAX_SPRITES + i, sprxp, window_xp, posns, nrs, window_width);
        }
-       posns[j] = sprxp;
-       nrs[j] = i;
-       count++;
     }
+
     for (i = 0; i < count; i++) {
-       int nr = nrs[i];
-       record_sprite (next_lineno, nr, SSCAN2_H10 (spr[nr].xpos), sprdata[nr], sprdatb[nr], sprctl[nr]);
+       int nr = nrs[i] & (MAX_SPRITES - 1);
+       record_sprite (next_lineno, nr, posns[i], sprdata[nr], sprdatb[nr], sprctl[nr]);
     }
     last_sprite_point = point;
 }
@@ -2887,6 +2901,9 @@ static void BPLCON0 (int hpos, uae_u16 v)
     else if (! (currprefs.chipset_mask & CSMASK_AGA))
        v &= ~0x00B1;
 
+#if SPRBORDER
+    v |= 1;
+#endif
     if (bplcon0 == v)
        return;
 
@@ -2950,6 +2967,9 @@ STATIC_INLINE void BPLCON3 (int hpos, uae_u16 v)
        v &= 0x3f;
        v |= 0x0c00;
     }
+#if SPRBORDER
+    v |= 2;
+#endif
     if (bplcon3 == v)
        return;
     decide_line (hpos);
@@ -3248,7 +3268,7 @@ STATIC_INLINE void SPRxCTL_1 (uae_u16 v, int num, int hpos)
 #if SPRITE_DEBUG > 0
     if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) {
        write_log ("%d:%d:SPR%dCTL %04.4X P=%06.6X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n",
-           vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, m68k_getpc ());
+           vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, M68K_GETPC);
     }
 #endif
 
@@ -3261,7 +3281,7 @@ STATIC_INLINE void SPRxPOS_1 (uae_u16 v, int num, int hpos)
 #if SPRITE_DEBUG > 0
     if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) {
        write_log ("%d:%d:SPR%dPOS %04.4X P=%06.6X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n",
-           vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, m68k_getpc ());
+           vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, M68K_GETPC);
     }
 #endif
 }
@@ -3277,7 +3297,7 @@ STATIC_INLINE void SPRxDATA_1 (uae_u16 v, int num, int hpos)
 #if SPRITE_DEBUG > 1
     if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) {
        write_log ("%d:%d:SPR%dDATA %04.4X P=%06.6X D=%d A=%d PC=%x\n",
-           vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, m68k_getpc ());
+           vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, M68K_GETPC);
     }
 #endif
 }
@@ -3292,7 +3312,7 @@ STATIC_INLINE void SPRxDATB_1 (uae_u16 v, int num, int hpos)
 #if SPRITE_DEBUG > 1
     if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) {
        write_log ("%d:%d:SPR%dDATB %04.4X P=%06.6X D=%d A=%d PC=%x\n",
-           vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, m68k_getpc ());
+           vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, M68K_GETPC);
     }
 #endif
 }
@@ -3855,7 +3875,7 @@ STATIC_INLINE uae_u16 sprite_fetch (struct sprite *s, int dma, int hpos, int cyc
     uae_u16 data = last_custom_value;
     if (dma) {
        data = last_custom_value = chipmem_agnus_wget (s->pt);
-       alloc_cycle(hpos, CYCLE_SPRITE);
+       alloc_cycle (hpos, CYCLE_SPRITE);
     }
     s->pt += 2;
     return data;
@@ -3893,6 +3913,12 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos)
            write_log ("%d:%d:SPR%d STOP\n", vpos, hpos, num);
 #endif
        s->dmastate = 0;
+#if 1
+       if (vpos == s->vstop) {
+           spr_arm (num, 0);
+           //return;
+       }
+#endif
     }
     if (!dmaen (DMA_SPRITE))
        return;
@@ -4018,7 +4044,7 @@ static void do_sprites (int hpos)
            cycle = 1;
            break;
        }
-       if (cycle >= 0)
+       if (cycle >= 0 && num >= 0 && num < MAX_SPRITES)
            do_sprites_1 (num, cycle, i);
     }
     last_sprite_hpos = hpos;
diff --git a/debug.c b/debug.c
index 05a8274e958a8135388e1fec6a7f321034337bf6..b38c7f4a1af300b4426a91e859f6b0f76af57217 100755 (executable)
--- a/debug.c
+++ b/debug.c
@@ -2295,17 +2295,17 @@ static void debugtest_set (char **inptr)
 
 static void debug_sprite (char **inptr)
 {
-    uaecptr addr, addr2;
+    uaecptr saddr, addr, addr2;
     int xpos, xpos_ecs;
     int ypos, ypos_ecs;
     int ypose, ypose_ecs;
     int attach;
     uae_u64 w1, w2, ww1, ww2;
     int size = 1, width;
-    int ecs = 0;
-    int sh10 = 0;
-    int y;
+    int ecs, sh10;
+    int y, i;
     char tmp[80];
+    int max = 2;
 
     addr2 = 0;
     ignore_ws (inptr);
@@ -2321,94 +2321,111 @@ static void debug_sprite (char **inptr)
        if (size != 1 && size != 2 && size != 4)
            size = 1;
     }
-    width = size * 16;
-    w1 = get_word (addr);
-    w2 = get_word (addr + size * 2);
-    ypos = w1 >> 8;
-    xpos = w1 & 255;
-    ypose = w2 >> 8;
-    attach = (w2 & 0x80) ? 1 : 0;
-    if (w2 & 4)
-       ypos |= 256;
-    if (w2 & 2)
-       ypose |= 256;
-    ypos_ecs = ypos;
-    ypose_ecs = ypose;
-    if (w2 & 0x40)
-       ypos_ecs |= 512;
-    if (w2 & 0x20)
-       ypose_ecs |= 512;
-    xpos <<= 1;
-    if (w2 & 0x01)
-       xpos |= 1;
-    xpos_ecs = xpos << 2;
-    if (w2 & 0x10)
-       xpos_ecs |= 2;
-    if (w2 & 0x08)
-       xpos_ecs |= 1;
-    if (w2 & (0x40 | 0x20 | 0x10 | 0x08))
-       ecs = 1;
-    if (w1 & 0x80)
-       sh10 = 1;
-    for (y = ypos; y < ypose; y++) {
-       int x;
-       addr += size * 4;
-       if (addr2)
-           addr2 += size * 4;
-       if (size == 1) {
-           w1 = get_word (addr);
-           w2 = get_word (addr + 2);
-           if (addr2) {
-               ww1 = get_word (addr2);
-               ww2 = get_word (addr2 + 2);
-           }
-       } else if (size == 2) {
-           w1 = get_long (addr);
-           w2 = get_long (addr + 4);
-           if (addr2) {
-               ww1 = get_long (addr2);
-               ww2 = get_long (addr2 + 4);
-           }
-       } else if (size == 4) {
-           w1 = get_long (addr) << 16;
-           w2 = get_long (addr + 4) << 16;
-           w1 <<= 16;
-           w2 <<= 16;
-           w1 |= get_long (addr);
-           w2 |= get_long (addr2 + 4);
-           if (addr2) {
-               ww1 = get_long (addr2) << 16;
-               ww2 = get_long (addr2 + 4) << 16;
-               ww1 <<= 16;
-               ww2 <<= 16;
-               ww1 |= get_long (addr2);
-               ww2 |= get_long (addr2 + 4);
-           }
-       }
+    for (;;) {
+       ecs = 0;
+       sh10 = 0;
+       saddr = addr;
        width = size * 16;
-       for (x = 0; x < width; x++) {
-           int v1 = (w1 >> (width - x)) & 1;
-           int v2 = (w2 >> (width - x)) & 1;
-           int v = v1 * 2 + v2;
-           if (addr2) {
-               int vv1 = (ww1 >> (width - x)) & 1;
-               int vv2 = (ww2 >> (width - x)) & 1;
-               int vv = vv1 * 2 + vv2;
-               v *= 4;
-               v += vv;
-               tmp[x] = v >= 10 ? 'A' + v - 10 : v + '0';
-           } else {
-               tmp[x] = v + '0';
+       w1 = get_word (addr);
+       w2 = get_word (addr + size * 2);
+       console_out_f ("    %06X ", addr);
+       for (i = 0; i < size * 2; i++)
+           console_out_f ("%04X ", get_word (addr + i * 2));
+       console_out_f ("\n");
+       ypos = w1 >> 8;
+       xpos = w1 & 255;
+       ypose = w2 >> 8;
+       attach = (w2 & 0x80) ? 1 : 0;
+       if (w2 & 4)
+           ypos |= 256;
+       if (w2 & 2)
+           ypose |= 256;
+       ypos_ecs = ypos;
+       ypose_ecs = ypose;
+       if (w2 & 0x40)
+           ypos_ecs |= 512;
+       if (w2 & 0x20)
+           ypose_ecs |= 512;
+       xpos <<= 1;
+       if (w2 & 0x01)
+           xpos |= 1;
+       xpos_ecs = xpos << 2;
+       if (w2 & 0x10)
+           xpos_ecs |= 2;
+       if (w2 & 0x08)
+           xpos_ecs |= 1;
+       if (w2 & (0x40 | 0x20 | 0x10 | 0x08))
+           ecs = 1;
+       if (w1 & 0x80)
+           sh10 = 1;
+       for (y = ypos; y < ypose; y++) {
+           int x;
+           addr += size * 4;
+           if (addr2)
+               addr2 += size * 4;
+           if (size == 1) {
+               w1 = get_word (addr);
+               w2 = get_word (addr + 2);
+               if (addr2) {
+                   ww1 = get_word (addr2);
+                   ww2 = get_word (addr2 + 2);
+               }
+           } else if (size == 2) {
+               w1 = get_long (addr);
+               w2 = get_long (addr + 4);
+               if (addr2) {
+                   ww1 = get_long (addr2);
+                   ww2 = get_long (addr2 + 4);
+               }
+           } else if (size == 4) {
+               w1 = get_long (addr) << 16;
+               w2 = get_long (addr + 4) << 16;
+               w1 <<= 16;
+               w2 <<= 16;
+               w1 |= get_long (addr);
+               w2 |= get_long (addr2 + 4);
+               if (addr2) {
+                   ww1 = get_long (addr2) << 16;
+                   ww2 = get_long (addr2 + 4) << 16;
+                   ww1 <<= 16;
+                   ww2 <<= 16;
+                   ww1 |= get_long (addr2);
+                   ww2 |= get_long (addr2 + 4);
+               }
            }
+           width = size * 16;
+           for (x = 0; x < width; x++) {
+               int v1 = (w1 >> (width - x)) & 1;
+               int v2 = (w2 >> (width - x)) & 1;
+               int v = v1 * 2 + v2;
+               if (addr2) {
+                   int vv1 = (ww1 >> (width - x)) & 1;
+                   int vv2 = (ww2 >> (width - x)) & 1;
+                   int vv = vv1 * 2 + vv2;
+                   v *= 4;
+                   v += vv;
+                   tmp[x] = v >= 10 ? 'A' + v - 10 : v + '0';
+               } else {
+                   tmp[x] = v + '0';
+               }
+           }
+           tmp[width] = 0;
+           console_out_f ("%3d %06X %s\n", y, addr, tmp);
        }
-       tmp[width] = 0;
-       console_out_f ("%3d: %s\n", y, tmp);
+
+       console_out_f ("Sprite address %08X, width = %d\n", saddr, size * 16);
+       console_out_f ("OCS: StartX=%d StartY=%d EndY=%d\n", xpos, ypos, ypose);
+       console_out_f ("ECS: StartX=%d (%d.%d) StartY=%d EndY=%d%s\n", xpos_ecs, xpos_ecs / 4, xpos_ecs & 3, ypos_ecs, ypose_ecs, ecs ? " (*)" : "");
+       console_out_f ("Attach: %d. AGA SSCAN/SH10 bit: %d\n", attach, sh10);
+
+        addr += size * 4;
+       if (get_word (addr) == 0 && get_word (addr + size * 4) == 0)
+           break;
+       max--;
+       if (max <= 0)
+           break;
     }
 
-    console_out_f ("Sprite address %08X, width = %d\n", addr, size * 16);
-    console_out_f ("OCS: StartX=%d StartY=%d EndY=%d\n", xpos, ypos, ypose);
-    console_out_f ("ECS: StartX=%d (%d.%d) StartY=%d EndY=%d%s\n", xpos_ecs, xpos_ecs / 4, xpos_ecs & 3, ypos_ecs, ypose_ecs, ecs ? " (*)" : "");
-    console_out_f ("Attach: %d. AGA SSCAN/SH10 bit: %d\n", attach, sh10);
 }
 
 static void disk_debug (char **inptr)
@@ -2597,7 +2614,7 @@ static void debug_1 (void)
                } else {
                    next_char (&inptr);
                    if (more_params (&inptr))
-                       debug_sprite_mask = readint (&inptr);
+                       debug_sprite_mask = readhex (&inptr);
                    console_out_f ("sprite mask: %02.2X\n", debug_sprite_mask);
                }
            } else {
index 6d8a0372b7f7b324140fae28987fb26020749ecc..a496e37267e589b7e51a79c4e107be8b1a4423fc 100755 (executable)
--- a/drawing.c
+++ b/drawing.c
@@ -330,6 +330,7 @@ static int pixels_offset;
 static int src_pixel;
 /* How many pixels in window coordinates which are to the left of the left border.  */
 static int unpainted;
+static int seen_sprites;
 
 /* Initialize the variables necessary for drawing a line.
  * This involves setting up start/stop positions and display window
@@ -374,7 +375,6 @@ static void pfield_init_linetoscr (void)
 #ifdef AGA
     if (brdsprt && dip_for_drawing->nr_sprites) {
        int min = visible_right_border, max = visible_left_border, i;
-       int posdiff = sprite_buffer_res - bplres;
        for (i = 0; i < dip_for_drawing->nr_sprites; i++) {
            int x;
            x = curr_sprite_entries[dip_for_drawing->first_sprite_entry + i].pos;
@@ -384,15 +384,8 @@ static void pfield_init_linetoscr (void)
            if (x > max)
                max = x;
        }
-       min += (DIW_DDF_OFFSET - DISPLAY_LEFT_SHIFT) << sprite_buffer_res;
-       max += (DIW_DDF_OFFSET - DISPLAY_LEFT_SHIFT) << sprite_buffer_res;
-       if (posdiff < 0) {
-           min <<= -posdiff;
-           max <<= -posdiff;
-       } else {
-           min >>= posdiff;
-           max >>= posdiff;
-       }
+       min = coord_hw_to_window_x (min >> sprite_buffer_res) + (DIW_DDF_OFFSET << lores_shift);
+       max = coord_hw_to_window_x (max >> sprite_buffer_res) + (DIW_DDF_OFFSET << lores_shift);
        if (min < playfield_start)
            playfield_start = min;
        if (playfield_start < visible_left_border)
@@ -413,8 +406,16 @@ static void pfield_init_linetoscr (void)
     unpainted = visible_left_border < playfield_start ? 0 : visible_left_border - playfield_start;
     src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window (playfield_start - native_ddf_left + unpainted);
 
+    if (seen_sprites) {
+       /* clear previous sprite data storage line */
+       memset (spritepixels, 0, sizeof (spritepixels));
+       seen_sprites = 0;
+    }
     if (dip_for_drawing->nr_sprites == 0)
        return;
+    if (seen_sprites < 0)
+       memset (spritepixels, 0, sizeof (spritepixels));
+    seen_sprites = 1;
     /* Must clear parts of apixels.  */
     if (linetoscr_diw_start < native_ddf_left) {
        int size = res_shift_from_window (native_ddf_left - linetoscr_diw_start);
@@ -2129,6 +2130,7 @@ static void init_drawing_frame (void)
     thisframe_last_drawn_line = -1;
 
     drawing_color_matches = -1;
+    seen_sprites = -1;
 }
 
 /*
index e3af491dff9a06b3dd46b54c6fe75d994a2441d1..f351d413e346dcd419b6ce5dd320e927bc20de92 100755 (executable)
--- a/gencpu.c
+++ b/gencpu.c
@@ -1677,6 +1677,19 @@ static void gen_opcode (unsigned long int opcode)
        sync_m68k_pc ();
        fill_prefetch_full ();
        break;
+    case i_LPSTOP: /* 68060 */
+       printf ("\tuae_u16 sw = get_iword (regs, 2);\n");
+       printf ("\tuae_u16 sr;\n");
+       printf ("\tif (sw != (0x100|0x80|0x40)) { Exception (4, regs, 0); goto %s; }\n", endlabelstr);
+       printf ("\tsr = get_iword (regs, 4);\n");
+       printf ("\tif (!(sr & 0x8000)) { Exception (8, regs, 0); goto %s; }\n", endlabelstr);
+       printf ("\tregs->sr = sr;\n");
+       printf ("\tMakeFromSR (regs);\n");
+       printf ("\tm68k_setstopped(regs, 1);\n");
+       m68k_pc_offset += 4;
+       sync_m68k_pc ();
+       fill_prefetch_full ();
+       break;
     case i_RTE:
        if (cpu_level == 0) {
            genamode (Aipi, "7", sz_word, "sr", 1, 0, GF_NOREFILL);
@@ -2900,12 +2913,19 @@ static void gen_opcode (unsigned long int opcode)
        }
        break;
 
-    case i_MMUOP:
+    case i_PFLUSHN:
+    case i_PFLUSH:
+    case i_PFLUSHAN:
+    case i_PFLUSHA:
+    case i_PLPAR:
+    case i_PLPAW:
+    case i_PTESTR:
+    case i_PTESTW:
        genamode (curi->smode, "srcreg", curi->size, "extra", 1, 0, 0);
        sync_m68k_pc ();
        printf ("\tmmu_op (opcode, regs, extra);\n");
        break;
-    case i_MMUOP30A:
+    case i_MMUOP030:
        printf ("\tuaecptr pc = m68k_getpc (regs);\n");
        if (curi->smode == Areg || curi->smode == Dreg)
            printf("\tuae_u16 extraa = 0;\n");
@@ -2914,12 +2934,6 @@ static void gen_opcode (unsigned long int opcode)
        sync_m68k_pc ();
        printf ("\tmmu_op30 (pc, opcode, regs, 1, extraa);\n");
        break;
-    case i_MMUOP30B:
-       printf ("\tuaecptr pc = m68k_getpc (regs);\n");
-       genamode (curi->smode, "srcreg", curi->size, "extra", 0, 0, 0);
-       sync_m68k_pc ();
-       printf ("\tmmu_op30 (pc, opcode, regs, 0, 0);\n");
-       break;
     default:
        abort ();
        break;
index df09251809db272ea1f6b85ae966ca9119317197..c89af7ca0bc6f44a2a9b573f96dc9ecd86da02de 100755 (executable)
@@ -135,7 +135,6 @@ static void out_linetoscr_do_dstpix (DEPTH_T bpp, HMODE_T hmode, int aga, CMODE_
     else if (aga && cmode == CMODE_DUALPF) {
        outln (         "    if (spritepixels[spix]) {");
        outln (         "        dpix_val = colors_for_drawing.acolors[spritepixels[spix]];");
-       outln (         "        spritepixels[spix] = 0;");
        outln (         "    } else {");
        outln (         "        unsigned int val = lookup[spix_val];");
        outln (         "        if (lookup_no[spix_val] == 2)");
@@ -179,7 +178,6 @@ static void out_sprite (int off)
 {
     outlnf ( "    if (spritepixels[sprx + MAX_PIXELS_PER_LINE * %d]) {", off);
     outlnf ( "        buf[dpix] = colors_for_drawing.acolors[spritepixels[sprx + MAX_PIXELS_PER_LINE * %d]];", off);
-    outlnf ( "        spritepixels[sprx + MAX_PIXELS_PER_LINE * %d] = 0;", off);
     outlnf ( "    } else {");
     outlnf ( "        buf[dpix] = out_val;");
     outlnf ( "    }");
index c510c284fba5b294e77581ce99ed4043546d4480..b8bbaa6bb7614e9ea7163a547d2b799fb27c1b5d 100755 (executable)
@@ -197,7 +197,7 @@ extern struct color_change *color_changes[2];
 extern struct color_change color_changes[2][MAX_REG_CHANGE];
 #endif
 
-extern struct color_entry color_tables[2][(MAXVPOS+1) * 2];
+extern struct color_entry color_tables[2][(MAXVPOS + 1) * 2];
 extern struct color_entry *curr_color_tables, *prev_color_tables;
 
 extern struct sprite_entry *curr_sprite_entries, *prev_sprite_entries;
@@ -234,10 +234,10 @@ struct draw_info {
 
 extern int next_sprite_entry;
 
-extern struct decision line_decisions[2 * (MAXVPOS+1) + 1];
-extern struct draw_info line_drawinfo[2][2 * (MAXVPOS+1) + 1];
+extern struct decision line_decisions[2 * (MAXVPOS + 1) + 1];
+extern struct draw_info line_drawinfo[2][2 * (MAXVPOS + 1) + 1];
 
-extern uae_u8 line_data[(MAXVPOS+1) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2];
+extern uae_u8 line_data[(MAXVPOS + 1) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2];
 
 extern uae_u8 *real_bplpt[8];
 
index fdd5daf195907ef28f6bb7588ba58bbe421e43a2..d37fc91488019dadf18d612252be57d49aebdf0b 100755 (executable)
@@ -67,4 +67,7 @@ struct uae_filter
 extern struct uae_filter uaefilters[];
 extern struct uae_filter *usedfilter;
 
+uae_u8 *getfilterrect1 (RECT *sr, RECT *dr, int dst_depth, int aw, int ah, int scale, int temp_width, int temp_height, uae_u8 *dptr, int pitch);
+void getfilterrect2 (RECT *sr, RECT *dr, int dst_width, int dst_height, int aw, int ah, int scale, int temp_width, int temp_height);
+
 #endif
index bf6a559764beeefddba47e25e77636988b9273f7..14195514176bc99c30728ac8410e2485255ec696 100755 (executable)
@@ -28,7 +28,9 @@ ENUMDECL {
     i_PACK, i_UNPK, i_TAS, i_BKPT, i_CALLM, i_RTM, i_TRAPcc, i_MOVES,
     i_FPP, i_FDBcc, i_FScc, i_FTRAPcc, i_FBcc, i_FSAVE, i_FRESTORE,
     i_CINVL, i_CINVP, i_CINVA, i_CPUSHL, i_CPUSHP, i_CPUSHA, i_MOVE16,
-    i_MMUOP30A, i_MMUOP30B, i_MMUOP
+    i_MMUOP030, i_PFLUSHN, i_PFLUSH, i_PFLUSHAN, i_PFLUSHA,
+    i_PLPAR, i_PLPAW, i_PTESTR, i_PTESTW,
+    i_LPSTOP
 } ENUMNAME (instrmnem);
 
 extern struct mnemolookup {
index 2b065f56fde1a10d59335f1571f1ca6dcd52327c..fb1c744c34b4b8c8a0a28ebc9ef6d82872d53ade 100755 (executable)
@@ -2843,9 +2843,16 @@ gen_opcode (unsigned long int opcode)
        //}
        break;
 
-     case i_MMUOP:
-     case i_MMUOP30A:
-     case i_MMUOP30B:
+     case i_MMUOP030:
+     case i_PFLUSHN:
+     case i_PFLUSH:
+     case i_PFLUSHAN:
+     case i_PFLUSHA:
+     case i_PLPAR:
+     case i_PLPAW:
+     case i_PTESTR:
+     case i_PTESTW:
+     case i_LPSTOP:
        isjump;
        failure;
        break;
index e602be4da08101ad3430c2c14783934059b83959..c60a751d1d9ce116fa6cb1bbe221bcf4c5e721cc 100755 (executable)
--- a/memory.c
+++ b/memory.c
@@ -39,9 +39,12 @@ int special_mem;
 
 static int canjit (void)
 {
+    return 1;
+#if 0
     if (canbang || currprefs.cpu_model >= 68020)
        return 1;
     return 0;
+#endif
 }
 static void nocanbang(void)
 {
@@ -590,7 +593,7 @@ int decode_cloanto_rom_do (uae_u8 *mem, int size, int real_size)
                t = keysize - 1;
        }
     }
-    return get_keyring();
+    return 0;
 }
 
 static int decode_rekick_rom_do (uae_u8 *mem, int size, int real_size)
@@ -656,10 +659,10 @@ int load_keyring (struct uae_prefs *p, char *path)
     int keyid;
     int cnt, i;
 
-    free_keyring();
+    free_keyring ();
     keyid = 0;
-    keybuf = target_load_keyfile(p, path, &keysize, tmp);
-    addkey(&keyid, keybuf, keysize, tmp);
+    keybuf = target_load_keyfile (p, path, &keysize, tmp);
+    addkey (&keyid, keybuf, keysize, tmp);
     for (i = 0; keyids[i] >= 0 && keyid < ROM_KEY_NUM; i++) {
        struct romdata *rd = getromdatabyid (keyids[i]);
        char *s;
@@ -2826,7 +2829,7 @@ static shmpiece *find_shmpiece (uae_u8 *base)
     while (x && x->native_address != base)
        x = x->next;
     if (!x) {
-       write_log ("NATMEM: Failure to find mapping at %p\n",base);
+       write_log ("NATMEM: Failure to find mapping at %08X, %p\n", base - NATMEM_OFFSET, base);
        dumplist ();
        nocanbang();
        return 0;
@@ -3180,7 +3183,7 @@ void memory_reset (void)
        kickmem_mask = 524288 - 1;
        if (!load_kickstart ()) {
            if (strlen (currprefs.romfile) > 0) {
-               write_log ("%s\n", currprefs.romfile);
+               write_log ("Failed to open '%s'\n", currprefs.romfile);
                notify_user (NUMSG_NOROM);
            }
 #ifdef AUTOCONFIG
index 2f288a79b79c9d6305571bd4148918fdc0751940..cc11589d882cf2b2a1c4d192f6a1bd5c770b1e2a 100755 (executable)
--- a/newcpu.c
+++ b/newcpu.c
@@ -1869,14 +1869,6 @@ void mmu_op (uae_u32 opcode, struct regstruct *regs, uae_u32 extra)
        if (currprefs.cpu_model == 68060) {
 #if MMUOP_DEBUG > 0
            write_log ("PLPA\n");
-#endif
-           return;
-       }
-    } else if (opcode == 0xff00 && extra == 0x01c0) {
-       /* LPSTOP */
-       if (currprefs.cpu_model == 68060) {
-#if MMUOP_DEBUG > 0
-           write_log ("LPSTOP\n");
 #endif
            return;
        }
@@ -2579,15 +2571,40 @@ void m68k_disasm_2 (char *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int c
         default: strcat (instrname, "   "); break;
        }
 
-       if (dp->suse) {
-           newpc = m68k_getpc (&regs) + m68kpc_offset;
-           newpc += ShowEA (0, opcode, dp->sreg, dp->smode, dp->size, instrname, seaddr, safemode);
-       }
-       if (dp->suse && dp->duse)
-           strcat (instrname, ",");
-       if (dp->duse) {
-           newpc = m68k_getpc (&regs) + m68kpc_offset;
-           newpc += ShowEA (0, opcode, dp->dreg, dp->dmode, dp->size, instrname, deaddr, safemode);
+       if (lookup->mnemo == i_MOVEC2 || lookup->mnemo == i_MOVE2C) {
+           uae_u16 imm = get_iword_1 (m68kpc_offset) & 0xffff;
+           uae_u16 creg = imm & 0x0fff;
+           uae_u16 r = imm >> 12;
+           char regs[16], *cname = "?";
+           int i;
+           for (i = 0; m2cregs[i].regname; i++) {
+               if (m2cregs[i].regno == creg)
+                   break;
+           }
+           sprintf (regs, "%c%d", r >= 8 ? 'A' : 'D', r >= 8 ? r - 8 : r);
+           if (m2cregs[i].regname)
+               cname = m2cregs[i].regname;
+           if (lookup->mnemo == i_MOVE2C) {
+               strcat (instrname, regs);
+               strcat (instrname, ",");
+               strcat (instrname, cname);
+           } else {
+               strcat (instrname, cname);
+               strcat (instrname, ",");
+               strcat (instrname, regs);
+           }
+           m68kpc_offset += 2;
+       } else {
+           if (dp->suse) {
+               newpc = m68k_getpc (&regs) + m68kpc_offset;
+               newpc += ShowEA (0, opcode, dp->sreg, dp->smode, dp->size, instrname, seaddr, safemode);
+           }
+           if (dp->suse && dp->duse)
+               strcat (instrname, ",");
+           if (dp->duse) {
+               newpc = m68k_getpc (&regs) + m68kpc_offset;
+               newpc += ShowEA (0, opcode, dp->dreg, dp->dmode, dp->size, instrname, deaddr, safemode);
+           }
        }
 
        for (i = 0; i < (m68kpc_offset - oldpc) / 2; i++) {
@@ -2595,9 +2612,6 @@ void m68k_disasm_2 (char *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int c
        }
        while (i++ < 5)
            buf = buf_out (buf, &bufsize, "     ");
-    if (strlen (instrname) > 79) {
-       int i = 0;
-    }
 
        buf = buf_out (buf, &bufsize, instrname);
 
index 9754a09688738d6b6a4d7253b704c838746840aa..afe1d034fbb1e49da42ff9896526b299b599e3e3 100755 (executable)
@@ -398,7 +398,7 @@ typedef struct _D3DTLVERTEX {
     float tv;
 } D3DTLVERTEX, *LPD3DTLVERTEX;
 
-static void BlitRect(LPDIRECT3DDEVICE9 dev, LPDIRECT3DTEXTURE9 src,
+static void BlitRect (LPDIRECT3DDEVICE9 dev, LPDIRECT3DTEXTURE9 src,
                     float left, float top, float right, float bottom, D3DCOLOR col,float z)
 {
     int i;
@@ -420,20 +420,20 @@ static void BlitRect(LPDIRECT3DDEVICE9 dev, LPDIRECT3DTEXTURE9 src,
     verts[3].sx = left - 0.5f; verts[3].sy = bottom - 0.5f; verts[3].sz = z;
 
     // set the texture
-    hr = IDirect3DDevice9_SetTexture(dev, 0, (IDirect3DBaseTexture9*)src);
+    hr = IDirect3DDevice9_SetTexture (dev, 0, (IDirect3DBaseTexture9*)src);
     if (FAILED (hr))
        write_log ("IDirect3DDevice9_SetTexture failed: %s\n", D3D_ErrorString (hr));
 
-    hr = IDirect3DDevice9_SetVertexShader(dev, NULL);
+    hr = IDirect3DDevice9_SetVertexShader (dev, NULL);
     if (FAILED (hr))
        write_log ("IDirect3DDevice9_SetVertexShader failed: %s\n", D3D_ErrorString (hr));
     // configure shader for vertex type
-    hr = IDirect3DDevice9_SetFVF(dev, D3DFVF_TLVERTEX);
+    hr = IDirect3DDevice9_SetFVF (dev, D3DFVF_TLVERTEX);
     if (FAILED (hr))
        write_log ("IDirect3DDevice9_SetFVF failed: %s\n", D3D_ErrorString (hr));
 
     // draw the rectangle
-    hr = IDirect3DDevice9_DrawPrimitiveUP(dev, D3DPT_TRIANGLEFAN, 2, verts, sizeof(D3DTLVERTEX));
+    hr = IDirect3DDevice9_DrawPrimitiveUP (dev, D3DPT_TRIANGLEFAN, 2, verts, sizeof(D3DTLVERTEX));
     if (FAILED (hr))
        write_log ("IDirect3DDevice9_DrawPrimitiveUP failed: %s\n", D3D_ErrorString (hr));
 }
@@ -443,69 +443,26 @@ static void BlitRect(LPDIRECT3DDEVICE9 dev, LPDIRECT3DTEXTURE9 src,
     tin_ = internal window size
     twidth/theight = texture size
 */
-#if 0
+#if 1
 static void calc (float *xp, float *yp, float *sxp, float *syp)
 {
-    float x, y, sx, sy, tx, ty;
-    double mx, my, fx, fy, mmx, mmy;
-
-    mmx = 1;
-    mmy = 1;//2.0 * window_h / tin_h;
-
-    fx = tin_w / 2;
-    fy = tin_h / 2;
-
-    fx = (twidth * window_w / tin_w) / 2;
-    fy = (theight * window_h / tin_h) / 2;
-
-    tx = ((currprefs.gfx_filter_horiz_zoom_mult + currprefs.gfx_filter_horiz_zoom / 4) / 1000.0);
-    ty = ((currprefs.gfx_filter_vert_zoom_mult + currprefs.gfx_filter_vert_zoom / 4) / 1000.0);
-
-    *sxp = (fx + fx / tx) * mmx;
-    *syp = (fy + fy / ty) * mmy;
-    *xp = (fx - fx / tx) * mmx;
-    *yp = (fy - fy / ty) * mmy;
-
-    mx = (currprefs.gfx_filter_horiz_offset / 1000.0) * fx;
-    my = (currprefs.gfx_filter_vert_offset / 1000.0) * fy;
-
-    *xp += mx;
-    *sxp += mx;
-    *yp += my;
-    *syp += my;
-
-    return;
-
-
-    fx = (twidth * window_w / tin_w) / 2;
-    fy = (theight * window_h / tin_h) / 2;
-
-    tx = fx / ((currprefs.gfx_filter_horiz_zoom_mult + currprefs.gfx_filter_horiz_zoom / 4) / 1000.0);
-    ty = fy / ((currprefs.gfx_filter_vert_zoom_mult + currprefs.gfx_filter_vert_zoom / 4) / 1000.0);
-
-    if (currprefs.gfx_lores)
-       tx /= 2;
-    if (!currprefs.gfx_linedbl)
-       ty /= 2;
-
-    mx = (currprefs.gfx_filter_horiz_offset / 1000.0) * fx;
-    my = (currprefs.gfx_filter_vert_offset / 1000.0) * fy;
-
-    x = -tx;
-    y = -ty;
-    sx = tx;
-    sy = ty;
-
-    x += fx + mx;
-    y += fy + my;
-    sx += tx + mx;
-    sy += ty + my;
-
-    *xp = x; *yp = y;
-    *sxp = sx; *syp = sy;
+    RECT sr, dr;
+    float mx = (float)twidth / tin_w;
+    float my = (float)theight / tin_h;
+    int aw = twidth * window_w / tin_w;
+    int ah = theight * window_h / tin_h;
+
+    mx = 1 / mx;
+    my = 1 / my;
+
+    getfilterrect2 (&sr, &dr, window_w, window_h, tin_w, tin_h, 1, tin_w, tin_h);
+    OffsetRect (&dr, aw / 2, ah / 2);
+    *xp = dr.left;
+    *yp = dr.top;
+    *sxp = *xp + (dr.right - dr.left) * mx;
+    *syp = *yp + (dr.bottom - dr.top) * my;
 }
-#endif
-#if 1
+#else
 static void calc (float *xp, float *yp, float *sxp, float *syp)
 {
     int xm, ym;
@@ -566,18 +523,18 @@ int D3D_locktexture (void)
     D3DLOCKED_RECT locked;
     HRESULT hr;
 
-    hr = IDirect3DDevice9_TestCooperativeLevel(d3ddev);
+    hr = IDirect3DDevice9_TestCooperativeLevel (d3ddev);
     if (FAILED (hr))
        return 0;
 
-    IDirect3DDevice9_Clear(d3ddev, 0L, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0L );
+    IDirect3DDevice9_Clear (d3ddev, 0L, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0L );
 
-    hr = IDirect3DDevice9_BeginScene(d3ddev);
+    hr = IDirect3DDevice9_BeginScene (d3ddev);
     if (FAILED (hr)) {
        write_log ("IDirect3DDevice9_BeginScene failed: %s\n", D3D_ErrorString (hr));
        return 0;
     }
-    hr = IDirect3DTexture9_LockRect(texture, 0, &locked, NULL, D3DLOCK_DISCARD | D3DLOCK_NOSYSLOCK);
+    hr = IDirect3DTexture9_LockRect (texture, 0, &locked, NULL, D3DLOCK_DISCARD | D3DLOCK_NOSYSLOCK);
     if (FAILED (hr)) {
        write_log ("IDirect3DTexture9_LockRect failed: %s\n", D3D_ErrorString (hr));
        D3D_unlocktexture ();
@@ -596,17 +553,17 @@ void D3D_render (void)
 
     if (!d3d_enabled)
        return;
-    if (FAILED(IDirect3DDevice9_TestCooperativeLevel(d3ddev)))
+    if (FAILED (IDirect3DDevice9_TestCooperativeLevel (d3ddev)))
        return;
-    IDirect3DDevice9_Clear(d3ddev, 0L, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0L );
-    hr = IDirect3DDevice9_BeginScene(d3ddev);
+    IDirect3DDevice9_Clear (d3ddev, 0L, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0L );
+    hr = IDirect3DDevice9_BeginScene (d3ddev);
     if (FAILED (hr))
        return;
     calc (&x, &y, &sx, &sy);
-    BlitRect(d3ddev, texture, x, y, sx, sy, 0xffffff, 0.1f);
+    BlitRect (d3ddev, texture, x, y, sx, sy, 0xffffff, 0.1f);
     if (scanlines_ok)
        BlitRect (d3ddev, sltexture, 0, 0, required_sl_texture_w, required_sl_texture_h, 0xffffff, 0.2f);
-    IDirect3DDevice9_EndScene(d3ddev);
+    IDirect3DDevice9_EndScene (d3ddev);
     IDirect3DDevice9_Present (d3ddev, 0, 0, 0 ,0);
 }
 
index ffb60757c0c4f84d3bd1440c7faad941bad389fe..dd04ed659894c0c9f9b262d946f4a2417cd94864 100755 (executable)
@@ -55,9 +55,9 @@ void DirectDraw_Release (void)
     dxdata.ddinit = 0;
     freemainsurface ();
     if (dxdata.fsmodeset)
-       IDirectDraw7_RestoreDisplayMode(dxdata.maindd);
+       IDirectDraw7_RestoreDisplayMode (dxdata.maindd);
     dxdata.fsmodeset = 0;
-    IDirectDraw7_SetCooperativeLevel(dxdata.maindd, dxdata.hwnd, DDSCL_NORMAL);
+    IDirectDraw7_SetCooperativeLevel (dxdata.maindd, dxdata.hwnd, DDSCL_NORMAL);
     releaser (dxdata.dclip, IDirectDrawClipper_Release);
     releaser (dxdata.maindd, IDirectDraw_Release);
     memset (&dxdata, 0, sizeof (dxdata));
@@ -97,9 +97,10 @@ int DirectDraw_Start (GUID *guid)
        IDirect3D9_GetDeviceCaps (d3d, 0, D3DDEVTYPE_HAL, &d3dCaps);
        dxdata.maxwidth = d3dCaps.MaxTextureWidth;
        dxdata.maxheight = d3dCaps.MaxTextureHeight;
+       write_log ("Max hardware surface size: %dx%d\n", dxdata.maxwidth, dxdata.maxheight);
     }
 
-    if (SUCCEEDED(DirectDraw_GetDisplayMode ())) {
+    if (SUCCEEDED (DirectDraw_GetDisplayMode ())) {
        dxdata.ddinit = 1;
        dxdata.ddzeroguid = 1;
        if (guid) {
@@ -138,7 +139,7 @@ static void clearsurf (LPDIRECTDRAWSURFACE7 surf)
     memset(&ddbltfx, 0, sizeof (ddbltfx));
     ddbltfx.dwFillColor = 0;
     ddbltfx.dwSize = sizeof (ddbltfx);
-    while (FAILED(ddrval = IDirectDrawSurface7_Blt (surf, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx))) {
+    while (FAILED (ddrval = IDirectDrawSurface7_Blt (surf, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx))) {
        if (ddrval == DDERR_SURFACELOST) {
            ddrval = restoresurface (dxdata.primary);
            if (FAILED (ddrval))
@@ -161,10 +162,10 @@ int locksurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc)
 {
     HRESULT ddrval;
     desc->dwSize = sizeof (*desc);
-    while (FAILED(ddrval = IDirectDrawSurface7_Lock (surf, NULL, desc, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL))) {
+    while (FAILED (ddrval = IDirectDrawSurface7_Lock (surf, NULL, desc, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL))) {
        if (ddrval == DDERR_SURFACELOST) {
            ddrval = restoresurface (surf);
-           if (FAILED(ddrval))
+           if (FAILED (ddrval))
                return 0;
        } else if (ddrval != DDERR_SURFACEBUSY) {
            write_log ("locksurface: %s\n", DXError (ddrval));
@@ -286,7 +287,7 @@ HRESULT DirectDraw_SetDisplayMode(int width, int height, int bits, int freq)
     if (dxdata.fsmodeset && dxdata.width == width && dxdata.height == height &&
        dxdata.depth == bits && dxdata.freq == freq)
        return DD_OK;
-    ddrval = IDirectDraw7_SetDisplayMode(dxdata.maindd, width, height, bits, freq, 0);
+    ddrval = IDirectDraw7_SetDisplayMode (dxdata.maindd, width, height, bits, freq, 0);
     if (FAILED (ddrval)) {
        write_log ("IDirectDraw7_SetDisplayMode: %s\n", DXError (ddrval));
     } else {
@@ -328,7 +329,7 @@ HRESULT DirectDraw_SetClipper(HWND hWnd)
     ddrval = IDirectDrawSurface7_SetClipper (dxdata.primary, hWnd ? dxdata.dclip : NULL);
     if (FAILED (ddrval))
        write_log ("IDirectDrawSurface7_SetClipper: %s\n", DXError (ddrval));
-    if(hWnd && SUCCEEDED(ddrval)) {
+    if(hWnd && SUCCEEDED (ddrval)) {
        ddrval = IDirectDrawClipper_SetHWnd (dxdata.dclip, 0, hWnd);
        if (FAILED (ddrval))
            write_log ("IDirectDrawClipper_SetHWnd: %s\n", DXError (ddrval));
@@ -342,7 +343,7 @@ char *outGUID (const GUID *guid)
     static char gb[64];
     if (guid == NULL)
        return "NULL";
-    sprintf(gb, "%08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X",
+    sprintf (gb, "%08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X",
        guid->Data1, guid->Data2, guid->Data3,
        guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
        guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
@@ -352,7 +353,7 @@ char *outGUID (const GUID *guid)
 const char *DXError (HRESULT ddrval)
 {
     static char dderr[1000];
-    sprintf(dderr, "%08.8X S=%d F=%04.4X C=%04.4X (%d) (%s)",
+    sprintf (dderr, "%08.8X S=%d F=%04.4X C=%04.4X (%d) (%s)",
        ddrval, (ddrval & 0x80000000) ? 1 : 0,
        HRESULT_FACILITY(ddrval),
        HRESULT_CODE(ddrval),
@@ -371,7 +372,7 @@ RGBFTYPE DirectDraw_GetSurfacePixelFormat(LPDDSURFACEDESC2 surface)
     surf_flags = surface->dwFlags;
     pfp = &surface->ddpfPixelFormat;
 
-    if((surf_flags & DDSD_PIXELFORMAT) == 0x0)
+    if ((surf_flags & DDSD_PIXELFORMAT) == 0x0)
        return RGBFB_NONE;
 
     if ((pfp->dwFlags & DDPF_RGB) == 0)
@@ -422,14 +423,14 @@ RGBFTYPE DirectDraw_GetSurfacePixelFormat(LPDDSURFACEDESC2 surface)
     return RGBFB_NONE;
 }
 
-HRESULT DirectDraw_EnumDisplayModes(DWORD flags, LPDDENUMMODESCALLBACK2 callback)
+HRESULT DirectDraw_EnumDisplayModes (DWORD flags, LPDDENUMMODESCALLBACK2 callback)
 {
     HRESULT result;
-    result = IDirectDraw7_EnumDisplayModes(dxdata.maindd, flags, NULL, NULL, callback);
+    result = IDirectDraw7_EnumDisplayModes (dxdata.maindd, flags, NULL, NULL, callback);
     return result;
 }
 
-HRESULT DirectDraw_EnumDisplays(LPDDENUMCALLBACKEX callback)
+HRESULT DirectDraw_EnumDisplays (LPDDENUMCALLBACKEX callback)
 {
     HRESULT result;
     result = DirectDrawEnumerateEx (callback, 0, DDENUM_DETACHEDSECONDARYDEVICES | DDENUM_ATTACHEDSECONDARYDEVICES);
@@ -522,7 +523,7 @@ HRESULT DirectDraw_ReleaseDC(HDC hdc)
 int DirectDraw_GetVerticalBlankStatus (void)
 {
     BOOL status;
-    if (FAILED(IDirectDraw7_GetVerticalBlankStatus (dxdata.maindd, &status)))
+    if (FAILED (IDirectDraw7_GetVerticalBlankStatus (dxdata.maindd, &status)))
        return -1;
     return status;
 }
@@ -538,6 +539,8 @@ DWORD DirectDraw_CurrentRefreshRate (void)
 
 HRESULT DirectDraw_FlipToGDISurface (void)
 {
+    if (!dxdata.ddinit)
+       return DD_OK;
     return IDirectDraw7_FlipToGDISurface (dxdata.maindd);
 }
 
@@ -552,7 +555,7 @@ int DirectDraw_BlitToPrimaryScale (RECT *rect)
     dst = dxdata.primary;
     SetRect (&dstrect, x, y, x + w, y + h);
     centerdstrect (&dstrect);
-    while (FAILED(ddrval = IDirectDrawSurface7_Blt (dst, &dstrect, dxdata.secondary, rect, DDBLT_WAIT, NULL))) {
+    while (FAILED (ddrval = IDirectDrawSurface7_Blt (dst, &dstrect, dxdata.secondary, rect, DDBLT_WAIT, NULL))) {
        if (ddrval == DDERR_SURFACELOST) {
            ddrval = restoresurface (dst);
            if (FAILED (ddrval))
@@ -650,7 +653,7 @@ void DirectDraw_Fill (RECT *rect, uae_u32 color)
     ddbltfx.dwFillColor = color;
     ddbltfx.dwSize = sizeof (ddbltfx);
     dst = getlocksurface ();
-    while (FAILED(ddrval = IDirectDrawSurface7_Blt (dst, rect, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx))) {
+    while (FAILED (ddrval = IDirectDrawSurface7_Blt (dst, rect, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx))) {
        if (ddrval == DDERR_SURFACELOST) {
            ddrval = restoresurface (dst);
            if (FAILED (ddrval))
index 539e5229f7e900b19c2bd940afc6bff6e762e85f..6057853d9159173bb2a4be5c4783cce56454adf0 100755 (executable)
@@ -46,6 +46,8 @@
 
 #if defined(PICASSO96)
 
+#define NOBLITTER 0
+
 static int hwsprite;
 
 #include "registry.h"
@@ -79,6 +81,7 @@ static void flushpixels(void);
 #define P96TRACE(x)
 #define P96TRACE_SPR(x)
 #endif
+#define P96TRACE2(x) do { write_log x; } while(0)
 
 static void REGPARAM2 gfxmem_lputx (uaecptr, uae_u32) REGPARAM;
 static void REGPARAM2 gfxmem_wputx (uaecptr, uae_u32) REGPARAM;
@@ -868,16 +871,15 @@ void picasso_refresh (void)
 /*
 * Functions to perform an action on the frame-buffer
 */
-STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri, struct
+static int do_blitrect_frame_buffer (struct RenderInfo *ri, struct
     RenderInfo *dstri, unsigned long srcx, unsigned long srcy,
     unsigned long dstx, unsigned long dsty, unsigned long width, unsigned
     long height, uae_u8 mask, BLIT_OPCODE opcode)
 {
-    uae_u8 *src, *dst, *tmp, *tmp2, *tmp3;
+    uae_u8 *src, *dst;
     uae_u8 Bpp = GetBytesPerPixel (ri->RGBFormat);
     unsigned long total_width = width * Bpp;
     unsigned long linewidth = (total_width + 15) & ~15;
-    unsigned long lines;
 
     src = ri->Memory + srcx * Bpp + srcy * ri->BytesPerRow;
     dst = dstri->Memory + dstx * Bpp + dsty * dstri->BytesPerRow;
@@ -905,7 +907,7 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri, struct
                for (i = 0; i < height; i++, src -= ri->BytesPerRow, dst -= dstri->BytesPerRow)
                    memcpy (dst, src, total_width);
            }
-           return;
+           return 1;
 
        } else if (Bpp == 4) {
 
@@ -974,28 +976,9 @@ STATIC_INLINE void do_blitrect_frame_buffer (struct RenderInfo *ri, struct
            }
 
        }
-       return;
-    }
-
-    tmp3 = tmp2 = tmp = xmalloc (linewidth * height); /* allocate enough memory for the src-rect */
-    if (!tmp)
-       return;
-
-    /* copy the src-rect into our temporary buffer space */
-    for (lines = 0; lines < height; lines++, src += ri->BytesPerRow, tmp2 += linewidth) {
-       memcpy (tmp2, src, total_width);
-    }
-
-    /* copy the temporary buffer to the destination */
-    for (lines = 0; lines < height; lines++, dst += dstri->BytesPerRow, tmp += linewidth) {
-       unsigned long cols;
-       for (cols = 0; cols < width; cols++) {
-           dst[cols] &= ~mask;
-           dst[cols] |= tmp[cols] & mask;
-       }
+       return 1;
     }
-    /* free the temp-buf */
-    free (tmp3);
+    return 0;
 }
 
 /*
@@ -2126,6 +2109,8 @@ uae_u32 REGPARAM2 picasso_InvertRect (struct regstruct *regs)
     unsigned long width_in_bytes;
     uae_u32 result = 0;
 
+    if (NOBLITTER)
+       return 0;
     if (CopyRenderInfoStructureA2U (renderinfo, &ri)) {
        P96TRACE(("InvertRect %dbpp 0x%lx\n", Bpp, (long)mask));
 
@@ -2174,6 +2159,8 @@ uae_u32 REGPARAM2 picasso_FillRect (struct regstruct *regs)
     struct RenderInfo ri;
     uae_u32 result = 0;
 
+    if (NOBLITTER)
+       return 0;
     if (CopyRenderInfoStructureA2U (renderinfo, &ri) && Y != 0xFFFF) {
        if (ri.RGBFormat != RGBFormat)
            write_log ("Weird Stuff!\n");
@@ -2294,8 +2281,7 @@ STATIC_INLINE int BlitRectHelper (void)
        dstri = ri;
     }
     /* Do our virtual frame-buffer memory first */
-    do_blitrect_frame_buffer (ri, dstri, srcx, srcy, dstx, dsty, width, height, mask, opcode);
-    return 1;
+    return do_blitrect_frame_buffer (ri, dstri, srcx, srcy, dstx, dsty, width, height, mask, opcode);
 }
 
 STATIC_INLINE int BlitRect (uaecptr ri, uaecptr dstri,
@@ -2349,6 +2335,8 @@ uae_u32 REGPARAM2 picasso_BlitRect (struct regstruct *regs)
     uae_u8  Mask = (uae_u8)m68k_dreg (regs, 6);
     uae_u32 result = 0;
 
+    if (NOBLITTER)
+       return 0;
     P96TRACE(("BlitRect(%d, %d, %d, %d, %d, %d, 0x%x)\n", srcx, srcy, dstx, dsty, width, height, Mask));
     result = BlitRect (renderinfo, (uaecptr)NULL, srcx, srcy, dstx, dsty, width, height, Mask, BLIT_SRC);
     return result;
@@ -2386,6 +2374,8 @@ uae_u32 REGPARAM2 picasso_BlitRectNoMaskComplete (struct regstruct *regs)
     uae_u32 RGBFmt = m68k_dreg (regs, 7);
     uae_u32 result = 0;
 
+    if (NOBLITTER)
+       return 0;
     {
        uaecptr a5 = m68k_areg (regs, 5) & ~0xffff;
        if (a5 != RTAREA_DEFAULT && a5 != RTAREA_BACKUP) {
@@ -2469,6 +2459,8 @@ uae_u32 REGPARAM2 picasso_BlitPattern (struct regstruct *regs)
     unsigned long ysize_mask;
     uae_u32 result = 0;
 
+    if (NOBLITTER)
+       return 0;
     if(CopyRenderInfoStructureA2U (rinf, &ri) && CopyPatternStructureA2U (pinf, &pattern)) {
        Bpp = GetBytesPerPixel(ri.RGBFormat);
        uae_mem = ri.Memory + Y * ri.BytesPerRow + X * Bpp; /* offset with address */
@@ -2626,6 +2618,8 @@ uae_u32 REGPARAM2 picasso_BlitTemplate (struct regstruct *regs)
     uae_u8 *tmpl_base;
     uae_u32 result = 0;
 
+    if (NOBLITTER)
+       return 0;
     if (CopyRenderInfoStructureA2U (rinf, &ri) && CopyTemplateStructureA2U (tmpl, &tmp)) {
        Bpp = GetBytesPerPixel(ri.RGBFormat);
        uae_mem = ri.Memory + Y * ri.BytesPerRow + X * Bpp; /* offset into address */
@@ -2931,6 +2925,8 @@ uae_u32 REGPARAM2 picasso_BlitPlanar2Chunky (struct regstruct *regs)
     struct BitMap local_bm;
     uae_u32 result = 0;
 
+    if (NOBLITTER)
+       return 0;
     if (minterm != 0x0C) {
        write_log ("ERROR - BlitPlanar2Chunky() has minterm 0x%x, which I don't handle. Using fall-back routine.\n",
            minterm);
@@ -3070,6 +3066,8 @@ uae_u32 REGPARAM2 picasso_BlitPlanar2Direct (struct regstruct *regs)
     struct ColorIndexMapping local_cim;
     uae_u32 result = 0;
 
+    if (NOBLITTER)
+       return 0;
     if (minterm != 0x0C) {
        write_log ("WARNING - BlitPlanar2Direct() has unhandled op-code 0x%x. Using fall-back routine.\n",
            minterm);
index c14cffac867d931209ca31d782745c27f6ad6c45..2465f496fc970cf5a3f8f4004ff61bd8f6157d2a 100755 (executable)
@@ -15,9 +15,9 @@
 #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
 #define GETBDD(x) ((x) % 100)
 
-#define WINUAEBETA 8
+#define WINUAEBETA 9
 #define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2008, 3, 14)
+#define WINUAEDATE MAKEBD(2008, 3, 18)
 #define WINUAEEXTRA ""
 #define WINUAEREV ""
 
index 9cbc5c316134858e52a9992fb059fac5835b0b02..df9f182386fe51e73254d96a22ad49567f628506 100755 (executable)
@@ -38,6 +38,61 @@ struct uae_filter uaefilters[] =
 };
 
 
+uae_u8 *getfilterrect1 (RECT *sr, RECT *dr, int dst_depth, int aw, int ah, int scale, int temp_width, int temp_height, uae_u8 *dptr, int pitch)
+{
+    int aws = aw * scale;
+    int ahs = ah * scale;
+    
+    SetRect (sr, 0, 0, 0, 0);
+    dr->left = sr->left + (temp_width - aws) /2;
+    dr->top = sr->top + (temp_height - ahs) / 2;
+    dptr += dr->left * (dst_depth / 8);
+    dptr += dr->top * pitch;
+    return dptr;
+}
+
+void getfilterrect2 (RECT *sr, RECT *dr, int dst_width, int dst_height, int aw, int ah, int scale, int temp_width, int temp_height)
+{
+    int aws = aw * scale;
+    int ahs = ah * scale;
+    int xs, ys;
+    int xmult, ymult;
+    int v;
+
+    SetRect (sr, 0, 0, dst_width, dst_height);
+    dr->left = (temp_width - aws) /2;
+    dr->top =  (temp_height - ahs) / 2;
+    dr->left -= (dst_width - aws) / 2;
+    dr->top -= (dst_height - ahs) / 2;
+    dr->right = dr->left + dst_width;
+    dr->bottom = dr->top + dst_height;
+
+    v = currprefs.gfx_filter ? currprefs.gfx_filter_horiz_offset : 0;
+    OffsetRect (dr, (int)(-v * aws / 1000.0), 0);
+    v = currprefs.gfx_filter ? currprefs.gfx_filter_vert_offset : 0;
+    OffsetRect (dr, 0, (int)(-v * ahs / 1000.0));
+
+    xmult = currprefs.gfx_filter_horiz_zoom_mult;
+    if (xmult <= 0)
+        xmult = aws * 1000 / dst_width;
+    else
+        xmult = xmult + xmult * currprefs.gfx_filter_horiz_zoom / 2000;
+
+    ymult = currprefs.gfx_filter_vert_zoom_mult;
+    if (ymult <= 0)
+        ymult = ahs * 1000 / dst_height;
+    else
+        ymult = ymult + ymult * currprefs.gfx_filter_vert_zoom / 2000;
+    
+    xs = dst_width - dst_width * xmult / 1000;
+    dr->left += xs / 2;
+    dr->right -= xs / 2;
+
+    ys = dst_height - dst_height * ymult / 1000;
+    dr->top += ys / 2;
+    dr->bottom -= ys / 2;
+}
+
 static int dst_width, dst_height, amiga_width, amiga_height, amiga_depth, dst_depth, scale;
 static int temp_width, temp_height;
 uae_u8 *bufmem_ptr;
@@ -130,7 +185,7 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd)
        temp_height = dxdata.maxheight;
     tempsurf = allocsurface (temp_width, temp_height);
     if (!tempsurf)
-       write_log ("DDRAW: failed to create temp surface\n");
+       write_log ("DDRAW: failed to create temp surface (%dx%d)\n", temp_width, temp_height);
 
     if (usedfilter->type == UAE_FILTER_HQ) {
        int w = amiga_width > dst_width ? amiga_width : dst_width;
@@ -142,11 +197,12 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd)
 
 void S2X_render (void)
 {
-    int aw, ah, aws, ahs, pitch;
+    int aw, ah, aws, ahs;
     uae_u8 *dptr, *enddptr, *sptr, *endsptr;
     int ok = 0;
     RECT sr, dr;
     DDSURFACEDESC2 desc;
+    DWORD pitch;
 
     aw = amiga_width;
     ah = amiga_height;
@@ -160,22 +216,16 @@ void S2X_render (void)
     if (tempsurf == NULL)
        return;
 
-    sr.left = -(aw - amiga_width) / 2;
-    sr.top = -(ah - amiga_height) / 2;
-    sptr = gfxvidinfo.bufmem + sr.left * gfxvidinfo.pixbytes + sr.top * gfxvidinfo.rowbytes;
+    sptr = gfxvidinfo.bufmem;
     endsptr = gfxvidinfo.bufmemend;
     bufmem_ptr = sptr;
 
     if (!locksurface (tempsurf, &desc))
        return;
-    dptr = (uae_u8*)desc.lpSurface;
     pitch = desc.lPitch;
+    dptr = (uae_u8*)desc.lpSurface;
     enddptr = dptr + pitch * temp_height;
-
-    dr.left = sr.left + (temp_width - aws) /2;
-    dr.top = sr.top + (temp_height - ahs) / 2;
-    dptr += dr.left * (dst_depth / 8);
-    dptr += dr.top * pitch;
+    dptr = getfilterrect1 (&sr, &dr, dst_depth, aw, ah, scale, temp_width, temp_height, dptr, pitch);
 
     if (!dptr) /* weird things can happen */
        goto end;
@@ -281,50 +331,12 @@ void S2X_render (void)
 end:
     unlocksurface (tempsurf);
 
-    {
-       int xs, ys;
-       int xmult, ymult;
-       int v;
-
-       SetRect (&sr, 0, 0, dst_width, dst_height);
-
-       dr.left -= (dst_width - aws) / 2;
-       dr.top -= (dst_height - ahs) / 2;
-       dr.right = dr.left + dst_width;
-       dr.bottom = dr.top + dst_height;
-
-       v = currprefs.gfx_filter ? currprefs.gfx_filter_horiz_offset : 0;
-       OffsetRect (&dr, (int)(-v * aws / 1000.0), 0);
-       v = currprefs.gfx_filter ? currprefs.gfx_filter_vert_offset : 0;
-       OffsetRect (&dr, 0, (int)(-v * ahs / 1000.0));
-
-       xmult = currprefs.gfx_filter_horiz_zoom_mult;
-       if (xmult <= 0)
-           xmult = aws * 1000 / dst_width;
-       else
-           xmult = xmult + xmult * currprefs.gfx_filter_horiz_zoom / 2000;
-
-       ymult = currprefs.gfx_filter_vert_zoom_mult;
-       if (ymult <= 0)
-           ymult = ahs * 1000 / dst_height;
-       else
-           ymult = ymult + ymult * currprefs.gfx_filter_vert_zoom / 2000;
-
-       xs = dst_width - dst_width * xmult / 1000;
-
-       dr.left += xs / 2;
-       dr.right -= xs / 2;
-
-       ys = dst_height - dst_height * ymult / 1000;
-       dr.top += ys / 2;
-       dr.bottom -= ys / 2;
-
-       if (dr.left >= 0 && dr.top >= 0 && dr.right < temp_width && dr.bottom < temp_height) {
-           if (dr.left < dr.right && dr.top < dr.bottom)
-               DirectDraw_BlitRect (NULL, &sr, tempsurf, &dr);
-       }
-       statusline ();
+    getfilterrect2 (&sr, &dr, dst_width, dst_height, amiga_width, amiga_height, scale, temp_width, temp_height);
+    if (dr.left >= 0 && dr.top >= 0 && dr.right < temp_width && dr.bottom < temp_height) {
+        if (dr.left < dr.right && dr.top < dr.bottom)
+           DirectDraw_BlitRect (NULL, &sr, tempsurf, &dr);
     }
+    statusline ();
 }
 
 void S2X_refresh (void)
index 58e7839a222ed5fafee158bfe22994743b304994..4dd4949b4885e529442ecc978c45899270d041d4 100755 (executable)
@@ -167,7 +167,7 @@ uae_u32 default_freq = 0;
 HWND hStatusWnd = NULL;
 uae_u16 picasso96_pixel_format = RGBFF_CHUNKY;
 
-static char scrlinebuf[4096 * 4]; /* this is too large, but let's rather play on the safe side here */
+static uae_u8 scrlinebuf[4096 * 4]; /* this is too large, but let's rather play on the safe side here */
 
 
 void centerdstrect (RECT *dr)
@@ -1871,6 +1871,11 @@ static BOOL doInit (void)
 #endif
 #endif
     screen_is_initialized = 1;
+    WIN32GFX_SetPalette ();
+#ifdef PICASSO96
+    DX_SetPalette (0, 256);
+#endif
+    picasso_refresh ();
     return 1;
 
 oops:
index c640ce6fd1323a38378be21c8398eeb34656649e..46df619bdb4fe147717abbb41c6a0eeab6ac560a 100755 (executable)
@@ -1146,7 +1146,7 @@ void gui_display (int shortcut)
     scaleresource_setmaxsize (-1, -1);
     if (w > 0 && h > 0)
        scaleresource_setmaxsize (w, h);
-    WIN32GFX_ClearPalette();
+    WIN32GFX_ClearPalette ();
     manual_painting_needed++; /* So that WM_PAINT will refresh the display */
 
     if (isfullscreen () > 0) {
@@ -1172,7 +1172,7 @@ void gui_display (int shortcut)
     }
     manual_painting_needed--; /* So that WM_PAINT doesn't need to use custom refreshing */
     manual_palette_refresh_needed = 1;
-    resumepaused();
+    resumepaused ();
     inputdevice_copyconfig (&changed_prefs, &currprefs);
     inputdevice_config_change_test ();
     clearallkeys ();
@@ -1185,12 +1185,12 @@ void gui_display (int shortcut)
     AVIOutput_Begin ();
 #endif
     fpscounter_reset ();
-    WIN32GFX_SetPalette();
+    WIN32GFX_SetPalette ();
 #ifdef PICASSO96
     DX_SetPalette (0, 256);
 #endif
-    screenshot_free();
-    write_disk_history();
+    screenshot_free ();
+    write_disk_history ();
     gui_active--;
     here--;
 }
@@ -1325,103 +1325,103 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
 
     switch (flag) {
     case 0:
-       WIN32GUI_LoadUIString(IDS_SELECTADF, szTitle, MAX_DPATH);
-       WIN32GUI_LoadUIString(IDS_ADF, szFormat, MAX_DPATH);
-       sprintf(szFilter, "%s ", szFormat);
-       memcpy(szFilter + strlen(szFilter), DISK_FORMAT_STRING, sizeof(DISK_FORMAT_STRING) + 1);
+       WIN32GUI_LoadUIString (IDS_SELECTADF, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_ADF, szFormat, MAX_DPATH);
+       sprintf (szFilter, "%s ", szFormat);
+       memcpy (szFilter + strlen (szFilter), DISK_FORMAT_STRING, sizeof (DISK_FORMAT_STRING) + 1);
 
        openFileName.lpstrDefExt = "ADF";
        openFileName.lpstrFilter = szFilter;
        break;
     case 1:
-       WIN32GUI_LoadUIString(IDS_CHOOSEBLANK, szTitle, MAX_DPATH);
-       WIN32GUI_LoadUIString(IDS_ADF, szFormat, MAX_DPATH);
-       sprintf(szFilter, "%s ", szFormat);
-       memcpy(szFilter + strlen(szFilter), "(*.adf)\0*.adf\0", 15);
+       WIN32GUI_LoadUIString (IDS_CHOOSEBLANK, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_ADF, szFormat, MAX_DPATH);
+       sprintf (szFilter, "%s ", szFormat);
+       memcpy (szFilter + strlen (szFilter), "(*.adf)\0*.adf\0", 15);
 
        openFileName.lpstrDefExt = "ADF";
        openFileName.lpstrFilter = szFilter;
        break;
     case 2:
     case 3:
-       WIN32GUI_LoadUIString(IDS_SELECTHDF, szTitle, MAX_DPATH);
-       WIN32GUI_LoadUIString(IDS_HDF, szFormat, MAX_DPATH);
-       sprintf(szFilter, "%s ", szFormat);
-       memcpy(szFilter + strlen(szFilter),  HDF_FORMAT_STRING, sizeof (HDF_FORMAT_STRING) + 1);
+       WIN32GUI_LoadUIString (IDS_SELECTHDF, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_HDF, szFormat, MAX_DPATH);
+       sprintf (szFilter, "%s ", szFormat);
+       memcpy (szFilter + strlen (szFilter),  HDF_FORMAT_STRING, sizeof (HDF_FORMAT_STRING) + 1);
 
        openFileName.lpstrDefExt = "HDF";
        openFileName.lpstrFilter = szFilter;
        break;
     case 4:
     case 5:
-       WIN32GUI_LoadUIString(IDS_SELECTUAE, szTitle, MAX_DPATH);
-       WIN32GUI_LoadUIString(IDS_UAE, szFormat, MAX_DPATH );
-       sprintf(szFilter, "%s ", szFormat);
-       memcpy(szFilter + strlen(szFilter), "(*.uae)\0*.uae\0", 15);
+       WIN32GUI_LoadUIString (IDS_SELECTUAE, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_UAE, szFormat, MAX_DPATH );
+       sprintf (szFilter, "%s ", szFormat);
+       memcpy (szFilter + strlen (szFilter), "(*.uae)\0*.uae\0", 15);
 
        openFileName.lpstrDefExt = "UAE";
        openFileName.lpstrFilter = szFilter;
        break;
     case 6:
-       WIN32GUI_LoadUIString(IDS_SELECTROM, szTitle, MAX_DPATH);
-       WIN32GUI_LoadUIString(IDS_ROM, szFormat, MAX_DPATH);
-       sprintf(szFilter, "%s ", szFormat);
-       memcpy(szFilter + strlen(szFilter), ROM_FORMAT_STRING, sizeof (ROM_FORMAT_STRING) + 1);
+       WIN32GUI_LoadUIString (IDS_SELECTROM, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_ROM, szFormat, MAX_DPATH);
+       sprintf (szFilter, "%s ", szFormat);
+       memcpy (szFilter + strlen(szFilter), ROM_FORMAT_STRING, sizeof (ROM_FORMAT_STRING) + 1);
 
        openFileName.lpstrDefExt = "ROM";
        openFileName.lpstrFilter = szFilter;
        break;
     case 7:
-       WIN32GUI_LoadUIString(IDS_SELECTKEY, szTitle, MAX_DPATH);
-       WIN32GUI_LoadUIString(IDS_KEY, szFormat, MAX_DPATH);
-       sprintf(szFilter, "%s ", szFormat);
-       memcpy(szFilter + strlen(szFilter), "(*.key)\0*.key\0", 15);
+       WIN32GUI_LoadUIString (IDS_SELECTKEY, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_KEY, szFormat, MAX_DPATH);
+       sprintf (szFilter, "%s ", szFormat);
+       memcpy (szFilter + strlen(szFilter), "(*.key)\0*.key\0", 15);
 
        openFileName.lpstrDefExt = "KEY";
        openFileName.lpstrFilter = szFilter;
        break;
     case 15:
     case 16:
-       WIN32GUI_LoadUIString(flag == 15 ? IDS_RESTOREINP : IDS_SAVEINP, szTitle, MAX_DPATH);
-       WIN32GUI_LoadUIString(IDS_INP, szFormat, MAX_DPATH);
-       sprintf(szFilter, "%s ", szFormat);
-       memcpy(szFilter + strlen(szFilter), INP_FORMAT_STRING, sizeof (INP_FORMAT_STRING) + 1);
+       WIN32GUI_LoadUIString (flag == 15 ? IDS_RESTOREINP : IDS_SAVEINP, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_INP, szFormat, MAX_DPATH);
+       sprintf (szFilter, "%s ", szFormat);
+       memcpy (szFilter + strlen(szFilter), INP_FORMAT_STRING, sizeof (INP_FORMAT_STRING) + 1);
 
        openFileName.lpstrDefExt = "INP";
        openFileName.lpstrFilter = szFilter;
        break;
     case 9:
     case 10:
-       WIN32GUI_LoadUIString(flag == 10 ? IDS_RESTOREUSS : IDS_SAVEUSS, szTitle, MAX_DPATH);
-       WIN32GUI_LoadUIString(IDS_USS, szFormat, MAX_DPATH);
-       sprintf(szFilter, "%s ", szFormat);
+       WIN32GUI_LoadUIString (flag == 10 ? IDS_RESTOREUSS : IDS_SAVEUSS, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_USS, szFormat, MAX_DPATH);
+       sprintf (szFilter, "%s ", szFormat);
        if (flag == 10) {
-           memcpy(szFilter + strlen(szFilter), USS_FORMAT_STRING_RESTORE, sizeof (USS_FORMAT_STRING_RESTORE) + 1);
+           memcpy (szFilter + strlen(szFilter), USS_FORMAT_STRING_RESTORE, sizeof (USS_FORMAT_STRING_RESTORE) + 1);
            all = 1;
        } else {
            char tmp[MAX_DPATH];
-           memcpy(szFilter + strlen(szFilter), USS_FORMAT_STRING_SAVE, sizeof (USS_FORMAT_STRING_SAVE) + 1);
+           memcpy (szFilter + strlen(szFilter), USS_FORMAT_STRING_SAVE, sizeof (USS_FORMAT_STRING_SAVE) + 1);
            p = szFilter;
            while (p[0] != 0 || p[1] !=0 ) p++;
            p++;
-           WIN32GUI_LoadUIString(IDS_STATEFILE_UNCOMPRESSED, tmp, sizeof(tmp));
-           strcat(p, tmp);
-           strcat(p, " (*.uss)");
-           p += strlen(p) + 1;
-           strcpy(p, "*.uss");
-           p += strlen(p) + 1;
-           WIN32GUI_LoadUIString(IDS_STATEFILE_RAMDUMP, tmp, sizeof(tmp));
-           strcat(p, tmp);
-           strcat(p, " (*.dat)");
+           WIN32GUI_LoadUIString (IDS_STATEFILE_UNCOMPRESSED, tmp, sizeof (tmp));
+           strcat (p, tmp);
+           strcat (p, " (*.uss)");
+           p += strlen (p) + 1;
+           strcpy (p, "*.uss");
+           p += strlen (p) + 1;
+           WIN32GUI_LoadUIString (IDS_STATEFILE_RAMDUMP, tmp, sizeof (tmp));
+           strcat (p, tmp);
+           strcat (p, " (*.dat)");
            p += strlen(p) + 1;
            strcpy (p, "*.dat");
-           p += strlen(p) + 1;
-           WIN32GUI_LoadUIString(IDS_STATEFILE_WAVE, tmp, sizeof(tmp));
-           strcat(p, tmp);
-           strcat(p, " (*.wav)");
-           p += strlen(p) + 1;
+           p += strlen (p) + 1;
+           WIN32GUI_LoadUIString (IDS_STATEFILE_WAVE, tmp, sizeof (tmp));
+           strcat (p, tmp);
+           strcat (p, " (*.wav)");
+           p += strlen (p) + 1;
            strcpy (p, "*.wav");
-           p += strlen(p) + 1;
+           p += strlen (p) + 1;
            *p = 0;
            all = 0;
            filterindex = statefile_previousfilter;
@@ -1430,30 +1430,30 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        openFileName.lpstrFilter = szFilter;
        break;
     case 11:
-       WIN32GUI_LoadUIString(IDS_SELECTFLASH, szTitle, MAX_DPATH);
-       WIN32GUI_LoadUIString(IDS_FLASH, szFormat, MAX_DPATH);
-       sprintf(szFilter, "%s ", szFormat);
-       memcpy(szFilter + strlen(szFilter), "(*.nvr)\0*.nvr\0", 15);
+       WIN32GUI_LoadUIString (IDS_SELECTFLASH, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_FLASH, szFormat, MAX_DPATH);
+       sprintf (szFilter, "%s ", szFormat);
+       memcpy (szFilter + strlen (szFilter), "(*.nvr)\0*.nvr\0", 15);
 
        openFileName.lpstrDefExt = "NVR";
        openFileName.lpstrFilter = szFilter;
        break;
     case 8:
     default:
-       WIN32GUI_LoadUIString(IDS_SELECTINFO, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_SELECTINFO, szTitle, MAX_DPATH);
 
        openFileName.lpstrFilter = NULL;
        openFileName.lpstrDefExt = NULL;
        break;
     case 12:
-       WIN32GUI_LoadUIString(IDS_SELECTFS, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_SELECTFS, szTitle, MAX_DPATH);
 
        openFileName.lpstrFilter = NULL;
        openFileName.lpstrDefExt = NULL;
        openFileName.lpstrInitialDir = path_out;
        break;
     case 13:
-       WIN32GUI_LoadUIString(IDS_SELECTINFO, szTitle, MAX_DPATH);
+       WIN32GUI_LoadUIString (IDS_SELECTINFO, szTitle, MAX_DPATH);
 
        openFileName.lpstrFilter = NULL;
        openFileName.lpstrDefExt = NULL;
@@ -1462,7 +1462,7 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
     case 14:
        strcpy (szTitle, "Select supported archive file");
        sprintf (szFilter, "%s (%s)", "Archive", ARCHIVE_STRING);
-       strcpy (szFilter + strlen(szFilter) + 1, ARCHIVE_STRING);
+       strcpy (szFilter + strlen (szFilter) + 1, ARCHIVE_STRING);
 
        openFileName.lpstrFilter = NULL;
        openFileName.lpstrFilter = szFilter;
@@ -8929,8 +8929,8 @@ static void enable_for_hw3ddlg (HWND hDlg)
     CheckDlgButton(hDlg, IDC_FILTERENABLE, v);
     ew (hDlg, IDC_FILTERHZ, v);
     ew (hDlg, IDC_FILTERVZ, v);
-    ew (hDlg, IDC_FILTERHZMULT, vv && !vv4);
-    ew (hDlg, IDC_FILTERVZMULT, vv && !vv4);
+    ew (hDlg, IDC_FILTERHZMULT, v);
+    ew (hDlg, IDC_FILTERVZMULT, v);
     ew (hDlg, IDC_FILTERHO, v);
     ew (hDlg, IDC_FILTERVO, v);
     ew (hDlg, IDC_FILTERSLR, vv3);
@@ -9600,11 +9600,11 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
 
                case IDC_AVIOUTPUT_FRAMELIMITER:
                    avioutput_framelimiter = IsDlgButtonChecked (hDlg, IDC_AVIOUTPUT_FRAMELIMITER) ? 0 : 1;
-                   AVIOutput_SetSettings();
+                   AVIOutput_SetSettings ();
                break;
                case IDC_AVIOUTPUT_NOSOUNDOUTPUT:
                    avioutput_nosoundoutput = IsDlgButtonChecked (hDlg, IDC_AVIOUTPUT_NOSOUNDOUTPUT) ? 1 : 0;
-                   AVIOutput_SetSettings();
+                   AVIOutput_SetSettings ();
                break;
 
                case IDC_INPREC_PLAYMODE:
@@ -9613,13 +9613,13 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
                    if (input_recording)
                        inprec_close ();
                    else
-                       DiskSelection(hDlg, wParam, 16, &workprefs, NULL);
+                       DiskSelection (hDlg, wParam, 16, &workprefs, NULL);
                break;
                case IDC_INPREC_PLAY:
                    if (input_recording)
                        inprec_close ();
                    else
-                       DiskSelection(hDlg, wParam, 15, &workprefs, NULL);
+                       DiskSelection (hDlg, wParam, 15, &workprefs, NULL);
                break;
 
 #ifdef PROWIZARD
@@ -9644,22 +9644,22 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
                break;
 
                case IDC_AVIOUTPUT_PAL:
-                   SendDlgItemMessage(hDlg, IDC_AVIOUTPUT_FPS, TBM_SETPOS, TRUE, VBLANK_HZ_PAL);
-                   SendMessage(hDlg, WM_HSCROLL, (WPARAM) NULL, (LPARAM) NULL);
+                   SendDlgItemMessage (hDlg, IDC_AVIOUTPUT_FPS, TBM_SETPOS, TRUE, VBLANK_HZ_PAL);
+                   SendMessage (hDlg, WM_HSCROLL, (WPARAM) NULL, (LPARAM) NULL);
                break;
 
                case IDC_AVIOUTPUT_NTSC:
-                   SendDlgItemMessage(hDlg, IDC_AVIOUTPUT_FPS, TBM_SETPOS, TRUE, VBLANK_HZ_NTSC);
-                   SendMessage(hDlg, WM_HSCROLL, (WPARAM) NULL, (LPARAM) NULL);
+                   SendDlgItemMessage (hDlg, IDC_AVIOUTPUT_FPS, TBM_SETPOS, TRUE, VBLANK_HZ_NTSC);
+                   SendMessage (hDlg, WM_HSCROLL, (WPARAM) NULL, (LPARAM) NULL);
                break;
 
                case IDC_AVIOUTPUT_AUDIO:
                {
                    if (avioutput_enabled)
                        AVIOutput_End ();
-                   if(IsDlgButtonChecked(hDlg, IDC_AVIOUTPUT_AUDIO) == BST_CHECKED) {
-                       avioutput_audio = AVIOutput_ChooseAudioCodec(hDlg, tmp, sizeof tmp);
-                       enable_for_avioutputdlg(hDlg);
+                   if(IsDlgButtonChecked (hDlg, IDC_AVIOUTPUT_AUDIO) == BST_CHECKED) {
+                       avioutput_audio = AVIOutput_ChooseAudioCodec (hDlg, tmp, sizeof tmp);
+                       enable_for_avioutputdlg (hDlg);
                    } else {
                        avioutput_audio = 0;
                    }
@@ -9670,15 +9670,15 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
                {
                    if (avioutput_enabled)
                        AVIOutput_End ();
-                   if(IsDlgButtonChecked(hDlg, IDC_AVIOUTPUT_VIDEO) == BST_CHECKED) {
-                       avioutput_video = AVIOutput_ChooseVideoCodec(hDlg, tmp, sizeof tmp);
+                   if(IsDlgButtonChecked (hDlg, IDC_AVIOUTPUT_VIDEO) == BST_CHECKED) {
+                       avioutput_video = AVIOutput_ChooseVideoCodec (hDlg, tmp, sizeof tmp);
                        if (avioutput_audio = AVIAUDIO_WAV)
                            avioutput_audio = 0;
-                       enable_for_avioutputdlg(hDlg);
+                       enable_for_avioutputdlg (hDlg);
                    } else {
                        avioutput_video = 0;
                    }
-                   enable_for_avioutputdlg(hDlg);
+                   enable_for_avioutputdlg (hDlg);
                    break;
                }
 
@@ -9686,8 +9686,8 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
                {
                    OPENFILENAME ofn;
 
-                   ZeroMemory(&ofn, sizeof(OPENFILENAME));
-                   ofn.lStructSize = sizeof(OPENFILENAME);
+                   ZeroMemory(&ofn, sizeof (OPENFILENAME));
+                   ofn.lStructSize = sizeof (OPENFILENAME);
                    ofn.hwndOwner = hDlg;
                    ofn.hInstance = hInst;
                    ofn.Flags = OFN_EXTENSIONDIFFERENT | OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR;
@@ -9704,7 +9704,7 @@ static INT_PTR CALLBACK AVIOutputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPA
                    ofn.lCustData = 0;
                    ofn.lpstrFilter = "Video Clip (*.avi)\0*.avi\0Wave Sound (*.wav)\0";
 
-                   if(!GetSaveFileName(&ofn))
+                   if(!GetSaveFileName (&ofn))
                        break;
                    if (ofn.nFilterIndex == 2) {
                        avioutput_audio = AVIAUDIO_WAV;
@@ -10712,8 +10712,8 @@ static int GetSettings (int all_options, HWND hwnd)
     if (first)
        write_log ("Entering GUI idle loop\n");
 
-    scaleresource_setmaxsize(800, 600);
-    tres = scaleresource(panelresource, hwnd);
+    scaleresource_setmaxsize (800, 600);
+    tres = scaleresource (panelresource, hwnd);
     dhwnd = CreateDialogIndirect (tres->inst, tres->resource, hwnd, DialogProc);
     dialog_rect.top = dialog_rect.left = 0;
     dialog_rect.right = tres->width;
@@ -10726,18 +10726,18 @@ static int GetSettings (int all_options, HWND hwnd)
 
        setguititle (dhwnd);
        ShowWindow (dhwnd, SW_SHOW);
-       MapDialogRect(dhwnd, &dialog_rect);
+       MapDialogRect (dhwnd, &dialog_rect);
 
        for (;;) {
            HANDLE IPChandle;
-           IPChandle = geteventhandleIPC();
+           IPChandle = geteventhandleIPC ();
            if (IPChandle != INVALID_HANDLE_VALUE) {
                MsgWaitForMultipleObjects (1, &IPChandle, FALSE, INFINITE, QS_ALLINPUT);
-               while (checkIPC(&workprefs));
+               while (checkIPC( &workprefs));
            } else {
                WaitMessage();
            }
-           dialogmousemove(dhwnd);
+           dialogmousemove (dhwnd);
            while ((v = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))) {
                if (dialogreturn >= 0)
                    break;
@@ -10957,7 +10957,7 @@ static int fsdialog (HWND *hwnd, DWORD *flags)
     *hwnd = hAmigaWnd;
     if (isfullscreen () <= 0)
        return 0;
-    hr = DirectDraw_FlipToGDISurface();
+    hr = DirectDraw_FlipToGDISurface ();
     if (FAILED(hr))
        write_log ("FlipToGDISurface failed, %s\n", DXError (hr));
     *flags |= MB_SETFOREGROUND;
index 9cc8216be812a28f9aeb7315029c0a89537ec21d..97886474c43db64a17d7eb87279b33b5460a1d52 100755 (executable)
@@ -1,4 +1,31 @@
 
+Beta 9:
+
+- crash when fullscreen enabled and error dialog was shown before
+  display was changed to fullscreen
+- CD32 state restore compatibility improved
+- SSCAN2 'undocumented' feature emulated. "If SSCAN2 bit in FMODE is
+  set, then disable SH10 horizontal coincidence detect". This really
+  means both one AND zero SH10 match = single sprite can appear twice
+  on screen! (Fantastic Dizzy CD32 background)
+- AGA mode only: last line of sprite may have been redrawn if bitplane
+  width was changed and sprite was reused later (introduced in 1.4.5)
+- debugger sp command improvements
+- AGA sprite outside bitplanes position bug fix (introduced in 1.4.5)
+- Picasso96 8-bit mode wrong palette after mode switch
+- Picasso96 8-bit and 16-bit optimized blitter bug fix, too much data
+  was blitted if width was >32 bytes (not pixels) and it was not
+  divisible by 32. 32-bit mode was working properly.
+- emulated LPSTOP instruction (68060 only)
+- MMU instructions didn't check supervisor mode. Note that there is no
+  MMU emulation, I think I have to repeat this every time I talk about
+  MMU :)
+- added 68040/68060 MMU instructions to table68k (no more generic
+  "MMUOP" in debugger's disassembler) 68030 MMU instructions are still
+  shown as "MMUOP030", they don't really fit to table68k format because
+  first instruction word does not specify the instruction type
+- MOVEC weird disassembly updated (MOVEM is still weird)
+
 Beta 8:
 
 NOTE: OGL/D3D filters still using old scaling
index 45529b28b5f9e6dd655e36545ffabccaaa7349a2..62f790d16733c3271241ff33a31898a2d9e686a2 100755 (executable)
@@ -50,7 +50,7 @@ static void NOINLINE BLT_NAME (unsigned int w, unsigned int h, uae_u8 *src, uae_
     }
 
     ww = w / (8 * BLT_MULT);
-    xxd = w - ww * (8 * BLT_MULT);
+    xxd = (w - ww * (8 * BLT_MULT)) / BLT_MULT;
     for(y = 0; y < h; y++) {
        uae_u32 *src_32 = (uae_u32*)src2;
        uae_u32 *dst_32 = (uae_u32*)dst2;
index 2ae68eabfc15a0e7c234d7c4ca28f3aa6ec5c8a3..07ec9cb7bc8be163682e78cc6edc07c0236b4c4b 100755 (executable)
--- a/readcpu.c
+++ b/readcpu.c
@@ -137,9 +137,18 @@ struct mnemolookup lookuptab[] = {
     { i_CPUSHA, "CPUSHA" },
     { i_MOVE16, "MOVE16" },
 
-    { i_MMUOP30A, "MMUOP30A" },
-    { i_MMUOP30B, "MMUOP30B" },
-    { i_MMUOP, "MMUOP" },
+    { i_MMUOP030, "MMUOP030" },
+    { i_PFLUSHN, "PFLUSHN" },
+    { i_PFLUSH, "PFLUSH" },
+    { i_PFLUSHAN, "PFLUSHAN" },
+    { i_PFLUSHA, "PFLUSHA" },
+
+    { i_PLPAR, "PLPAR" },
+    { i_PLPAW, "PLPAW" },
+    { i_PTESTR, "PTESTR" },
+    { i_PTESTW, "PTESTW" },
+
+    { i_LPSTOP, "LPSTOP" },
     { i_ILLG, "" },
 };
 
@@ -374,6 +383,7 @@ static void build_insn (int insn)
            switch (opcstr[pos]) {
            case 'p': srcmode = Apdi; pos++; break;
            case 'P': srcmode = Aipi; pos++; break;
+           case 'a': srcmode = Aind; pos++; break;
            }
            break;
        case 'L':
@@ -715,7 +725,8 @@ static void build_insn (int insn)
                    table68k[opc].mnemo = lookuptab[find].mnemo;
                    break;
                }
-               if (strlen(lookuptab[find].name) == 0) abort();
+               if (strlen(lookuptab[find].name) == 0)
+                   abort();
            }
        }
        else {
index ab4b282f44da55da36410c99acdef2c96514eb48..8146e4db3321e82da57d1f48564e8f841178b21e 100755 (executable)
@@ -541,7 +541,10 @@ void restore_state (char *filename)
            end = chunk + len;
            write_log ("unknown chunk '%s' size %d bytes\n", name, len);
        }
-       if (len != end - chunk)
+       if (end == NULL)
+           write_log ("Chunk '%s', size %d bytes was not accepted!\n",
+               name, len);
+       else if (len != end - chunk)
            write_log ("Chunk '%s' total size %d bytes but read %d bytes!\n",
                       name, len, end - chunk);
        xfree (chunk);
index ab4c84efa8af0e1936dc39ff4609a72c6e7258d3..eb906ec852e871383a1b224df3c7dccdb3ffd13f 100755 (executable)
--- a/table68k
+++ b/table68k
@@ -25,6 +25,7 @@
 %
 % Arp: --> -(Ar)
 % ArP: --> (Ar)+
+% Ara: --> (Ar)
 % L: (xxx.L)
 %
 % Fields on a line: 
 1111 0011 01ss sSSS:22:?????:?????:10: FRESTORE s[!Dreg,Areg,Apdi,Immd]
 
 % 68030 MMU (allowed addressing modes not checked!)
-1111 0000 00ss sSSS:30:?????:?????:11: MMUOP30A s[!Immd],#1
-1111 1000 00ss sSSS:30:?????:?????:11: MMUOP30B s[!Immd]
-% Misc MMU
-1111 0101 iiii iSSS:40:?????:?????:11: MMUOP    #i,s
+1111 0000 00ss sSSS:32:?????:?????:11: MMUOP030 s[!Immd],#1
 
-% 68040 instructions
+% 68040/68060 instructions
 1111 0100 pp00 1rrr:42:-----:-----:02: CINVL    #p,Ar
 1111 0100 pp01 0rrr:42:-----:-----:02: CINVP    #p,Ar
 1111 0100 pp01 1rrr:42:-----:-----:00: CINVA    #p
 1111 0100 pp10 1rrr:42:-----:-----:02: CPUSHL   #p,Ar
 1111 0100 pp11 0rrr:42:-----:-----:02: CPUSHP   #p,Ar
 1111 0100 pp11 1rrr:42:-----:-----:00: CPUSHA   #p
+1111 0101 0000 0rrr:42:-----:-----:00: PFLUSHN  Ara
+1111 0101 0000 1rrr:42:-----:-----:00: PFLUSH   Ara
+1111 0101 0001 0rrr:42:-----:-----:00: PFLUSHAN Ara
+1111 0101 0001 1rrr:42:-----:-----:00: PFLUSHA  Ara
+1111 0101 0100 1rrr:42:-----:-----:00: PTESTR   Ara
+1111 0101 0110 1rrr:42:-----:-----:00: PTESTW   Ara
+
 % destination register number is encoded in the following word
 1111 0110 0010 0rrr:40:-----:-----:12: MOVE16   ArP,AxP
 1111 0110 00ss sSSS:40:-----:-----:12: MOVE16   s[Dreg-Aipi],L
 1111 0110 00dd dDDD:40:-----:-----:12: MOVE16   L,d[Areg-Aipi]
 1111 0110 00ss sSSS:40:-----:-----:12: MOVE16   s[Aind],L
 1111 0110 00dd dDDD:40:-----:-----:12: MOVE16   L,d[Aipi-Aind]
+
+% 68060
+1111 1000 0000 0000:52:?????:?????:10: LPSTOP   #1
+1111 0101 1000 1rrr:52:-----:-----:00: PLPAR    Ara
+1111 0101 1100 1rrr:52:-----:-----:00: PLPAW    Ara
+