From: Toni Wilen Date: Sat, 29 May 2004 17:38:48 +0000 (+0300) Subject: imported winuaesrc0827b3.zip X-Git-Tag: 2100~349 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=c492f776a7b0e3d16e26d5b90642b2de88ef4a0d;p=francis%2Fwinuae.git imported winuaesrc0827b3.zip --- diff --git a/custom.c b/custom.c index ae2c7646..a1febcc0 100755 --- 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 592891c4..30104e6d 100755 --- 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++) { diff --git a/filesys.c b/filesys.c index c4bdaaff..270b8821 100755 --- 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; diff --git a/gencpu.c b/gencpu.c index 420a61fb..2d8e15a1 100755 --- 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); diff --git a/include/newcpu.h b/include/newcpu.h index e0f4e3f6..3450c30a 100755 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -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 5d1f73f5..a2b9fed1 100755 --- 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; } diff --git a/newcpu.c b/newcpu.c index c2ef975a..297fab2e 100755 --- 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); } diff --git a/od-win32/parser.c b/od-win32/parser.c index 415fc9c3..9f68aba1 100755 --- a/od-win32/parser.c +++ b/od-win32/parser.c @@ -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) diff --git a/od-win32/win32.c b/od-win32/win32.c index fcee1dad..e741b51f 100755 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -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 ); + } } } } diff --git a/od-win32/win32.h b/od-win32/win32.h index 0bda75b2..0e67f387 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -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); diff --git a/od-win32/win32_scale2x.c b/od-win32/win32_scale2x.c index 1557b120..3466b956 100755 --- a/od-win32/win32_scale2x.c +++ b/od-win32/win32_scale2x.c @@ -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 52e88e24..3e626e0d 100755 --- 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; }