void a3000scsi_reset (void)
{
+ init_scsi ();
map_banks (&mbdmac_a3000_bank, 0xDD, 1, 0);
wd_cmd_reset (false);
}
if (!noput) {
int r;
uae_u16 old = last_custom_value1;
- uae_u16 l = currprefs.cpu_compatible && currprefs.cpu_model == 68000 ? regs.irc : 0xffff;
+ uae_u16 l = currprefs.cpu_compatible && currprefs.cpu_model == 68000 ? regs.irc : ((currprefs.chipset_mask & CSMASK_AGA) ? old : 0xffff);
decide_line (hpos);
decide_fetch (hpos);
decide_blitter (hpos);
}
}
} else {
- if (currprefs.chipset_mask & CSMASK_ECS_AGNUS)
+ if ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) && !(currprefs.chipset_mask & CSMASK_AGA))
v = 0xffff;
else
v = l;
return f ? 1 : 0;
} else {
if (zfile_exists (fname)) {
- if (wrprot)
+ if (wrprot && !p->floppy_read_only)
*wrprot = 0;
if (crc32) {
struct zfile *f = zfile_fopen (fname, _T("rb"), ZFD_NORMAL | ZFD_DISKHISTORY);
#define LINE_DONE_AS_PREVIOUS 8
#define LINE_REMEMBERED_AS_PREVIOUS 9
-static uae_u8 linestate[(MAXVPOS + 2) * 2 + 1];
+#define LINESTATE_SIZE ((MAXVPOS + 2) * 2 + 1)
+
+static uae_u8 linestate[LINESTATE_SIZE], linestate2[LINESTATE_SIZE];
uae_u8 line_data[(MAXVPOS + 2) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2];
#define xlinecheck
#endif
+static void clearbuffer (struct vidbuffer *dst)
+{
+ if (!dst->bufmem_allocated)
+ return;
+ uae_u8 *p = dst->bufmem_allocated;
+ for (int y = 0; y < dst->height_allocated; y++) {
+ memset (p, 0, dst->width_allocated * dst->pixbytes);
+ p += dst->rowbytes;
+ }
+}
+
+void reset_decision_table (void)
+{
+ for (int i = 0; i < sizeof linestate / sizeof *linestate; i++)
+ linestate[i] = LINE_UNDECIDED;
+}
STATIC_INLINE void count_frame (void)
{
static int src_pixel, ham_src_pixel;
/* How many pixels in window coordinates which are to the left of the left border. */
static int unpainted;
-static int seen_sprites;
STATIC_INLINE xcolnr getbgc (bool blank)
{
ddf_left <<= bplres;
src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window (playfield_start - native_ddf_left);
- seen_sprites = 0;
if (dip_for_drawing->nr_sprites == 0)
return;
- 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);
STATIC_INLINE void do_flush_line (struct vidbuffer *vb, int lineno)
{
- do_flush_line_1 (vb, lineno);
+ if (vb)
+ do_flush_line_1 (vb, lineno);
}
/*
thisframe_last_drawn_line = -1;
drawing_color_matches = -1;
- seen_sprites = -1;
}
void putpixel (uae_u8 *buf, int bpp, int x, xcolnr c8, int opaq)
lightpen_active = 0;
}
-void finish_drawing_frame (void)
+static void draw_frame2 (struct vidbuffer *vbin, struct vidbuffer *vbout)
{
- int i;
- bool didflush = false;
- struct vidbuffer *vb = &gfxvidinfo.drawbuffer;
-
- gfxvidinfo.outbuffer = vb;
-
- if (! lockscr (vb, false)) {
- notice_screen_contents_lost ();
- return;
- }
-
-#ifndef SMART_UPDATE
- /* @@@ This isn't exactly right yet. FIXME */
- if (!interlace_seen)
- do_flush_screen (first_drawn_line, last_drawn_line);
- else
- unlockscr ();
- return;
-#endif
-
- for (i = 0; i < max_ypos_thisframe; i++) {
+ for (int i = 0; i < max_ypos_thisframe; i++) {
int i1 = i + min_ypos_for_screen;
int line = i + thisframe_y_adjust_real;
int where2;
where2 = amiga2aspect_line_map[i1];
- if (where2 >= vb->inheight)
+ if (where2 >= vbin->inheight)
break;
if (where2 < 0)
continue;
hposblank = 0;
- pfield_draw_line (vb, line, where2, amiga2aspect_line_map[i1 + 1]);
+ pfield_draw_line (vbout, line, where2, amiga2aspect_line_map[i1 + 1]);
}
#if 0
/* clear possible old garbage at the bottom if emulated area become smaller */
do_flush_line (vb, where2);
}
#endif
+}
+
+bool draw_frame (struct vidbuffer *vb)
+{
+ uae_u8 oldstate[LINESTATE_SIZE];
+ struct vidbuffer oldvb;
+
+ memcpy (&oldvb, &gfxvidinfo.drawbuffer, sizeof (struct vidbuffer));
+ memcpy (&gfxvidinfo.drawbuffer, vb, sizeof (struct vidbuffer));
+ clearbuffer (vb);
+ init_row_map ();
+ memcpy (oldstate, linestate, LINESTATE_SIZE);
+ memcpy (linestate, linestate2, LINESTATE_SIZE);
+ for (int i = 0; i < LINESTATE_SIZE; i++) {
+ uae_u8 v = linestate[i];
+ if (v == LINE_REMEMBERED_AS_PREVIOUS)
+ v = LINE_AS_PREVIOUS;
+ else if (v == LINE_DONE_AS_PREVIOUS)
+ v = LINE_AS_PREVIOUS;
+ else if (v == LINE_REMEMBERED_AS_BLACK)
+ v = LINE_BLACK;
+ else if (v == LINE_DONE)
+ v = LINE_DECIDED;
+ linestate[i] = v;
+ }
+ last_drawn_line = 0;
+ first_drawn_line = 32767;
+ drawing_color_matches = -1;
+ draw_frame2 (vb, NULL);
+ last_drawn_line = 0;
+ first_drawn_line = 32767;
+ drawing_color_matches = -1;
+ memcpy (linestate, oldstate, LINESTATE_SIZE);
+ memcpy (&gfxvidinfo.drawbuffer, &oldvb, sizeof (struct vidbuffer));
+ init_row_map ();
+ return true;
+}
+
+static void finish_drawing_frame (void)
+{
+ int i;
+ bool didflush = false;
+ struct vidbuffer *vb = &gfxvidinfo.drawbuffer;
+
+ gfxvidinfo.outbuffer = vb;
+
+ if (! lockscr (vb, false)) {
+ notice_screen_contents_lost ();
+ return;
+ }
+
+#ifndef SMART_UPDATE
+ /* @@@ This isn't exactly right yet. FIXME */
+ if (!interlace_seen)
+ do_flush_screen (first_drawn_line, last_drawn_line);
+ else
+ unlockscr ();
+ return;
+#endif
+
+ draw_frame2 (vb, vb);
+
if (currprefs.leds_on_screen) {
int slx, sly;
statusline_getpos (&slx, &sly, vb->outwidth, vb->outheight);
void hsync_record_line_state (int lineno, enum nln_how how, int changed)
{
- uae_u8 *state;
+ uae_u8 *state, *state2;
if (framecnt != 0)
return;
state = linestate + lineno;
+ state2 = linestate2 + lineno;
changed += frame_redraw_necessary + ((lineno >= lightpen_y1 && lineno <= lightpen_y2) ? 1 : 0);
switch (how) {
state[1] = LINE_DECIDED; //LINE_BLACK;
break;
}
+ *state2 = *state;
}
static void dummy_flush_line (struct vidbuf_description *gfxinfo, struct vidbuffer *vb, int line_no)
return changed;
}
-static void clearbuffer (struct vidbuffer *dst)
+void allocvidbuffer (struct vidbuffer *buf, int width, int height, int depth)
{
- return;
- if (!dst->bufmem_allocated)
- return;
- uae_u8 *p = dst->bufmem_allocated;
- for (int y = 0; y < dst->height_allocated; y++) {
- memset (p, 0, dst->width_allocated * dst->pixbytes);
- p += dst->rowbytes;
- }
+ memset (buf, 0, sizeof (struct vidbuffer));
+ buf->pixbytes = (depth + 7) / 8;
+ buf->width_allocated = (width + 7) & ~7;
+ buf->height_allocated = height;
+
+ buf->outwidth = buf->width_allocated;
+ buf->outheight = buf->height_allocated;
+ buf->inwidth = buf->width_allocated;
+ buf->inheight = buf->height_allocated;
+
+ int size = width * height * buf->pixbytes;
+ buf->realbufmem = xcalloc (uae_u8, size);
+ buf->bufmem_allocated = buf->bufmem = buf->realbufmem;
+ buf->rowbytes = width * buf->pixbytes;
+ buf->bufmemend = buf->realbufmem + size - buf->rowbytes;
+ buf->bufmem_lockable = true;
}
-void reset_decision_table (void)
+void freevidbuffer (struct vidbuffer *buf)
{
- for (int i = 0; i < sizeof linestate / sizeof *linestate; i++)
- linestate[i] = LINE_UNDECIDED;
+ xfree (buf->realbufmem);
+ memset (buf, 0, sizeof (struct vidbuffer));
}
void reset_drawing (void)
return 0;
}
+static int test_softlink (a_inode *aino)
+{
+ int err;
+ if (aino->softlink && my_resolvesoftlink (aino->nname, -1))
+ err = ERROR_IS_SOFT_LINK;
+ else
+ err = ERROR_OBJECT_NOT_AROUND;
+ return err;
+}
+static void handle_softlink (Unit *unit, dpacket packet, a_inode *aino)
+{
+ PUT_PCK_RES1 (packet, DOS_FALSE);
+ PUT_PCK_RES2 (packet, test_softlink (aino));
+}
+
/*
* This gets called if an ACTION_EXAMINE_NEXT happens and we hit an object
* for which we know the name on the native filesystem, but no corresponding
if (prev && prev->softlink) {
- *err = ERROR_IS_SOFT_LINK;
+ *err = test_softlink (prev);
curr = NULL;
break;
}
DUMPLOCK(unit, lock);
a = find_aino (unit, lock, bstr (unit, name), &err);
- if (err == 0 && a->softlink)
- err = ERROR_IS_SOFT_LINK;
+ if (err == 0 && a->softlink) {
+ err = test_softlink (a);
+ }
if (err == 0 && (a->elock || (mode != SHARED_LOCK && a->shlock > 0))) {
err = ERROR_OBJECT_IN_USE;
}
return;
}
if (aino->softlink) {
- PUT_PCK_RES1 (packet, DOS_FALSE);
- PUT_PCK_RES2 (packet, ERROR_IS_SOFT_LINK);
+ handle_softlink (unit, packet, aino);
return;
}
if (err == 0) {
if (aino == 0)
aino = &unit->rootnode;
if (aino->softlink) {
- PUT_PCK_RES1 (packet, DOS_FALSE);
- PUT_PCK_RES2 (packet, ERROR_IS_SOFT_LINK);
+ handle_softlink (unit, packet, aino);
return;
}
return;
}
if (a->softlink) {
- PUT_PCK_RES1 (packet, DOS_FALSE);
- PUT_PCK_RES2 (packet, ERROR_IS_SOFT_LINK);
+ handle_softlink (unit, packet, a);
return;
}
return;
}
if (a->softlink) {
- PUT_PCK_RES1 (packet, DOS_FALSE);
- PUT_PCK_RES2 (packet, ERROR_IS_SOFT_LINK);
+ handle_softlink (unit, packet, a);
goto maybe_free_and_out;
}
return;
}
if (a->softlink) {
- PUT_PCK_RES1 (packet, DOS_FALSE);
- PUT_PCK_RES2 (packet, ERROR_IS_SOFT_LINK);
+ handle_softlink (unit, packet, a);
return;
}
amiga_to_timeval (&tv, get_long (date), get_long (date + 4), get_long (date + 8));
incpc ("%d", m68k_pc_offset);
printf ("\t\tException (5);\n");
printf ("\t\tgoto %s;\n", endlabelstr);
- printf ("\t} else {\n");
- printf ("\t\tuae_s32 newv = (uae_s32)dst / (uae_s32)(uae_s16)src;\n");
- printf ("\t\tuae_u16 rem = (uae_s32)dst %% (uae_s32)(uae_s16)src;\n");
- printf ("\t\tCLEAR_CZNV ();\n");
+ printf ("\t}\n");
+ printf ("\tCLEAR_CZNV ();\n");
fill_prefetch_next ();
if (using_ce) {
start_brace ();
} else if (using_ce020) {
addcycles_ce020 (46);
}
+ printf ("\tif (dst == 0x80000000 && src == -1) {\n");
+ printf ("\t\tSET_VFLG (1);\n");
+ printf ("\t\tSET_NFLG (1);\n");
+ printf ("\t} else {\n");
+ printf ("\t\tuae_s32 newv = (uae_s32)dst / (uae_s32)(uae_s16)src;\n");
+ printf ("\t\tuae_u16 rem = (uae_s32)dst %% (uae_s32)(uae_s16)src;\n");
printf ("\t\tif ((newv & 0xffff8000) != 0 && (newv & 0xffff8000) != 0xffff8000) {\n");
printf ("\t\t\tSET_VFLG (1);\n");
#ifdef UNDEF68020
printf ("\t\t\tnewv = (newv & 0xffff) | ((uae_u32)rem << 16);\n");
printf ("\t\t"); genastore ("newv", curi->dmode, "dstreg", sz_long, "dst");
printf ("\t\t}\n");
- sync_m68k_pc ();
printf ("\t}\n");
+ sync_m68k_pc ();
count_ncycles++;
insn_n_cycles += 156 - (156 - 120) / 2; /* average */
need_endlabel = 1;
extern uae_u16 dmacon;
extern uae_u16 intena, intreq, intreqr;
-extern int vpos;
+extern int vpos, lof_store;
extern int find_copper_record (uaecptr, int *, int *);
extern void notice_resolution_seen (int, bool);
extern void frame_drawn (void);
extern void redraw_frame (void);
+extern bool draw_frame (struct vidbuffer*);
extern int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy, int *prealh);
extern void set_custom_limits (int w, int h, int dx, int dy);
extern void get_custom_topedge (int *x, int *y, bool max);
extern void putpixel (uae_u8 *buf, int bpp, int x, xcolnr c8, int opaq);
+extern void allocvidbuffer (struct vidbuffer *buf, int width, int height, int depth);
+extern void freevidbuffer (struct vidbuffer *buf);
/* Finally, stuff that shouldn't really be shared. */
custmem1_lget, custmem1_wget, ABFLAG_RAM
};
addrbank custmem2_bank = {
- custmem1_lget, custmem1_wget, custmem1_bget,
- custmem1_lput, custmem1_wput, custmem1_bput,
- custmem1_xlate, custmem1_check, NULL, _T("Non-autoconfig RAM #2"),
- custmem1_lget, custmem1_wget, ABFLAG_RAM
+ custmem2_lget, custmem2_wget, custmem2_bget,
+ custmem2_lput, custmem2_wput, custmem2_bput,
+ custmem2_xlate, custmem2_check, NULL, _T("Non-autoconfig RAM #2"),
+ custmem2_lget, custmem2_wget, ABFLAG_RAM
};
#define fkickmem_size 524288
a &= 0xffffffffu;
a |= (uae_s64)m68k_dreg (regs, extra & 7) << 32;
}
- rem = a % (uae_s64)(uae_s32)src;
- quot = a / (uae_s64)(uae_s32)src;
- if ((quot & UVAL64 (0xffffffff80000000)) != 0
- && (quot & UVAL64 (0xffffffff80000000)) != UVAL64 (0xffffffff80000000))
- {
+
+ if (a == 0x8000000000000000 && src == -1) {
SET_VFLG (1);
SET_NFLG (1);
SET_CFLG (0);
} else {
- if (((uae_s32)rem < 0) != ((uae_s64)a < 0)) rem = -rem;
- SET_VFLG (0);
- SET_CFLG (0);
- SET_ZFLG (((uae_s32)quot) == 0);
- SET_NFLG (((uae_s32)quot) < 0);
- m68k_dreg (regs, extra & 7) = (uae_u32)rem;
- m68k_dreg (regs, (extra >> 12) & 7) = (uae_u32)quot;
+ rem = a % (uae_s64)(uae_s32)src;
+ quot = a / (uae_s64)(uae_s32)src;
+ if ((quot & UVAL64 (0xffffffff80000000)) != 0
+ && (quot & UVAL64 (0xffffffff80000000)) != UVAL64 (0xffffffff80000000))
+ {
+ SET_VFLG (1);
+ SET_NFLG (1);
+ SET_CFLG (0);
+ } else {
+ if (((uae_s32)rem < 0) != ((uae_s64)a < 0)) rem = -rem;
+ SET_VFLG (0);
+ SET_CFLG (0);
+ SET_ZFLG (((uae_s32)quot) == 0);
+ SET_NFLG (((uae_s32)quot) < 0);
+ m68k_dreg (regs, extra & 7) = (uae_u32)rem;
+ m68k_dreg (regs, (extra >> 12) & 7) = (uae_u32)quot;
+ }
}
} else {
/* unsigned */
if (ioreq) {
static int cnt = 0;
int cmd = get_word (request + 28);
+#if 0
+ if (cmd == 33) {
+ uaecptr data = get_long (request + 40);
+ write_log (_T("CD_CONFIG:\n"));
+ for (int i = 0; i < 16; i++) {
+ write_log (_T("%08X=%08X\n"), get_long (data), get_long (data + 4));
+ data += 8;
+ }
+ }
+#endif
#if 0
if (cmd == 37) {
cnt--;
r->instruction_pc = m68k_getpc ();
opcode = get_word_ce020_prefetch (0);
+
+#if DEBUG_CD32CDTVIO
+ out_cd32io (r->instruction_pc);
+#endif
+
if (cpu_tracer) {
#if CPUTRACE_DEBUG
data = logicalrange;
else
data = 0;
- //write_log (_T("%d %d: (%d-%d) %d\n"), num, axisnum, did->axismin[axisnum], did->axismax[axisnum], data);
+ //write_log (_T("%d %d: (%d-%d) %d %d\n"), num, axisnum, vcaps->LogicalMin, vcaps->LogicalMax, v, data);
}
buttonaxistype = -1;
}
return cnt;
}
-bool my_resolvesoftlink(TCHAR *linkfile, int size)
-{
- TCHAR tmp[MAX_DPATH];
- if (my_resolvessymboliclink(linkfile, size))
- return true;
- if (my_resolveshortcut(linkfile,size))
- return true;
- _tcscpy (tmp, linkfile);
- my_canonicalize_path (tmp, linkfile, size);
- return false;
-}
-
typedef struct _REPARSE_DATA_BUFFER {
ULONG ReparseTag;
USHORT ReparseDataLength;
};
} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
-bool my_resolvessymboliclink(TCHAR *linkfile, int size)
+static int my_resolvessymboliclink2(TCHAR *linkfile, int size)
{
WIN32_FIND_DATA fd;
HANDLE h;
- bool ret = false;
+ int ret = -1;
DWORD returnedDataSize;
uae_u8 tmp[MAX_DPATH * 2];
TCHAR tmp2[MAX_DPATH];
h = FindFirstFile (linkfile, &fd);
if (h == INVALID_HANDLE_VALUE)
- return false;
+ return -1;
FindClose(h);
if (fd.dwReserved0 != IO_REPARSE_TAG_SYMLINK || !(fd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT))
- return false;
+ return -1;
h = CreateFile (linkfile, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_REPARSE_POINT | FILE_FLAG_OPEN_REPARSE_POINT , NULL);
if (h == INVALID_HANDLE_VALUE)
- return false;
+ return 0;
if (DeviceIoControl(h, FSCTL_GET_REPARSE_POINT, NULL, 0, tmp, sizeof tmp, &returnedDataSize, NULL)) {
REPARSE_DATA_BUFFER *rdb = (REPARSE_DATA_BUFFER*)tmp;
- if (rdb->SymbolicLinkReparseBuffer.Flags & 1) { // SYMLINK_FLAG_RELATIVE
- _tcscpy (tmp2, linkfile);
- PathRemoveFileSpec (tmp2);
- _tcscat (tmp2, _T("\\"));
- TCHAR *p = tmp2 + _tcslen (tmp2);
- memcpy (p,
- (uae_u8*)rdb->SymbolicLinkReparseBuffer.PathBuffer + rdb->SymbolicLinkReparseBuffer.SubstituteNameOffset,
- rdb->SymbolicLinkReparseBuffer.SubstituteNameLength);
- p[rdb->SymbolicLinkReparseBuffer.SubstituteNameLength / 2] = 0;
- } else {
- memcpy (tmp2,
- (uae_u8*)rdb->SymbolicLinkReparseBuffer.PathBuffer + rdb->SymbolicLinkReparseBuffer.SubstituteNameOffset,
- rdb->SymbolicLinkReparseBuffer.SubstituteNameLength);
- tmp2[rdb->SymbolicLinkReparseBuffer.SubstituteNameLength / 2] = 0;
- }
- ret = true;
- if (!_tcsnicmp (tmp2, _T("\\??\\"), 4)) {
- memmove (tmp2, tmp2 + 4, (_tcslen (tmp2 + 4) + 1) * sizeof (TCHAR));
+ if (size > 0) {
+ if (rdb->SymbolicLinkReparseBuffer.Flags & 1) { // SYMLINK_FLAG_RELATIVE
+ _tcscpy (tmp2, linkfile);
+ PathRemoveFileSpec (tmp2);
+ _tcscat (tmp2, _T("\\"));
+ TCHAR *p = tmp2 + _tcslen (tmp2);
+ memcpy (p,
+ (uae_u8*)rdb->SymbolicLinkReparseBuffer.PathBuffer + rdb->SymbolicLinkReparseBuffer.SubstituteNameOffset,
+ rdb->SymbolicLinkReparseBuffer.SubstituteNameLength);
+ p[rdb->SymbolicLinkReparseBuffer.SubstituteNameLength / 2] = 0;
+ } else {
+ memcpy (tmp2,
+ (uae_u8*)rdb->SymbolicLinkReparseBuffer.PathBuffer + rdb->SymbolicLinkReparseBuffer.SubstituteNameOffset,
+ rdb->SymbolicLinkReparseBuffer.SubstituteNameLength);
+ tmp2[rdb->SymbolicLinkReparseBuffer.SubstituteNameLength / 2] = 0;
+ }
+ if (!_tcsnicmp (tmp2, _T("\\??\\"), 4)) {
+ memmove (tmp2, tmp2 + 4, (_tcslen (tmp2 + 4) + 1) * sizeof (TCHAR));
+ }
+ my_canonicalize_path (tmp2, linkfile, size);
}
- my_canonicalize_path (tmp2, linkfile, size);
+ ret = 1;
}
CloseHandle(h);
return ret;
}
+bool my_resolvessymboliclink(TCHAR *linkfile, int size)
+{
+ return my_resolvessymboliclink2(linkfile, size) > 0;
+}
// http://msdn.microsoft.com/en-us/library/aa969393.aspx
bool my_resolveshortcut(TCHAR *linkfile, int size)
if (SUCCEEDED(hres))
{
- my_canonicalize_path (szGotPath, linkfile, size);
+ if (size > 0)
+ my_canonicalize_path (szGotPath, linkfile, size);
ok = SUCCEEDED(hres);
}
}
}
return SUCCEEDED(hres);
}
+
+
+bool my_resolvesoftlink(TCHAR *linkfile, int size)
+{
+ TCHAR tmp[MAX_DPATH];
+ int v = my_resolvessymboliclink2(linkfile, size);
+ if (v > 0)
+ return true;
+ if (v == 0)
+ return false;
+ if (my_resolveshortcut(linkfile,size))
+ return true;
+ if (size > 0) {
+ _tcscpy (tmp, linkfile);
+ my_canonicalize_path (tmp, linkfile, size);
+ }
+ return false;
+}
\ No newline at end of file
HANDLE h = FindFirstFile (aino->nname, &fd);
if (h != INVALID_HANDLE_VALUE) {
FindClose(h);
- if (fd.dwReserved0 == IO_REPARSE_TAG_SYMLINK && (fd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
- aino->softlink = 1;
+ if (fd.dwReserved0 == IO_REPARSE_TAG_SYMLINK && (fd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) && !(fd.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) {
+ if (my_resolvessymboliclink(aino->nname, -1)) {
+ //write_log (_T("1 '%s'\n"), aino->nname);
+ aino->softlink = 1;
+ }
}
}
}
- if (!aino->softlink && !aino->dir) {
+ if (!aino->softlink && !aino->dir && !(mode & FILE_ATTRIBUTE_SYSTEM)) {
const TCHAR *ext = _tcsrchr (aino->nname, '.');
if (ext && !_tcsicmp (ext, _T(".lnk"))) {
TCHAR tmp[MAX_DPATH];
_tcscpy (tmp, aino->nname);
if (my_resolvesoftlink (tmp, sizeof tmp / sizeof (TCHAR))) {
+ //write_log (_T("2 '%s'\n"), aino->nname);
aino->softlink = 2;
}
}
{
struct RPScreenMode *sm = (struct RPScreenMode*)pData;
set_screenmode (sm, &changed_prefs);
+ rp_set_hwnd_delayed ();
return (LRESULT)INVALID_HANDLE_VALUE;
}
case RP_IPC_TO_GUEST_EVENT:
}
case RP_IPC_TO_GUEST_SCREENCAPTURE:
{
- extern int screenshotf (const TCHAR *spath, int mode, int doprepare, int imagemode);
+ extern int screenshotf (const TCHAR *spath, int mode, int doprepare, int imagemode, struct vidbuffer *vb);
extern int screenshotmode;
struct RPScreenCapture *rpsc = (struct RPScreenCapture*)pData;
if (rpsc->szScreenFiltered[0] || rpsc->szScreenRaw[0]) {
screenshotmode = 0;
write_log (_T("'%s' '%s'\n"), rpsc->szScreenFiltered, rpsc->szScreenRaw);
if (rpsc->szScreenFiltered[0])
- ok = screenshotf (rpsc->szScreenFiltered, 1, 1, 0);
- if (rpsc->szScreenRaw[0])
- ok |= screenshotf (rpsc->szScreenRaw, 1, 1, 1);
+ ok = screenshotf (rpsc->szScreenFiltered, 1, 1, 0, NULL);
+ if (rpsc->szScreenRaw[0]) {
+ struct vidbuffer vb;
+ int w = gfxvidinfo.drawbuffer.inwidth;
+ int h = gfxvidinfo.drawbuffer.inheight;
+ if (!programmedmode) {
+ h = (maxvpos + lof_store - minfirstline) << currprefs.gfx_vresolution;
+ }
+ if (interlace_seen && currprefs.gfx_vresolution > 0) {
+ h -= 1 << (currprefs.gfx_vresolution - 1);
+ }
+ allocvidbuffer (&vb, w, h, gfxvidinfo.drawbuffer.pixbytes * 8);
+ set_custom_limits (-1, -1, -1, -1);
+ draw_frame (&vb);
+ ok |= screenshotf (rpsc->szScreenRaw, 1, 1, 1, &vb);
+ //ok |= screenshotf (_T("c:\\temp\\1.bmp"), 1, 1, 1, &vb);
+ freevidbuffer (&vb);
+ }
screenshotmode = ossm;
+ write_log (_T("->%d\n"), ok);
if (!ok)
return RP_SCREENCAPTURE_ERROR;
if (WIN32GFX_IsPicassoScreen ()) {
} else {
ret |= currprefs.gfx_resolution == RES_LORES ? RP_GUESTSCREENFLAGS_HORIZONTAL_LORES : ((currprefs.gfx_resolution == RES_SUPERHIRES) ? RP_GUESTSCREENFLAGS_HORIZONTAL_SUPERHIRES : 0);
ret |= currprefs.ntscmode ? RP_GUESTSCREENFLAGS_MODE_NTSC : RP_GUESTSCREENFLAGS_MODE_PAL;
- ret |= interlace_seen ? RP_GUESTSCREENFLAGS_VERTICAL_INTERLACED : 0;
+ ret |= currprefs.gfx_vresolution ? RP_GUESTSCREENFLAGS_VERTICAL_INTERLACED : 0;
}
return ret;
}
case RP_IPC_TO_GUEST_QUERYSCREENMODE:
{
screenmode_request = 1;
+ write_log (_T("RP_IPC_TO_GUEST_QUERYSCREENMODE -> RP_IPC_TO_HOST_SCREENMODE screenmode_request started\n"));
return 1;
}
case RP_IPC_TO_GUEST_GUESTAPIVERSION:
{
if (!cando ())
return;
- RPSendMessagex (active ? RP_IPC_TO_HOST_ACTIVATED : RP_IPC_TO_HOST_DEACTIVATED, 0, lParam, NULL, 0, &guestinfo, NULL);
+ //RPSendMessagex (active ? RP_IPC_TO_HOST_ACTIVATED : RP_IPC_TO_HOST_DEACTIVATED, 0, lParam, NULL, 0, &guestinfo, NULL);
+ RPPostMessagex (active ? RP_IPC_TO_HOST_ACTIVATED : RP_IPC_TO_HOST_DEACTIVATED, 0, lParam, &guestinfo);
}
void rp_turbo_cpu (int active)
void rp_set_hwnd_delayed (void)
{
hwndset_delay = 4;
+ write_log (_T("RP_IPC_TO_HOST_SCREENMODE delay started\n"));
}
void rp_set_hwnd (HWND hWnd)
if (!initialized)
return;
- hwndset_delay = 0;
+ if (hwndset_delay) {
+ write_log (_T("RP_IPC_TO_HOST_SCREENMODE, delay=%d\n"), hwndset_delay);
+ return;
+ }
+ write_log (_T("RP_IPC_TO_HOST_SCREENMODE\n"));
guestwindow = hWnd;
get_screenmode (&sm, &currprefs);
if (hWnd != NULL)
void rp_screenmode_changed (void)
{
- if (!screenmode_request)
+ write_log (_T("rp_screenmode_changed\n"));
+ if (!screenmode_request) {
screenmode_request = 2;
+ write_log (_T("rp_screenmode_changed -> screenmode_request started\n"));
+ }
}
void rp_set_enabledisable (int enabled)
{
if (!cando ())
return;
- RPSendMessagex (enabled ? RP_IPC_TO_HOST_ENABLED : RP_IPC_TO_HOST_DISABLED, 0, 0, NULL, 0, &guestinfo, NULL);
+ //RPSendMessagex (enabled ? RP_IPC_TO_HOST_ENABLED : RP_IPC_TO_HOST_DISABLED, 0, 0, NULL, 0, &guestinfo, NULL);
+ RPPostMessagex (enabled ? RP_IPC_TO_HOST_ENABLED : RP_IPC_TO_HOST_DISABLED, 0, 0, &guestinfo);
}
void rp_rtg_switch (void)
if (screenmode_request == 0) {
struct RPScreenMode sm = { 0 };
get_screenmode (&sm, &currprefs);
+ write_log (_T("RP_IPC_TO_HOST_SCREENMODE screenmode_request timeout\n"));
RPSendMessagex (RP_IPC_TO_HOST_SCREENMODE, 0, 0, &sm, sizeof sm, &guestinfo, NULL);
}
}
#include "opengl.h"
#include "registry.h"
#include "gfxfilter.h"
+#include "xwin.h"
#include "png.h"
static int rgb_rb, rgb_gb, rgb_bb, rgb_rs, rgb_gs, rgb_bs;
-int screenshot_prepare (int imagemode)
+static int screenshot_prepare (int imagemode, struct vidbuffer *vb)
{
int width, height;
HGDIOBJ hgdiobj;
rgb_bs2 = 0;
rgb_gs2 = 8;
rgb_rs2 = 16;
+ } else if (vb) {
+ width = vb->outwidth;
+ height = vb->outheight;
+ spitch = vb->rowbytes;
+ bits = vb->pixbytes * 8;
+ src = mem = vb->bufmem;
+ rgb_bb2 = rgb_bb;
+ rgb_gb2 = rgb_gb;
+ rgb_rb2 = rgb_rb;
+ rgb_bs2 = rgb_bs;
+ rgb_gs2 = rgb_gs;
+ rgb_rs2 = rgb_rs;
} else {
src = mem = getfilterbuffer (&width, &height, &spitch, &bits);
rgb_bb2 = rgb_bb;
dst -= dpitch;
}
}
- if (WIN32GFX_IsPicassoScreen ())
+ if (WIN32GFX_IsPicassoScreen () && !vb)
freertgbuffer (mem);
} else {
return 0;
}
+int screenshot_prepare (struct vidbuffer *vb)
+{
+ return screenshot_prepare (1, vb);
+}
+int screenshot_prepare (int imagemode)
+{
+ return screenshot_prepare (imagemode, NULL);
+}
int screenshot_prepare (void)
{
return screenshot_prepare (-1);
/*
Captures the Amiga display (DirectDraw, D3D or OpenGL) surface and saves it to file as a 24bit bitmap.
*/
-int screenshotf (const TCHAR *spath, int mode, int doprepare, int imagemode)
+int screenshotf (const TCHAR *spath, int mode, int doprepare, int imagemode, struct vidbuffer *vb)
{
static int recursive;
FILE *fp = NULL;
recursive++;
- if (!screenshot_prepared || doprepare) {
+ if (vb) {
+ if (!screenshot_prepare (vb))
+ goto oops;
+ } else if (!screenshot_prepared || doprepare) {
if (!screenshot_prepare (imagemode))
goto oops;
}
return allok;
}
+#include "drawing.h"
+
void screenshot (int mode, int doprepare)
{
- screenshotf (NULL, mode, doprepare, -1);
+#if 1
+ screenshotf (NULL, mode, doprepare, -1, NULL);
+#else
+ struct vidbuffer vb;
+ int w = gfxvidinfo.drawbuffer.inwidth;
+ int h = gfxvidinfo.drawbuffer.inheight;
+ if (!programmedmode) {
+ h = (maxvpos + lof_store - minfirstline) << currprefs.gfx_vresolution;
+ }
+ if (interlace_seen && currprefs.gfx_vresolution > 0)
+ h -= 1 << (currprefs.gfx_vresolution - 1);
+ allocvidbuffer (&vb, w, h, gfxvidinfo.drawbuffer.pixbytes * 8);
+ set_custom_limits (-1, -1, -1, -1);
+ draw_frame (&vb);
+ screenshotmode = 0;
+ screenshotf (_T("c:\\temp\\1.bmp"), 1, 1, 1, &vb);
+ freevidbuffer (&vb);
+#endif
}
#define LANG_DLL 1
#if WINUAEPUBLICBETA
-#define WINUAEBETA _T("13")
+#define WINUAEBETA _T("14")
#else
#define WINUAEBETA _T("")
#endif
-#define WINUAEDATE MAKEBD(2013, 3, 23)
+#define WINUAEDATE MAKEBD(2013, 3, 30)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
pDwmEnableMMCSS (state);
}
-static void freesoftbuffer (struct vidbuffer *buf)
-{
- xfree (buf->realbufmem);
- memset (buf, 0, sizeof (struct vidbuffer));
-}
-
void close_windows (void)
{
changevblankthreadmode (VBLANKTH_IDLE);
#if defined (GFXFILTER)
S2X_free ();
#endif
- freesoftbuffer (&gfxvidinfo.drawbuffer);
- freesoftbuffer (&gfxvidinfo.tempbuffer);
+ freevidbuffer (&gfxvidinfo.drawbuffer);
+ freevidbuffer (&gfxvidinfo.tempbuffer);
DirectDraw_Release ();
close_hwnds ();
}
#endif
gfxvidinfo.drawbuffer.emergmem = scrlinebuf; // memcpy from system-memory to video-memory
- freesoftbuffer (&gfxvidinfo.drawbuffer);
- freesoftbuffer (&gfxvidinfo.tempbuffer);
+ freevidbuffer (&gfxvidinfo.drawbuffer);
+ freevidbuffer (&gfxvidinfo.tempbuffer);
gfxvidinfo.drawbuffer.realbufmem = NULL;
gfxvidinfo.drawbuffer.bufmem = NULL;
gfxvidinfo.drawbuffer.bufmem_allocated = NULL;
{
case CONFIG_SAVE_FULL:
ok = DiskSelection(hDlg, IDC_SAVE, 5, &workprefs, newpath);
+ GetDlgItemText (hDlg, IDC_EDITNAME, name, MAX_DPATH);
+ _tcscpy (config_filename, name);
break;
case CONFIG_LOAD_FULL:
- if ((ok = DiskSelection(hDlg, IDC_LOAD, 4, &workprefs, newpath)))
+ if ((ok = DiskSelection(hDlg, IDC_LOAD, 4, &workprefs, newpath))) {
EnableWindow(GetDlgItem (hDlg, IDC_VIEWINFO), workprefs.info[0]);
+ GetDlgItemText (hDlg, IDC_EDITNAME, name, MAX_DPATH);
+ _tcscpy (config_filename, name);
+ }
break;
case CONFIG_SAVE:
{ 0, 0, _T("Start minimized"), &workprefs.win32_start_minimized },
{ 0, 1, _T("Minimize when focus is lost"), &workprefs.win32_minimize_inactive },
{ 0, 1, _T("100/120Hz VSync black frame insertion"), &workprefs.lightboost_strobo },
+ { 0, 0, _T("Master floppy write protection"), &workprefs.floppy_read_only },
{ 0, NULL }
};
return 1;
case IDC_NEW_HD:
- memset (¤t_hfdlg, 0, sizeof (current_hfdlg));
+ default_hfdlg (¤t_hfdlg, true);
current_hfdlg.ci.type = UAEDEV_HDF;
if (hdf_init_target () == 0) {
TCHAR tmp[MAX_DPATH];
CheckDlgButton (hDlg, f_wp, chk);
chk = !showcd && state && DISK_validate_filename (&workprefs, text, 0, NULL, NULL, NULL) ? TRUE : FALSE;
if (f_wp >= 0) {
- ew (hDlg, f_wp, chk);
+ ew (hDlg, f_wp, chk && !workprefs.floppy_read_only);
if (f_wptext >= 0)
ew (hDlg, f_wptext, chk);
}
- restore only single input target to default.
+Beta 14:
+
+- A3000 SCSI emulation crashed if no SCSI drives configured.
+- Added previously config-file only master floppy write protection option to GUI misc panel.
+- If Windows softlink or .lnk can't be opened (access denied) or has system attribute flag, handle it as a normal
+ file/directory, just like in older versions.
+- DIVS/DIVL integer overflow crash fix (INT_MIN/-1 = an integer that does not exist, causes cpu overflow exception)
+- GUI Add Hardfile added IDE or SCSI was mounted as a CDROM. (Worked if config was saved and then loaded again)
+- Adjusted read-write-only-custom-register-side-effect in AGA mode. (Artificial Paradise / NGC missing loading screen, does
+ stupid bset #9,$dff104 which, depending on previous accesses, either writes $0200 or "random bits" OR $0200)
+- Manually added custom addmem2 memory region config entry used addmem1's memory region..
+- "Load From"/"Save From" buttons didn't change config name in window title.
+
Beta 13:
- Ignore vendor specific USB usage pages also in received USB HID packets, fixes for example Logitech Precision gamepad ghost button events.