addr &= arram_mask;
m = (uae_u32 *)(armemory_ram + addr);
if (strncmp ("T8", (char*)m, 2) == 0)
- write_log_debug (L"Reading T8 from addr %088x PC=%p\n", addr, m68k_getpc (®s));
+ write_log_debug (L"Reading T8 from addr %08x PC=%p\n", addr, m68k_getpc (®s));
if (strncmp ("LAME", (char*)m, 4) == 0)
write_log_debug (L"Reading LAME from addr %08x PC=%p\n", addr, m68k_getpc (®s));
if (strncmp ("RES1", (char*)m, 4) == 0)
L"ACTION_REPLAY_HIDE",
};
- write_log_debug (L"Action Replay State:(%s)\nHrtmon State:(%s)\n", state[action_replay_flag+3],state[hrtmon_flag+3]);
+ write_log_debug (L"Action Replay State:(%s)\nHrtmon State:(%s)\n",
+ state[action_replay_flag + 3], state[hrtmon_flag + 3]);
if (armemory_rom && armodel == 1) {
if (is_ar_pc_in_ram() || is_ar_pc_in_rom() || action_replay_flag == ACTION_REPLAY_WAIT_PC) {
return 1;
}
-void hrtmon_map_banks ()
+void hrtmon_map_banks (void)
{
uaecptr addr;
map_banks (&hrtmem3_bank, hrtmem3_start >> 16, hrtmem3_size >> 16, 0);
}
-static void hrtmon_unmap_banks ()
+static void hrtmon_unmap_banks (void)
{
uaecptr addr;
int iArVersionMinor = -1;
char* pNext;
uae_char sArDate[11];
- *sArDate = '\0';
+ *sArDate = '\0';
if (!armemory_rom)
return;
}
if (iArVersionMajor > 0) {
- write_log (L"Version of cart is '%d.%.02d', date is '%s'\n", iArVersionMajor, iArVersionMinor, sArDate);
+ TCHAR *s = au (sArDate);
+ write_log (L"Version of cart is '%d.%.02d', date is '%s'\n", iArVersionMajor, iArVersionMinor, s);
+ xfree (s);
}
}
{
int *newdtable;
int *newftable;
+ int *newmtable;
int i;
if (newSize < sb->dtablesize) {
return 0;
}
- newdtable = (int *)malloc(newSize * sizeof(*sb->dtable));
- newftable = (int *)malloc(newSize * sizeof(*sb->ftable));
+ newdtable = (int *)calloc(newSize, sizeof(*sb->dtable));
+ newftable = (int *)calloc(newSize, sizeof(*sb->ftable));
+ newmtable = (int *)calloc(newSize, sizeof(*sb->mtable));
- if (newdtable == NULL || newftable == NULL) {
+ if (newdtable == NULL || newftable == NULL || newmtable == NULL) {
sb->resultval = -1;
bsdsocklib_seterrno(sb, ENOMEM);
+ free (newdtable);
+ free (newftable);
+ free (newmtable);
return -1;
}
memcpy(newdtable, sb->dtable, sb->dtablesize * sizeof(*sb->dtable));
memcpy(newftable, sb->ftable, sb->dtablesize * sizeof(*sb->ftable));
+ memcpy(newmtable, sb->mtable, sb->dtablesize * sizeof(*sb->mtable));
for (i = sb->dtablesize + 1; i < newSize; i++)
newdtable[i] = -1;
sb->dtablesize = newSize;
free(sb->dtable);
free(sb->ftable);
+ free(sb->mtable);
sb->dtable = (SOCKET*)newdtable;
sb->ftable = newftable;
+ sb->mtable = newmtable;
sb->resultval = 0;
return 0;
}
|| cfgfile_intval (option, value, L"gfx_height_fullscreen", &p->gfx_size_fs.height, 1)
|| cfgfile_intval (option, value, L"gfx_refreshrate", &p->gfx_refreshrate, 1)
|| cfgfile_intval (option, value, L"gfx_autoresolution", &p->gfx_autoresolution, 1)
+ || cfgfile_intval (option, value, L"gfx_backbuffers", &p->gfx_backbuffers, 1)
|| cfgfile_intval (option, value, L"gfx_center_horizontal_position", &p->gfx_xcenter_pos, 1)
|| cfgfile_intval (option, value, L"gfx_center_vertical_position", &p->gfx_ycenter_pos, 1)
p->gfx_max_vertical = 1;
p->color_mode = 2;
p->gfx_blackerthanblack = 0;
+ p->gfx_backbuffers = 2;
p->x11_use_low_bandwidth = 0;
p->x11_use_mitshm = 0;
pos = 2;
on_rgb = 0x000000;
off_rgb = 0x000000;
+ if (fps > 999)
+ fps = 999;
num1 = fps / 100;
num2 = (fps - num1 * 100) / 10;
num3 = fps % 10;
op_illg (opcode, regs);
}
+void fpu_reset (void)
+{
+ regs.fpcr = regs.fpsr = regs.fpiar = 0;
+ regs.fp_result = 1;
+ fpux_restore (NULL);
+}
+
uae_u8 *restore_fpu (uae_u8 *src)
{
int i;
extern void action_replay_reset (void);
extern int action_replay_load (void);
-extern void action_replay_memory_reset(void);
+extern void action_replay_memory_reset (void);
extern void action_replay_init (int);
extern void action_replay_cleanup (void);
-extern void action_replay_chipwrite(void);
-extern void action_replay_map_banks(void);
+extern void action_replay_chipwrite (void);
+extern void action_replay_map_banks (void);
extern void REGPARAM3 chipmem_lput_actionreplay23 (uaecptr addr, uae_u32 l) REGPARAM;
extern void REGPARAM3 chipmem_wput_actionreplay23 (uaecptr addr, uae_u32 w) REGPARAM;
extern void REGPARAM3 chipmem_bput_actionreplay1 (uaecptr addr, uae_u32 b) REGPARAM;
extern void REGPARAM3 chipmem_wput_actionreplay1 (uaecptr addr, uae_u32 w) REGPARAM;
extern void REGPARAM3 chipmem_lput_actionreplay1 (uaecptr addr, uae_u32 l) REGPARAM;
-extern void action_replay_version(void);
+extern void action_replay_version (void);
extern void descramble_nordicpro (uae_u8*, int, int);
extern void hrtmon_hide (void);
extern void hrtmon_reset (void);
extern int hrtmon_load (void);
-extern void hrtmon_map_banks(void);
+extern void hrtmon_map_banks (void);
/*extern uae_u8 *hrtmemory;*/
extern uae_u32 hrtmem_start, hrtmem_size;
extern void fpuop_save(uae_u32, struct regstruct *regs);
extern void fpuop_restore(uae_u32, struct regstruct *regs);
extern uae_u32 fpp_get_fpsr (const struct regstruct *regs);
+extern void fpu_reset (void);
+extern void fpux_save (int*);
+extern void fpux_restore (int*);
extern void exception3 (uae_u32 opcode, uaecptr addr, uaecptr fault);
extern void exception3i (uae_u32 opcode, uaecptr addr, uaecptr fault);
int gfx_max_horizontal, gfx_max_vertical;
int gfx_saturation, gfx_luminance, gfx_contrast, gfx_gamma;
int gfx_blackerthanblack;
+ int gfx_backbuffers;
int color_mode;
int gfx_filter;
#define ArchiveFormatLHA 'lha '
#define ArchiveFormatLZX 'lzx '
#define ArchiveFormatPLAIN '----'
+#define ArchiveFormatDIR 'DIR '
#define ArchiveFormatAA 'aa ' // method only
#define ArchiveFormatADF 'DOS '
#define ArchiveFormatRDB 'RDSK'
extern struct zfile *archive_access_rdb (struct znode *zn);
extern struct zvolume *archive_directory_fat (struct zfile *z);
extern struct zfile *archive_access_fat (struct znode *zn);
+extern struct zfile *archive_access_dir (struct znode *zn);
extern struct zfile *archive_access_select (struct znode *parent, struct zfile *zf, unsigned int id, int doselect, int *retcode);
extern struct zfile *archive_access_arcacc_select (struct zfile *zf, unsigned int id, int *retcode);
SET_NFLG (®s.ccrflags, 0);
regs.intmask = 7;
regs.vbr = regs.sfc = regs.dfc = 0;
-#ifdef FPUEMU
- regs.fpcr = regs.fpsr = regs.fpiar = 0;
- regs.fp_result = 1;
regs.irc = 0xffff;
+#ifdef FPUEMU
+ fpu_reset ();
#endif
regs.caar = regs.cacr = 0;
regs.itt0 = regs.itt1 = regs.dtt0 = regs.dtt1 = 0;
static void close_device (int unitnum);
static int open_device (int unitnum);
-static void mcierr(TCHAR *str, DWORD err)
+static void mcierr (TCHAR *str, DWORD err)
{
TCHAR es[1000];
if (err == MMSYSERR_NOERROR)
bsd->asyncsb[i] = NULL;
}
- if (sb->hEvent != NULL)
+ if (sb->hEvent != NULL) {
CloseHandle(sb->hEvent);
+ sb->hEvent = NULL;
+ }
for (i = sb->dtablesize; i--; ) {
if (sb->dtable[i] != INVALID_SOCKET)
host_closesocketquick(sb->dtable[i]);
+ sb->dtable[i] = INVALID_SOCKET;
- if (sb->mtable[i])
+ if (sb->mtable && sb->mtable[i])
bsd->asyncsb[(sb->mtable[i] - 0xb000) / 2] = NULL;
}
closesocket(sb->sockAbort);
free(sb->mtable);
+ sb->mtable = NULL;
}
void host_sbreset(void)
w = *ww;
h = *hh;
- if (!tex_pow2) {
+ if (tex_pow2) {
if (w < 256)
w = 256;
else if (w < 512)
else
h = 8192;
}
+ if (tex_square) {
+ if (w > h)
+ h = w;
+ else
+ w = h;
+ }
if (tex_dynamic) {
hr = IDirect3DDevice9_CreateTexture (d3ddev, w, h, 1, D3DUSAGE_DYNAMIC, format,
D3DPOOL_DEFAULT, &t, NULL);
- } else {
+ if (FAILED (hr))
+ write_log (L"IDirect3DDevice9_CreateTexture() D3DUSAGE_DYNAMIC failed: %s (%d*%d %08x)\n",
+ D3D_ErrorString (hr), w, h, format);
+ }
+ if (!tex_dynamic || (tex_dynamic && FAILED (hr))) {
hr = IDirect3DDevice9_CreateTexture (d3ddev, w, h, 1, 0, format,
D3DPOOL_MANAGED, &t, NULL);
}
if (FAILED (hr)) {
- write_log (L"IDirect3DDevice9_CreateTexture failed: %s\n", D3D_ErrorString (hr));
+ write_log (L"IDirect3DDevice9_CreateTexture() failed: %s (%d*%d %08x)\n",
+ D3D_ErrorString (hr), w, h, format);
return 0;
}
tex_dynamic = TRUE;
if(d3dCaps.PixelShaderVersion >= D3DPS_VERSION(2,0)) {
- if((d3dCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) && tex_dynamic) {
+ if((d3dCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) && tex_dynamic && !tex_pow2 && !tex_square) {
psEnabled = TRUE;
- tex_pow2 = TRUE;
} else {
psEnabled = FALSE;
}
max_texture_w = d3dCaps.MaxTextureWidth;
max_texture_h = d3dCaps.MaxTextureHeight;
- write_log (L"D3D: PS=%d.%d VS=%d.%d Square=%d, Pow2=%d, Tex Size=%d*%d\n",
+ write_log (L"D3D: PS=%d.%d VS=%d.%d Square=%d, Pow2=%d, Dyn=%d, %d*%d\n",
(d3dCaps.PixelShaderVersion >> 8) & 0xff, d3dCaps.PixelShaderVersion & 0xff,
(d3dCaps.VertexShaderVersion >> 8) & 0xff, d3dCaps.VertexShaderVersion & 0xff,
- tex_square, tex_pow2,
+ tex_square, tex_pow2, tex_dynamic,
max_texture_w, max_texture_h);
if (max_texture_w < t_w || max_texture_h < t_h) {
}
}
-static void D3D_render2 (int clear)
+static void D3D_render22 (int clear)
{
HRESULT hr;
+
if (!d3d_enabled)
return;
if (FAILED (IDirect3DDevice9_TestCooperativeLevel (d3ddev)))
hr = IDirect3DDevice9_EndScene (d3ddev);
hr = IDirect3DDevice9_Present (d3ddev, NULL, NULL, NULL, NULL);
+
+}
+
+static void D3D_render2 (int clear)
+{
+ int fpuv;
+
+ fpux_save (&fpuv);
+ D3D_render22 (clear);
+ fpux_restore (&fpuv);
}
void D3D_render (void)
desc.dwFlags = DDSD_CAPS;
desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
if (dxdata.fsmodeset) {
+ int ok = 0;
DWORD oldcaps = desc.ddsCaps.dwCaps;
DWORD oldflags = desc.dwFlags;
desc.dwFlags |= DDSD_BACKBUFFERCOUNT;
desc.ddsCaps.dwCaps |= DDSCAPS_COMPLEX | DDSCAPS_FLIP;
- desc.dwBackBufferCount = 2;
- ddrval = IDirectDraw7_CreateSurface (dxdata.maindd, &desc, &dxdata.primary, NULL);
- if (SUCCEEDED (ddrval)) {
- DDSCAPS2 ddscaps;
- memset (&ddscaps, 0, sizeof (ddscaps));
- ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
- ddrval = IDirectDrawSurface7_GetAttachedSurface (dxdata.primary, &ddscaps, &dxdata.flipping[0]);
- if(SUCCEEDED (ddrval)) {
+ desc.dwBackBufferCount = currprefs.gfx_backbuffers;
+ if (desc.dwBackBufferCount > 0) {
+ ddrval = IDirectDraw7_CreateSurface (dxdata.maindd, &desc, &dxdata.primary, NULL);
+ if (SUCCEEDED (ddrval)) {
+ DDSCAPS2 ddscaps;
memset (&ddscaps, 0, sizeof (ddscaps));
- ddscaps.dwCaps = DDSCAPS_FLIP;
- ddrval = IDirectDrawSurface7_GetAttachedSurface (dxdata.flipping[0], &ddscaps, &dxdata.flipping[1]);
+ ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
+ ddrval = IDirectDrawSurface7_GetAttachedSurface (dxdata.primary, &ddscaps, &dxdata.flipping[0]);
+ if(SUCCEEDED (ddrval)) {
+ if (desc.dwBackBufferCount > 1) {
+ memset (&ddscaps, 0, sizeof (ddscaps));
+ ddscaps.dwCaps = DDSCAPS_FLIP;
+ ddrval = IDirectDrawSurface7_GetAttachedSurface (dxdata.flipping[0], &ddscaps, &dxdata.flipping[1]);
+ }
+ }
+ if (FAILED (ddrval))
+ write_log (L"IDirectDrawSurface7_GetAttachedSurface: %s\n", DXError (ddrval));
+ ok = 1;
}
- if (FAILED (ddrval))
- write_log (L"IDirectDrawSurface7_GetAttachedSurface: %s\n", DXError (ddrval));
- } else {
+ }
+ if (!ok) {
desc.dwBackBufferCount = 0;
desc.ddsCaps.dwCaps = oldcaps;
desc.dwFlags = oldflags;
if (iMajorVersion > 1 || (iMajorVersion == 1 && iMinorVersion > 0)) {
ok = 1;
}
+ alcMakeContextCurrent (NULL);
+ alcDestroyContext (context);
}
- alcMakeContextCurrent (NULL);
- alcDestroyContext (context);
+ alcCloseDevice (pDevice);
}
- alcCloseDevice (pDevice);
} else {
ok = 1;
}
}
}
#endif
+
+static LONG WINAPI ExceptionFilter (struct _EXCEPTION_POINTERS * pExceptionPointers, DWORD ec)
+{
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+
int enumerate_sound_devices (void)
{
if (!num_sound_devices) {
write_log (L"Enumerating DirectSound devices..\n");
DirectSoundEnumerate ((LPDSENUMCALLBACK)DSEnumProc, sound_devices);
DirectSoundCaptureEnumerate ((LPDSENUMCALLBACK)DSEnumProc, record_devices);
- if (isdllversion (L"openal32.dll", 6, 14, 357, 22)) {
- write_log (L"Enumerating OpenAL devices..\n");
- if (alcIsExtensionPresent (NULL, "ALC_ENUMERATION_EXT")) {
- const char* ppDefaultDevice = alcGetString (NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
- const char* pDeviceNames = alcGetString (NULL, ALC_DEVICE_SPECIFIER);
- if (alcIsExtensionPresent (NULL, "ALC_ENUMERATE_ALL_EXT"))
- pDeviceNames = alcGetString (NULL, ALC_ALL_DEVICES_SPECIFIER);
- OpenALEnumerate (sound_devices, pDeviceNames, ppDefaultDevice, FALSE);
- ppDefaultDevice = alcGetString (NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
- pDeviceNames = alcGetString (NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
- OpenALEnumerate (record_devices, pDeviceNames, ppDefaultDevice, TRUE);
+ __try {
+ if (isdllversion (L"openal32.dll", 6, 14, 357, 22)) {
+ write_log (L"Enumerating OpenAL devices..\n");
+ if (alcIsExtensionPresent (NULL, "ALC_ENUMERATION_EXT")) {
+ const char* ppDefaultDevice = alcGetString (NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
+ const char* pDeviceNames = alcGetString (NULL, ALC_DEVICE_SPECIFIER);
+ if (alcIsExtensionPresent (NULL, "ALC_ENUMERATE_ALL_EXT"))
+ pDeviceNames = alcGetString (NULL, ALC_ALL_DEVICES_SPECIFIER);
+ OpenALEnumerate (sound_devices, pDeviceNames, ppDefaultDevice, FALSE);
+ ppDefaultDevice = alcGetString (NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
+ pDeviceNames = alcGetString (NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
+ OpenALEnumerate (record_devices, pDeviceNames, ppDefaultDevice, TRUE);
+ }
}
- }
+ } __except(ExceptionFilter (GetExceptionInformation (), GetExceptionCode ())) {
+ write_log (L"OpenAL enumeration crashed!\n");
+ flush_log ();
+ }
#if PORTAUDIO
- {
+ __try {
HMODULE hm = WIN32_LoadLibrary (L"portaudio_x86.dll");
if (hm) {
TCHAR *s;
if (Pa_GetVersion () >= 1899) {
err = Pa_Initialize ();
if (err == paNoError) {
- PortAudioEnumerate (sound_devices);
+ PortAudioEnumerate (sound_devices);
} else {
s = au (Pa_GetErrorText (err));
- write_log (L"Portaudio initializiation failed: %d (%s)\n",
+ write_log (L"Portaudio initialization failed: %d (%s)\n",
err, s);
xfree (s);
FreeLibrary (hm);
}
} else {
write_log (L"Too old PortAudio library\n");
- FreeLibrary (hm);
+ flush_log ();
+ FreeLibrary (hm);
}
}
+ } __except(ExceptionFilter (GetExceptionInformation (), GetExceptionCode ())) {
+ write_log (L"Portaudio enumeration crashed!\n");
}
#endif
write_log (L"Enumeration end\n");
#include <shlobj.h>
#include <shlwapi.h>
#include <dbghelp.h>
+#include <float.h>
#include "resource"
extern int harddrive_dangerous, do_rdbdump, aspi_allow_all, no_rawinput, rawkeyboard;
int log_scsi, log_net, uaelib_debug;
int pissoff_value = 25000;
+unsigned int fpucontrol;
extern FILE *debugfile;
extern int console_logging;
return 0;
}
+void fpux_save (int *v)
+{
+ *v = _controlfp (fpucontrol, _MCW_IC | _MCW_RC | _MCW_PC);
+}
+void fpux_restore (int *v)
+{
+ if (v)
+ _controlfp (*v, _MCW_IC | _MCW_RC | _MCW_PC);
+ else
+ _controlfp (fpucontrol, _MCW_IC | _MCW_RC | _MCW_PC);
+}
typedef BOOL (CALLBACK* SETPROCESSDPIAWARE)(void);
typedef BOOL (CALLBACK* CHANGEWINDOWMESSAGEFILTER)(UINT, DWORD);
GetProcessAffinityMask (GetCurrentProcess (), &original_affinity, &sys_aff);
thread = GetCurrentThread ();
+ fpucontrol = _controlfp (0, 0) & (_MCW_IC | _MCW_RC | _MCW_PC);
//original_affinity = SetThreadAffinityMask(thread, 1);
#if 0
#define WINUAEPUBLICBETA 1
-#define WINUAEBETA L"Beta 2"
-#define WINUAEDATE MAKEBD(2009, 6, 6)
+#define WINUAEBETA L"Beta 3"
+#define WINUAEDATE MAKEBD(2009, 6, 10)
#define WINUAEEXTRA L""
#define WINUAEREV L""
};
extern struct winuae_lang langs[];
extern HMODULE language_load (WORD language);
+extern unsigned int fpucontrol;
+extern void fpux_save (int *v);
+extern void fpux_restore (int *v);
extern void logging_open (int,int);
extern void logging_cleanup (void);
#include "statusline.h"
#include "drawing.h"
+#include <float.h>
+
struct uae_filter uaefilters[] =
{
{ UAE_FILTER_NULL, 0, 1, L"Null filter", L"null", 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32, 0, 0, 0 },
{ UAE_FILTER_OPENGL, 0, 1, L"OpenGL (unsupported)", L"opengl", 1, 0, 0, 0, 0 },
- { UAE_FILTER_SCALE2X, 0, 2, L"Scale2X", L"scale2x", 0, 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32, 0, 0 },
+ { UAE_FILTER_SCALE2X, 0, 2, L"Scale2X", L"scale2x", 0, 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32, 0, 0, 0 },
{ UAE_FILTER_HQ, 0, 2, L"hq2x/3x/4x", L"hqx", 0, 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 },
float xmult, ymult;
int v;
int extraw, extrah;
-
+ int fpuv;
+
+ fpux_save (&fpuv);
+
getinit ();
ahs2 = vblscale (ah) * scale;
aws = aw * scale;
OffsetRect (zr, -(changed_prefs.gfx_size_win.width - ww + 1) / 2, 0);
filteroffsetx = -zr->left / scale;
filteroffsety = -zr->top / scale;
- return;
+ goto end;
}
dr->left = (temp_width - aws) /2;
filterxmult = diff * 1000 / (dst_width * scale);
diff = dr->bottom - dr->top;
filterymult = diff * 1000 / (dst_height * scale);
- return;
+ goto end;
}
}
filteroffsetx += (dst_width - aw * 1000 / filterxmult) / 2;
filteroffsety += (dst_height - ah * 1000 / filterymult) / 2;
+end:
+ fpux_restore (&fpuv);
+
}
static void statusline (void)
}
endfail:
+
if (ok == 0 && currprefs.gfx_filter) {
usedfilter = &uaefilters[0];
changed_prefs.gfx_filter = usedfilter->type;
pos = 5;
ptr = _tcscpy (drive_text + pos * 16, L"CD");
} else if (led == 7) {
+ double fps = (double)gui_data.fps / 10.0;
extern int p96vblank;
pos = 2;
ptr = drive_text + pos * 16;
+ if (fps > 999.9)
+ fps = 999.9;
if (picasso_on)
- _stprintf (ptr, L"%d [%.1f]", p96vblank, (double)(gui_data.fps / 10.0));
+ _stprintf (ptr, L"%d [%.1f]", p96vblank, fps);
else
- _stprintf (ptr, L"FPS: %.1f", (double)(gui_data.fps / 10.0));
+ _stprintf (ptr, L"FPS: %.1f", fps);
if (pause_emulation)
_tcscpy (ptr, L"PAUSED");
} else if (led == 8) {
+
+Beta 3:
+
+- added exception handler that writes log message if openal or
+ portaudio device enumeration crashes
+- fixed d3d pot/square texture restriction check, only for really
+ old display cards (which may be too slow for d3d filter..)
+- bsdsocket cleanup crash fix (ancient win32-specific bug)
+- gzip decompression problem (yet another unicode conversion bug),
+ also broke built-in hrtmon (which is gzipped internally)
+- reset fpu rounding state to original temporarily when doing filter
+ calculations (single pixel jittering in some filtering modes if
+ Amiga-side code uses FPU and modifies rounding mode)
+
Beta 2:
- fs "double vsync" mode (100Hz+) was still slow in warp mode
}
}
+static void flushconsole (void)
+{
+ if (consoleopen > 0) {
+ fflush (stdout);
+ } else if (realconsole) {
+ fflush (stdout);
+ } else if (consoleopen < 0) {
+ FlushFileBuffers (stdoutput);
+ }
+}
+
void console_out_f (const TCHAR *format,...)
{
va_list parms;
void console_flush (void)
{
+ flushconsole ();
}
static int lfdetected = 1;
{
if (debugfile)
fflush (debugfile);
+ flushconsole ();
}
void f_out (void *f, const TCHAR *format, ...)
s = zfile_open_archive (tmp, 0);
if (!s) {
geterror();
- _tprintf (L"Couldn't open '%s' for reading\n", src);
+ _tprintf (L"Couldn't open '%s' for reading\n", tmp);
continue;
}
zfile_fseek (s, 0, SEEK_END);
if (crclist) {
docrclist (L".");
ok = 1;
- } else if (match) {
+ } else if (!list && match) {
unpack2 (path, match, 0);
ok = 1;
- } else if (!parm2 && all > 0) {
+ } else if (!list && !parm2 && all > 0) {
unpack2 (path, L"*", 0);
ok = 1;
- } else if (extract && parm2) {
+ } else if (!list && extract && parm2) {
unpack2 (path, parm2, 0);
ok = 1;
} else if (argc == 2 || (argc > 2 && list)) {
zfile_fseek (z, size + 2, SEEK_CUR);
}
if (flags & 8) { /* get original file name */
+ uae_char aname[MAX_DPATH];
i = 0;
do {
- zfile_fread (name + i, 1, 1, z);
- } while (i < MAX_DPATH - 1 && name[i++]);
- name[i] = 0;
+ zfile_fread (aname + i, 1, 1, z);
+ } while (i < MAX_DPATH - 1 && aname[i++]);
+ aname[i] = 0;
+ au_copy (name, MAX_DPATH, aname);
}
if (flags & 16) { /* skip comment */
i = 0;
zs.next_in = buffer;
zs.avail_in = zfile_fread (buffer, 1, sizeof (buffer), z);
if (first) {
- if (inflateInit2_ (&zs, -MAX_WBITS, ZLIB_VERSION, sizeof(z_stream)) != Z_OK)
+ if (inflateInit2_ (&zs, -MAX_WBITS, ZLIB_VERSION, sizeof (z_stream)) != Z_OK)
break;
first = 0;
}
if (z->parent) {
uae_s64 v;
uae_s64 size = z->size;
- z = z->parent;
v = zfile_ftell (z);
if (v + l1 * l2 > size) {
if (l1)
if (l2 < 0)
l2 = 0;
}
+ z = z->parent;
}
return fread (b, l1, l2, z->f);
}
TCHAR *zfile_getname (struct zfile *f)
{
- return f->name;
+ return f ? f->name : NULL;
}
TCHAR *zfile_getfilename (struct zfile *f)
{
return zvolume_alloc_2 (zfile_getname (z), z, id, handle, volumename);
}
+struct zvolume *zvolume_alloc_nofile (const TCHAR *name, unsigned int id, void *handle, const TCHAR *volumename)
+{
+ return zvolume_alloc_2 (name, NULL, id, handle, volumename);
+}
struct zvolume *zvolume_alloc_empty (struct zvolume *prev, const TCHAR *name)
{
struct zvolume *zv = zvolume_alloc_2(name, 0, 0, 0, NULL);
struct zvolume *zv = zvolume_list;
while (zv) {
TCHAR *s = zfile_getname (zv->archive);
+ if (!s)
+ s = zv->root.name;
if (_tcslen (path) >= _tcslen (s) && !memcmp (path, s, _tcslen (s) * sizeof (TCHAR)))
return zv;
zv = zv->next;
return zn;
}
+struct zvolume *zfile_fopen_directory (const TCHAR *dirname)
+{
+ struct zvolume *zv = NULL;
+ void *dir;
+ TCHAR fname[MAX_DPATH];
+
+ dir = my_opendir (dirname);
+ if (!dir)
+ return NULL;
+ zv = zvolume_alloc_nofile (dirname, ArchiveFormatDIR, NULL, NULL);
+ while (my_readdir (dir, fname)) {
+ TCHAR fullname[MAX_DPATH];
+ struct _stat64 statbuf;
+ struct zarchive_info zai = { 0 };
+ if (!_tcscmp (fname, L".") || !_tcscmp (fname, L".."))
+ continue;
+ _tcscpy (fullname, dirname);
+ _tcscat (fullname, L"\\");
+ _tcscat (fullname, fname);
+ if (stat (fullname, &statbuf) == -1)
+ continue;
+ zai.name = fname;
+ zai.size = statbuf.st_size;
+ zai.t = statbuf.st_mtime;
+ if (statbuf.st_mode & FILEFLAG_DIR) {
+ zvolume_adddir_abs (zv, &zai);
+ } else {
+ struct znode *zn;
+ zn = zvolume_addfile_abs (zv, &zai);
+ //zfile_fopen_archive_recurse2 (zv, zn);
+ }
+ }
+ my_closedir (dir);
+// zfile_fopen_archive_recurse (zv);
+ if (zv)
+ zvolume_addtolist (zv);
+ return zv;
+}
+
struct zvolume *zfile_fopen_archive (const TCHAR *filename)
{
struct zvolume *zv = NULL;
//int last = 0;
int num, i;
+ if (my_existsdir (filename))
+ return zfile_fopen_directory (filename);
+
num = 1;
lastp = NULL;
for (;;) {
case ArchiveFormatFAT:
zf = archive_access_fat (zn);
break;
+ case ArchiveFormatDIR:
+ zf = archive_access_dir (zn);
+ break;
}
return zf;
}
}
}
zf = zfile_fopen_empty (zn->volume->archive, zn->fullname, zn->size);
- rarunpackzf = zf;
- if (pRARProcessFile (rc->hArcData, RAR_TEST, NULL, NULL)) {
- zfile_fclose (zf);
- zf = NULL;
+ if (zf) {
+ rarunpackzf = zf;
+ if (pRARProcessFile (rc->hArcData, RAR_TEST, NULL, NULL)) {
+ zfile_fclose (zf);
+ zf = NULL;
+ }
}
end:
pRARCloseArchive(rc->hArcData);
}
_tcscat (name2, fname);
zai.name = name2;
+ if (size < 0 || size > 0x7fffffff)
+ size = 0;
zai.size = size;
zai.flags = gl (adf, bs - 48 * 4);
zai.t = put_time (gl (adf, bs - 23 * 4), gl (adf, bs - 22 * 4),gl (adf, bs - 21 * 4));
break;
}
}
+
+struct zfile *archive_access_dir (struct znode *zn)
+{
+ return zfile_fopen (zn->fullname, L"rb", 0);
+}
+