]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc0827b3.zip
authorToni Wilen <twilen@winuae.net>
Sat, 29 May 2004 17:38:48 +0000 (20:38 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:22:59 +0000 (21:22 +0200)
12 files changed:
custom.c
debug.c
filesys.c
gencpu.c
include/newcpu.h
main.c
newcpu.c
od-win32/parser.c
od-win32/win32.c
od-win32/win32.h
od-win32/win32_scale2x.c
zfile.c

index ae2c764661e093354f281989d5ee8c4e8c0957cb..a1febcc0ea73a1fdf514147cb7886117f3d77c30 100755 (executable)
--- a/custom.c
+++ b/custom.c
@@ -1626,36 +1626,69 @@ typedef int sprbuf_res_t, cclockres_t, hwres_t, bplres_t;
 
 static void do_playfield_collisions (void)
 {
-    uae_u8 *ld = line_data[next_lineno];
-    int i;
+    int bplres = GET_RES (bplcon0);
+    hwres_t ddf_left = thisline_decision.plfleft * 2 << bplres;
+    hwres_t hw_diwlast = coord_window_to_diw_x (thisline_decision.diwlastword);
+    hwres_t hw_diwfirst = coord_window_to_diw_x (thisline_decision.diwfirstword);
+    int i, collided, minpos, maxpos;
+#ifdef AGA
+    int planes = (currprefs.chipset_mask & CSMASK_AGA) ? 8 : 6;
+#else
+    int planes = 6;
+#endif
 
     if (clxcon_bpl_enable == 0) {
        clxdat |= 1;
        return;
     }
-       
-    for (i = thisline_decision.plfleft; i < thisline_decision.plfright; i += 2) {
+    if (clxdat & 1)
+       return;
+
+    collided = 0;
+    minpos = thisline_decision.plfleft * 2;
+    if (minpos < hw_diwfirst)
+       minpos = hw_diwfirst;
+    maxpos = thisline_decision.plfright * 2;
+    if (maxpos > hw_diwlast)
+       maxpos = hw_diwlast;
+    for (i = minpos; i < maxpos && !collided; i+= 32) {
+       int offs = ((i << bplres) - ddf_left) >> 3;
        int j;
-       uae_u32 total = 0xFFFFFFFF;
-       for (j = 0; j < 8; j++) {
-           uae_u32 t = 0;
-           if ((clxcon_bpl_enable & (1 << j)) == 0)
-               t = 0xFFFFFFFF;
-           else if (j < thisline_decision.nr_planes) {
-               t = *(uae_u32 *)(line_data[next_lineno] + 2 * i + 2 * j * MAX_WORDS_PER_LINE);
-               t ^= ~(((clxcon_bpl_match >> j) & 1) - 1);
+       uae_u32 total = 0xffffffff;
+       for (j = 0; j < planes; j++) {
+           int ena = (clxcon_bpl_enable >> j) & 1;
+           int match = (clxcon_bpl_match >> j) & 1;
+           uae_u32 t = 0xffffffff;
+           if (ena) {
+               if (j < thisline_decision.nr_planes) {
+                   t = *(uae_u32 *)(line_data[next_lineno] + offs + 2 * j * MAX_WORDS_PER_LINE);
+                   t ^= (match & 1) - 1;
+               } else {
+                   t = (match & 1) - 1;
+               }
            }
            total &= t;
        }
-       if (total)
-           clxdat |= 1;        
+       if (total) {
+           collided = 1;
+#if 0
+           {
+               int k;
+               for (k = 0; k < 1; k++) {
+                   uae_u32 *ldata = (uae_u32 *)(line_data[next_lineno] + offs + 2 * k * MAX_WORDS_PER_LINE);
+                   *ldata ^= 0x5555555555;
+               }
+           }
+#endif
+
+       }
     }
+    if (collided)
+       clxdat |= 1;
 }
 
 /* Sprite-to-sprite collisions are taken care of in record_sprite.  This one does
-   playfield/sprite collisions.
-   That's the theory.  In practice this doesn't work yet.  I also suspect this code
-   is way too slow.  */
+   playfield/sprite collisions. */
 static void do_sprite_collisions (void)
 {
     int nr_sprites = curr_drawinfo[next_lineno].nr_sprites;
@@ -2350,7 +2383,9 @@ static void VPOSW (uae_u16 v)
 
 STATIC_INLINE uae_u16 VHPOSR (void)
 {
-    uae_u16 v = (vpos << 8) | current_hpos ();
+    uae_u16 v = vpos << 8;
+    uae_u16 hp = current_hpos ();
+    v |= hp;
     return v;
 }
 
@@ -2483,7 +2518,7 @@ int intlev (void)
 {
     int il = -1;
 #ifdef JIT
-    if (compiled_code) {
+    if (currprefs.cachesize) {
        uae_u16 imask = intreq & intena;
        if (imask && (intena & 0x4000)) {
            if (imask & 0x2000)
@@ -2513,13 +2548,14 @@ int intlev (void)
 static void doint (void)
 {
     int i;
-    uae_u16 imask = intreq & intena;
+    uae_u16 imask;
 
     set_special (SPCFLAG_INT);
 #ifdef JIT
-    if (compiled_code)
+    if (currprefs.cachesize)
        return;
 #endif
+    imask = intreq & intena;
     if (imask && (intena & 0x4000)) {
        for (i = 0; i < 14; i++) {
            if ((imask & (1 << i)) && irqdelay[i] == 0) {
diff --git a/debug.c b/debug.c
index 592891c413ef8cae26a57c374234f6d9ad035b62..30104e6dee95478c081942992e80d97e66dc9013 100755 (executable)
--- a/debug.c
+++ b/debug.c
@@ -207,8 +207,7 @@ static void dumpmem (uaecptr addr, uaecptr *nxmem, int lines)
 {
     char line[80];
     int cols = 8;
-    broken_in = 0;
-    for (;lines-- && !broken_in;) {
+    for (;lines--;) {
        int i;
        sprintf (line, "%08lx ", addr);
        for (i = 0; i < cols; i++) {
index c4bdaaff5ee025c9f068a3e6a2fec2ac5432fee7..270b88217f20176e3156458151f8af520525d66e 100755 (executable)
--- a/filesys.c
+++ b/filesys.c
@@ -3366,8 +3366,9 @@ static int handle_packet (Unit *unit, dpacket pck)
      case ACTION_MAKE_LINK:
      case ACTION_READ_LINK:
      case ACTION_FORMAT:
+        return 0;
      default:
-       write_log ("FILESYS: UNSUPPORTED PACKET %x\n", type);
+       write_log ("FILESYS: UNKNOWN PACKET %x\n", type);
        return 0;
     }
     return 1;
index 420a61fbf7197906b7971f92e6d31015407056a9..2d8e15a1e262eddd65732bf9de36a0f9edbcb38b 100755 (executable)
--- a/gencpu.c
+++ b/gencpu.c
@@ -618,7 +618,7 @@ static void genamode (amodes mode, char *reg, wordsizes size, char *name, int ge
        }
 }
 
-static void genastore (char *from, amodes mode, char *reg, wordsizes size, char *to)
+static void genastore_2 (char *from, amodes mode, char *reg, wordsizes size, char *to, int store_dir)
 {
     switch (mode) {
      case Dreg:
@@ -671,8 +671,10 @@ static void genastore (char *from, amodes mode, char *reg, wordsizes size, char
             case sz_long:
                if (cpu_level < 2 && (mode == PC16 || mode == PC8r))
                    abort ();
-               printf ("\tput_word_ce (%sa, %s >> 16); put_word_ce (%sa + 2, %s);\n", to, from, to, from);
-               //printf ("\tput_word_ce (%sa + 2, %s); put_word_ce (%sa, %s >> 16);\n", to, from, to, from);
+               if (store_dir)
+                   printf ("\tput_word_ce (%sa + 2, %s); put_word_ce (%sa, %s >> 16);\n", to, from, to, from);
+               else
+                   printf ("\tput_word_ce (%sa, %s >> 16); put_word_ce (%sa + 2, %s);\n", to, from, to, from);
                break;
             default:
                abort ();
@@ -712,6 +714,16 @@ static void genastore (char *from, amodes mode, char *reg, wordsizes size, char
     }
 }
 
+static void genastore (char *from, amodes mode, char *reg, wordsizes size, char *to)
+{
+    genastore_2 (from, mode, reg, size, to, 0);
+}
+static void genastore_rev (char *from, amodes mode, char *reg, wordsizes size, char *to)
+{
+    genastore_2 (from, mode, reg, size, to, 1);
+}
+
+
 static void genmovemel (uae_u16 opcode)
 {
     char getcode[100];
@@ -1298,7 +1310,7 @@ static void gen_opcode (unsigned long int opcode)
         fill_prefetch_next_delay (tmpc);
        start_brace ();
        genflags (flag_sub, curi->size, "dst", "src", "0");
-       genastore ("dst", curi->smode, "srcreg", curi->size, "src");
+       genastore_rev ("dst", curi->smode, "srcreg", curi->size, "src");
        break;
     case i_NEGX:
        genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
@@ -1308,7 +1320,7 @@ static void gen_opcode (unsigned long int opcode)
        printf ("\tuae_u32 newv = 0 - src - (GET_XFLG ? 1 : 0);\n");
        genflags (flag_subx, curi->size, "newv", "src", "0");
        genflags (flag_zn, curi->size, "newv", "", "");
-       genastore ("newv", curi->smode, "srcreg", curi->size, "src");
+       genastore_rev ("newv", curi->smode, "srcreg", curi->size, "src");
        break;
     case i_NBCD:
        genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
@@ -1333,7 +1345,7 @@ static void gen_opcode (unsigned long int opcode)
        if (isreg (curi->smode) && curi->size == sz_long) tmpc += 2;
         fill_prefetch_next_delay (tmpc);
        genflags (flag_logical, curi->size, "0", "", "");
-       genastore ("0", curi->smode, "srcreg", curi->size, "src");
+       genastore_rev ("0", curi->smode, "srcreg", curi->size, "src");
        break;
     case i_NOT:
        genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
@@ -1342,7 +1354,7 @@ static void gen_opcode (unsigned long int opcode)
        start_brace ();
        printf ("\tuae_u32 dst = ~src;\n");
        genflags (flag_logical, curi->size, "dst", "", "");
-       genastore ("dst", curi->smode, "srcreg", curi->size, "src");
+       genastore_rev ("dst", curi->smode, "srcreg", curi->size, "src");
        break;
     case i_TST:
        genamode (curi->smode, "srcreg", curi->size, "src", 1, 0, 0);
index e0f4e3f60404a6267e8d08a42c4d40f11c3bb617..3450c30aa669be30bae8d65ca7437d77f6279479 100755 (executable)
@@ -47,8 +47,6 @@ extern int fpp_movem_index2[256];
 extern int fpp_movem_next[256];
 #endif
 
-extern int broken_in;
-
 typedef unsigned long cpuop_func (uae_u32) REGPARAM;
 
 struct cputbl {
diff --git a/main.c b/main.c
index 5d1f73f53ad663e603a5b131aa10456fad88a6cb..a2b9fed1ca7abb1a6206ddffa93fd829f64dc9b0 100755 (executable)
--- a/main.c
+++ b/main.c
@@ -183,47 +183,47 @@ static void fix_options (void)
        err = 1;
     }
     if (currprefs.comptrustbyte < 0 || currprefs.comptrustbyte > 3) {
-       fprintf (stderr, "Bad value for comptrustbyte parameter: value must be within 0..2\n");
+       write_log ("Bad value for comptrustbyte parameter: value must be within 0..2\n");
        currprefs.comptrustbyte = 1;
        err = 1;
     }
     if (currprefs.comptrustword < 0 || currprefs.comptrustword > 3) {
-       fprintf (stderr, "Bad value for comptrustword parameter: value must be within 0..2\n");
+       write_log ("Bad value for comptrustword parameter: value must be within 0..2\n");
        currprefs.comptrustword = 1;
        err = 1;
     }
     if (currprefs.comptrustlong < 0 || currprefs.comptrustlong > 3) {
-       fprintf (stderr, "Bad value for comptrustlong parameter: value must be within 0..2\n");
+       write_log ("Bad value for comptrustlong parameter: value must be within 0..2\n");
        currprefs.comptrustlong = 1;
        err = 1;
     }
     if (currprefs.comptrustnaddr < 0 || currprefs.comptrustnaddr > 3) {
-       fprintf (stderr, "Bad value for comptrustnaddr parameter: value must be within 0..2\n");
+       write_log ("Bad value for comptrustnaddr parameter: value must be within 0..2\n");
        currprefs.comptrustnaddr = 1;
        err = 1;
     }
     if (currprefs.compnf < 0 || currprefs.compnf > 1) {
-       fprintf (stderr, "Bad value for compnf parameter: value must be within 0..1\n");
+       write_log ("Bad value for compnf parameter: value must be within 0..1\n");
        currprefs.compnf = 1;
        err = 1;
     }
     if (currprefs.comp_hardflush < 0 || currprefs.comp_hardflush > 1) {
-       fprintf (stderr, "Bad value for comp_hardflush parameter: value must be within 0..1\n");
+       write_log ("Bad value for comp_hardflush parameter: value must be within 0..1\n");
        currprefs.comp_hardflush = 1;
        err = 1;
     }
     if (currprefs.comp_constjump < 0 || currprefs.comp_constjump > 1) {
-       fprintf (stderr, "Bad value for comp_constjump parameter: value must be within 0..1\n");
+       write_log ("Bad value for comp_constjump parameter: value must be within 0..1\n");
        currprefs.comp_constjump = 1;
        err = 1;
     }
     if (currprefs.comp_oldsegv < 0 || currprefs.comp_oldsegv > 1) {
-       fprintf (stderr, "Bad value for comp_oldsegv parameter: value must be within 0..1\n");
+       write_log ("Bad value for comp_oldsegv parameter: value must be within 0..1\n");
        currprefs.comp_oldsegv = 1;
        err = 1;
     }
     if (currprefs.cachesize < 0 || currprefs.cachesize > 16384) {
-       fprintf (stderr, "Bad value for cachesize parameter: value must be within 0..16384\n");
+       write_log ("Bad value for cachesize parameter: value must be within 0..16384\n");
        currprefs.cachesize = 0;
        err = 1;
     }
index c2ef975a4cd53f10937d7a5d0b72811c9c8cdb4f..297fab2e7613f20304a5110b56bfb8ead5f02ba9 100755 (executable)
--- a/newcpu.c
+++ b/newcpu.c
@@ -125,8 +125,6 @@ void dump_counts (void)
 #endif
 
 
-int broken_in;
-
 static unsigned long op_illg_1 (uae_u32 opcode) REGPARAM;
 
 static unsigned long REGPARAM2 op_illg_1 (uae_u32 opcode)
@@ -1518,6 +1516,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode)
 {
     uaecptr pc = m68k_getpc ();
     static int warned;
+    static int cpu68020;
 
     if (cloanto_rom && (opcode & 0xF100) == 0x7100) {
        m68k_dreg (regs, (opcode >> 9) & 7) = (uae_s8)(opcode & 0xFF);
@@ -1527,11 +1526,9 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode)
     }
 
     compiler_flush_jsr_stack ();
-    if (opcode == 0x4E7B && get_long (0x10) == 0 && in_rom (pc)) {
-       gui_message ("Your Kickstart requires a 68020 CPU. Giving up.\n");
-       broken_in = 1;
-       set_special (SPCFLAG_BRK);
-       quit_program = 1;
+    if (opcode == 0x4E7B && get_long (0x10) == 0 && in_rom (pc) && !cpu68020) {
+       gui_message ("Your Kickstart requires a 68020 CPU");
+       cpu68020 = 1;
     }
 
 #ifdef AUTOCONFIG
@@ -1715,6 +1712,10 @@ static int do_specialties (int cycles)
            do_copper ();
        if (regs.spcflags & (SPCFLAG_INT | SPCFLAG_DOINT)) {
            int intr = intlev ();
+#ifdef JIT
+           if (currprefs.cachesize)
+               unset_special (SPCFLAG_INT | SPCFLAG_DOINT);
+#endif
            if (intr != -1 && intr > regs.intmask)
                Interrupt (intr);
        }
@@ -1751,17 +1752,20 @@ static int do_specialties (int cycles)
      */
     if ((regs.spcflags & SPCFLAG_DOINT) 
 #ifdef JIT     
-       || (!compiled_code && (regs.spcflags & SPCFLAG_INT))
+       || (!currprefs.cachesize && (regs.spcflags & SPCFLAG_INT))
 #endif
        ) {
         int intr = intlev ();
-       unset_special (SPCFLAG_DOINT);
+#ifdef JIT
+       if (currprefs.cachesize)
+           unset_special (SPCFLAG_DOINT);
+#endif
        if (intr != -1 && intr > regs.intmask)
            Interrupt (intr);
     }
 
 #ifdef JIT
-    if ((regs.spcflags & SPCFLAG_INT) && compiled_code) {
+    if ((regs.spcflags & SPCFLAG_INT) && currprefs.cachesize) {
        unset_special (SPCFLAG_INT);
        set_special (SPCFLAG_DOINT);
     }
index 415fc9c38dd1a4e3cf4318b8de2200b28b4f297d..9f68aba1f730e81167a499191d294b6fdebbbc85 100755 (executable)
@@ -321,10 +321,10 @@ void writeser (int c)
 
 int checkserwrite (void)
 {
-    if (midi_ready) {
-       return 1;
     if (hCom == INVALID_HANDLE_VALUE || !currprefs.use_serial)
        return 1;
+    if (midi_ready) {
+       return 1;
     } else {
         outser ();
        if (datainoutput >= sizeof (outputbuffer) - 1)
index fcee1dad737a641e1008e68aec808143b321cdd6..e741b51fa010b5c07c4bc5beb85274220284420e 100755 (executable)
@@ -1510,12 +1510,6 @@ int target_parse_option (struct uae_prefs *p, char *option, char *value)
        return 1;
     }
 
-    v = -1;
-    if (cfgfile_yesno (option, value, "cpu_idle", &v)) {
-       if (v == 1)
-            p->cpu_idle = 60;
-    }
-
     if (p->sername[0] == 'n')
        p->use_serial = 0;
     else
@@ -2029,8 +2023,10 @@ static LONG WINAPI ExceptionFilter( struct _EXCEPTION_POINTERS * pExceptionPoint
                        exinfo.ClientPointers = 0;
                        dump (GetCurrentProcess(), GetCurrentProcessId(), f, MiniDumpNormal, &exinfo, NULL, NULL);
                        CloseHandle (f);
-                       sprintf (msg, "Crash detected. MiniDump saved as:\n%s\n", path2);
-                       MessageBox( NULL, msg, "Crash", MB_OK | MB_ICONWARNING | MB_TASKMODAL | MB_SETFOREGROUND );
+                       if (!isfullscreen ()) {
+                           sprintf (msg, "Crash detected. MiniDump saved as:\n%s\n", path2);
+                           MessageBox( NULL, msg, "Crash", MB_OK | MB_ICONWARNING | MB_TASKMODAL | MB_SETFOREGROUND );
+                       }
                    }
                }
            }
index 0bda75b2a199c921fb67e704bdc1efd9600dcc12..0e67f38749df63de58349ac7c922dea0d04e0321 100755 (executable)
@@ -21,7 +21,7 @@ extern int manual_painting_needed;
 extern int manual_palette_refresh_needed;
 extern int mouseactive, focus;
 #define WINUAEBETA 1
-#define WINUAEBETASTR " Beta 2"
+#define WINUAEBETASTR " Beta 3"
 
 extern void my_kbd_handler (int, int, int);
 extern void clearallkeys(void);
index 1557b1204b3134b8f4a520227435916e2bfbfbd7..3466b956a6bbd67a6636458c227c70a34b81e806 100755 (executable)
@@ -68,10 +68,11 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd)
 void S2X_render (void)
 {
     int aw = amiga_width, ah = amiga_height, v, pitch;
-    uae_u8 *dptr, *sptr;
+    uae_u8 *dptr, *sptr, *endsptr;
     int ok = 0;
 
     sptr = gfxvidinfo.bufmem;
+    endsptr = gfxvidinfo.realbufmem + (amiga_height - 1) * 3 * gfxvidinfo.rowbytes;
 
     v = currprefs.gfx_filter_horiz_offset;
     v += (dst_width / scale - amiga_width) / 8;
@@ -164,7 +165,10 @@ void S2X_render (void)
        if (amiga_depth == dst_depth) {
            int y;
            for (y = 0; y < dst_height; y++) {
-               memcpy (dptr, sptr, dst_width * dst_depth / 8);
+               if (sptr < endsptr)
+                   memcpy (dptr, sptr, dst_width * dst_depth / 8);
+               else
+                   memset (dptr, 0, dst_width * dst_depth / 8);
                sptr += gfxvidinfo.rowbytes;
                dptr += pitch;
            }
diff --git a/zfile.c b/zfile.c
index 52e88e24e066c5cae91e9bba15afb4b942d6b57f..3e626e0d73c956cf638b21457ab38c45f6e7cc33 100755 (executable)
--- a/zfile.c
+++ b/zfile.c
@@ -411,9 +411,9 @@ static struct zfile *unzip (struct zfile *z)
                }
                if (first) {
                    if (isdiskimage (filename_inzip))
-                       sprintf (tmphist," %s/%s", z->name, filename_inzip);
+                       sprintf (tmphist,"%s/%s", z->name, filename_inzip);
                } else {
-                   sprintf (tmphist," %s/%s", z->name, filename_inzip);
+                   sprintf (tmphist,"%s/%s", z->name, filename_inzip);
                    DISK_history_add (tmphist, -1);
                    tmphist[0] = 0;
                }