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;
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;
}
{
int il = -1;
#ifdef JIT
- if (compiled_code) {
+ if (currprefs.cachesize) {
uae_u16 imask = intreq & intena;
if (imask && (intena & 0x4000)) {
if (imask & 0x2000)
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) {
{
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++) {
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;
}
}
-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:
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 ();
}
}
+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];
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);
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);
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);
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);
extern int fpp_movem_next[256];
#endif
-extern int broken_in;
-
typedef unsigned long cpuop_func (uae_u32) REGPARAM;
struct cputbl {
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;
}
#endif
-int broken_in;
-
static unsigned long op_illg_1 (uae_u32 opcode) REGPARAM;
static unsigned long REGPARAM2 op_illg_1 (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);
}
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
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);
}
*/
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);
}
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)
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
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 );
+ }
}
}
}
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);
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;
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;
}
}
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;
}