sockdata->sockpoolids[i] = UNIQUE_ID;
}
- if (!init_socket_layer ())
+ if (!init_socket_layer ()) {
+ write_log ("bsdsocket initialization failed\n");
return;
+ }
resname = ds ("bsdsocket.library");
resid = ds ("UAE bsdsocket.library 4.1");
dl (*sockfuncvecs);
org (end);
+
+ write_log ("bsdsocked.library installed\n");
}
#endif /* ! BSDSOCKET */
static uaecptr check_boot_rom (void)
{
+ int i;
uaecptr b = RTAREA_DEFAULT;
addrbank *ab;
if (valid_address (RTAREA_DEFAULT, 65536))
b = RTAREA_BACKUP;
}
- if (nr_directory_units ())
+ if (nr_directory_units (NULL))
return b;
+ if (nr_directory_units (&currprefs))
+ return b;
if (currprefs.socket_emu)
return b;
if (currprefs.uaeserial)
return cnt;
}
-int nr_directory_units (void)
+int nr_directory_units (struct uae_prefs *p)
{
int i, cnt = 0;
- for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
- if (mountinfo.ui[i].open && mountinfo.ui[i].controller == 0)
- cnt++;
+ if (p) {
+ for (i = 0; i < p->mountitems; i++) {
+ if (p->mountconfig[i].controller == 0)
+ cnt++;
+ }
+ } else {
+ for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
+ if (mountinfo.ui[i].open && mountinfo.ui[i].controller == 0)
+ cnt++;
+ }
}
return cnt;
}
extern int is_hardfile (int unit_no);
extern int nr_units (void);
-extern int nr_directory_units (void);
+extern int nr_directory_units (struct uae_prefs*);
extern uaecptr need_uae_boot_rom (void);
struct mountedinfo
int input_joymouse_deadzone;
int input_joystick_deadzone;
int input_joymouse_speed;
+ int input_analog_joystick_mult;
+ int input_analog_joystick_offset;
int input_autofire_framecnt;
int input_mouse_speed;
struct uae_input_device joystick_settings[MAX_INPUT_SETTINGS + 1][MAX_INPUT_DEVICES];
static int parport_joystick_enabled;
static int oldmx[4], oldmy[4];
static int oleft[4], oright[4], otop[4], obot[4];
-static int potgo_hsync;
+
+uae_u16 potgo_value;
+static int pot_cap[2][2];
+static uae_u8 pot_dat[2][2];
+static int pot_dat_act[2][2];
+static int analog_port[2][2];
+#define POTDAT_DELAY 8
static int use_joysticks[MAX_INPUT_DEVICES];
static int use_mice[MAX_INPUT_DEVICES];
cfgfile_write (f, "input.joymouse_speed_digital=%d\n", p->input_joymouse_speed);
cfgfile_write (f, "input.joymouse_deadzone=%d\n", p->input_joymouse_deadzone);
cfgfile_write (f, "input.joystick_deadzone=%d\n", p->input_joystick_deadzone);
+ cfgfile_write (f, "input.analog_joystick_multiplier=%d\n", p->input_analog_joystick_mult);
+ cfgfile_write (f, "input.analog_joystick_offset=%d\n", p->input_analog_joystick_offset);
cfgfile_write (f, "input.mouse_speed=%d\n", p->input_mouse_speed);
cfgfile_write (f, "input.autofire=%d\n", p->input_autofire_framecnt);
for (id = 1; id <= MAX_INPUT_SETTINGS; id++) {
pr->input_mouse_speed = atol (value);
if (!strcasecmp (p, "autofire"))
pr->input_autofire_framecnt = atol (value);
+ if (!strcasecmp (p, "analog_joystick_multiplier"))
+ pr->input_analog_joystick_mult = atol (value);
+ if (!strcasecmp (p, "analog_joystick_offset"))
+ pr->input_analog_joystick_offset = atol (value);
idnum = atol (p);
if (idnum <= 0 || idnum > MAX_INPUT_SETTINGS)
uae_u16 p5dir = 0x0200 << (i * 4); /* output enable P5 */
uae_u16 p5dat = 0x0100 << (i * 4); /* data P5 */
- if (currprefs.cs_cdtvcd) {
- /* CDTV P9 is not floating */
- if (!(potgo_value & p9dir))
- potgor |= p9dat;
- }
-
- if (mouse_port[i]) {
- /* official Commodore mouse has pull-up resistors in button lines
- * NOTE: 3rd party mice may not have pullups! */
- if (!(potgo_value & p5dir))
- potgor |= p5dat;
- if (!(potgo_value & p9dir))
- potgor |= p9dat;
- }
-
- if (potgo_hsync < 0) {
- /* first 10 or so lines after potgo has started
- * forces input-lines to zero
- */
- if (!(potgo_value & p5dir))
- potgor &= ~p5dat;
- if (!(potgo_value & p9dir))
- potgor &= ~p9dat;
- }
-
if (cd32_pad_enabled[i]) {
/* p5 is floating in input-mode */
potgor &= ~p5dat;
if (cd32_shifter[i] >= 2 && (joybutton[i] & ((1 << JOYBUTTON_CD32_PLAY) << (cd32_shifter[i] - 2))))
potgor &= ~p9dat;
} else {
- if (getbuttonstate (i, JOYBUTTON_3))
- potgor &= ~p5dat;
- if (getbuttonstate (i, JOYBUTTON_2))
- potgor &= ~p9dat;
+ potgor &= ~p5dat;
+ if (pot_cap[i][0] > 100)
+ potgor |= p5dat;
+ potgor &= ~p9dat;
+ if (pot_cap[i][1] > 100)
+ potgor |= p9dat;
}
}
return potgor;
}
-uae_u16 potgo_value;
-static uae_u16 potdats[2];
static int inputdelay;
+static void charge_cap (int joy, int idx, int charge)
+{
+ if (charge < -1 || charge > 1)
+ charge = charge * 80;
+ pot_cap[joy][idx] += charge;
+ if (pot_cap[joy][idx] < 0)
+ pot_cap[joy][idx] = 0;
+ if (pot_cap[joy][idx] > 511)
+ pot_cap[joy][idx] = 511;
+}
+
+static int calcexp (int v)
+{
+ return v;
+}
+
void inputdevice_hsync (void)
{
- int joy;
+ int joy, i;
for (joy = 0; joy < 2; joy++) {
- if (potgo_hsync >= 0) {
- int active;
-
- active = 0;
- if ((potgo_value >> 9) & 1) /* output? */
- active = ((potgo_value >> 8) & 1) ? 0 : 1;
- if (potgo_hsync < joydirpot[joy][0])
- active = 1;
- if (getbuttonstate (joy, JOYBUTTON_3))
- active = 1;
- if (active)
- potdats[joy] = ((potdats[joy] + 1) & 0xFF) | (potdats[joy] & 0xFF00);
-
- active = 0;
- if ((potgo_value >> 11) & 1) /* output? */
- active = ((potgo_value >> 10) & 1) ? 0 : 1;
- if (potgo_hsync < joydirpot[joy][1])
- active = 1;
- if (getbuttonstate (joy, JOYBUTTON_2))
- active = 1;
- if (active)
- potdats[joy] += 0x100;
- }
- }
- potgo_hsync++;
- if (potgo_hsync > 255)
- potgo_hsync = 255;
+ for (i = 0; i < 2; i++) {
+ int charge = 0;
+ uae_u16 pdir = 0x0200 << (joy * 4 + i * 2); /* output enable */
+ uae_u16 pdat = 0x0100 << (joy * 4 + i * 2); /* data */
+
+ if (analog_port[joy][i] && pot_cap[joy][i] < calcexp (joydirpot[joy][i]))
+ charge = 1; // slow charge via pot variable resistor
+ if (!(potgo_value & pdir)) { // input?
+ if (pot_dat_act[joy][i])
+ pot_dat[joy][i]++;
+ /* first 8 lines after potgo has started = discharge cap */
+ if (pot_dat_act[joy][i] == 1) {
+ if (pot_dat[joy][i] < POTDAT_DELAY) {
+ charge = -2; /* fast discharge delay */
+ } else {
+ pot_dat_act[joy][i] = 2;
+ pot_dat[joy][i] = 0;
+ }
+ }
+ if (analog_port[joy][i] && pot_dat_act[joy][i] == 2 && pot_cap[joy][i] >= calcexp (joydirpot[joy][i]))
+ pot_dat_act[joy][i] = 0;
+ } else { // output?
+ charge = (potgo_value & pdat) ? 2 : -2; /* fast (dis)charge if output */
+ if ((potgo_value & pdat) && (potgo_value & pdir))
+ pot_dat_act[joy][i] = 0; // instant stop if output+high
+ }
+ if (getbuttonstate (joy, i == 0 ? JOYBUTTON_3 : JOYBUTTON_2))
+ charge = -2; // button press overrides everything
+
+ if (currprefs.cs_cdtvcd) {
+ /* CDTV P9 is not floating */
+ if (!(potgo_value & pdir) && i == 1 && charge == 0)
+ charge = 2;
+ }
+ /* official Commodore mouse has pull-up resistors in button lines
+ * NOTE: 3rd party mice may not have pullups! */
+ if (mouse_port[joy]) {
+ if (charge == 0)
+ charge = 2;
+ }
+
+ charge_cap (joy, i, charge);
+ }
+ }
#ifdef CATWEASEL
catweasel_hsync ();
}
}
+static uae_u16 POTDAT (int joy)
+{
+ uae_u16 v = (pot_dat[joy][0] << 8) | pot_dat[joy][1];
+ if (inputdevice_logging & 16)
+ write_log ("POTDAT%d: %04X %08X\n", joy, v, M68K_GETPC);
+ return v;
+}
+
uae_u16 POT0DAT (void)
{
- return potdats[0];
+ return POTDAT (0);
}
uae_u16 POT1DAT (void)
{
- return potdats[1];
+ return POTDAT (1);
}
/* direction=input, data pin floating, last connected logic level or previous status
void POTGO (uae_u16 v)
{
- int i;
+ int i, j;
if (inputdevice_logging & 16)
- write_log ("POTGO_W: %04X %p\n", v, M68K_GETPC);
+ write_log ("POTGO_W: %04X %08X\n", v, M68K_GETPC);
#ifdef DONGLE_DEBUG
if (notinrom ())
write_log ("POTGO %04X %s\n", v, debuginfo(0));
}
}
if (v & 1) {
- potdats[0] = potdats[1] = 0;
- potgo_hsync = -15;
+ for (i = 0; i < 2; i++) {
+ for (j = 0; j < 2; j++) {
+ pot_dat_act[i][j] = 1;
+ pot_dat[i][j] = 0;
+ }
+ }
}
}
write_log ("POTGOR %04X %s\n", v, debuginfo(0));
#endif
if (inputdevice_logging & 16)
- write_log ("POTGO_R: %04X %d %p\n", v, cd32_shifter[1], M68K_GETPC);
+ write_log ("POTGO_R: %04X %08X %d\n", v, M68K_GETPC, cd32_shifter[1]);
return v;
}
sound_volume (1);
break;
case AKS_VOLMUTE:
- sound_mute (0);
+ sound_mute (-1);
break;
case AKS_MVOLDOWN:
master_sound_volume (-1);
}
if (ie->data & IE_INVERT)
state = -state;
- state = state / 256 + 128;
+ state = state / (312 * 100 / currprefs.input_analog_joystick_mult) + (128 * currprefs.input_analog_joystick_mult / 100) + currprefs.input_analog_joystick_offset;
+ if (state < 0)
+ state = 0;
joydirpot[joy][unit] = state;
} else {
struct input_queue_struct *iq;
int i;
+ if (inputdevice_logging & 32)
+ write_log ("*\n");
+
for (i = 0; i < INPUT_QUEUE_SIZE; i++) {
iq = &input_queue[i];
if (iq->framecnt > 0) {
return 0;
}
+static int isanalog (int ei)
+{
+ if (ei == INPUTEVENT_JOY1_HORIZ_POT || ei == INPUTEVENT_JOY1_HORIZ_POT_INV) {
+ analog_port[0][0] = 1;
+ return 1;
+ }
+ if (ei == INPUTEVENT_JOY1_VERT_POT || ei == INPUTEVENT_JOY1_VERT_POT_INV) {
+ analog_port[0][1] = 1;
+ return 1;
+ }
+ if (ei == INPUTEVENT_JOY2_HORIZ_POT || ei == INPUTEVENT_JOY2_HORIZ_POT_INV) {
+ analog_port[1][0] = 1;
+ return 1;
+ }
+ if (ei == INPUTEVENT_JOY2_VERT_POT || ei == INPUTEVENT_JOY2_VERT_POT_INV) {
+ analog_port[1][1] = 1;
+ return 1;
+ }
+ return 0;
+}
+
static void scanevents(struct uae_prefs *p)
{
int i, j, k, ei;
cd32_pad_enabled[0] = cd32_pad_enabled[1] = 0;
parport_joystick_enabled = 0;
mouse_port[0] = mouse_port[1] = 0;
+
+ for (i = 0; i < 2; i++) {
+ for (j = 0; j < 2; j++) {
+ analog_port[i][j] = 0;
+ joydirpot[i][j] = (128 * currprefs.input_analog_joystick_mult / 100) + currprefs.input_analog_joystick_offset;
+ }
+ }
+
for (i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++)
joydir[i] = 0;
iscd32 (ei);
isparport (ei);
ismouse (ei);
+ isanalog (ei);
if (ei > 0)
use_joysticks[i] = 1;
}
iscd32 (ei);
isparport (ei);
ismouse (ei);
+ isanalog (ei);
if (ei > 0)
use_mice[i] = 1;
}
p->input_joymouse_deadzone = 33;
p->input_joystick_deadzone = 33;
p->input_joymouse_speed = 10;
+ p->input_analog_joystick_mult = 100;
+ p->input_analog_joystick_offset = 0;
p->input_mouse_speed = 100;
p->input_autofire_framecnt = 10;
for (i = 0; i <= MAX_INPUT_SETTINGS; i++) {
return result;
}
-int init_socket_layer(void)
+int init_socket_layer (void)
{
int result = 0;
deinit_socket_layer ();
if (currprefs.socket_emu) {
if((result = mySockStartup())) {
-
if(bsd->hSockThread == NULL) {
WNDCLASS wc; // Set up an invisible window and dummy wndproc
BOOL quit = FALSE;
SB = NULL;
BOOL handled = TRUE;
- int rv;
if (bsd->hSockReq) {
// 100ms sleepiness might need some tuning...
return 0;
}
+ locked.pBits = NULL;
+ locked.Pitch = 0;
hr = IDirect3DTexture9_LockRect (texture, 0, &locked, NULL, D3DLOCK_NO_DIRTY_UPDATE);
if (FAILED (hr)) {
- write_log ("IDirect3DTexture9_LockRect failed: %s\n", D3D_ErrorString (hr));
- D3D_unlocktexture ();
+ if (hr != D3DERR_DRIVERINTERNALERROR) {
+ write_log ("IDirect3DTexture9_LockRect failed: %s\n", D3D_ErrorString (hr));
+ D3D_unlocktexture ();
+ return 0;
+ }
+ }
+ if (locked.pBits == NULL || locked.Pitch == 0) {
+ write_log ("IDirect3DTexture9_LockRect return NULL texture\n");
+ D3D_unlocktexture ();
return 0;
}
gfxvidinfo.bufmem = locked.pBits;
static void flushpixels (void)
{
int i;
- int rowwidth_src = picasso96_state.Width * picasso96_state.BytesPerPixel;
uae_u8 *src = p96ram_start + natmem_offset;
int off = picasso96_state.XYOffset - gfxmem_start;
uae_u8 *src_start = src + (off & ~gwwpagemask);
- uae_u8 *src_end = src + ((off + rowwidth_src * picasso96_state.Height + gwwpagesize - 1) & ~gwwpagemask);
+ uae_u8 *src_end = src + ((off + picasso96_state.BytesPerRow * picasso96_state.Height + gwwpagesize - 1) & ~gwwpagemask);
int maxy = -1;
int miny = picasso96_state.Height - 1;
int lock = 0;
uae_u8 *dst = NULL;
ULONG_PTR gwwcnt;
-
-
+#if 0
+ write_log ("%dx%d %dx%d %dx%d\n", picasso96_state.Width, picasso96_state.Width,
+ picasso96_state.VirtualWidth, picasso96_state.VirtualHeight,
+ picasso_vidinfo.width, picasso_vidinfo.height);
+#endif
if (!picasso_vidinfo.extra_mem || !gwwbuf || src_start >= src_end)
return;
case WM_WINDOWPOSCHANGED:
WIN32GFX_WindowMove ();
- if (hAmigaWnd && isfullscreen () <= 0 && GetWindowRect (hAmigaWnd, &amigawin_rect)) {
- DWORD aw = amigawin_rect.right - amigawin_rect.left;
- DWORD ah = amigawin_rect.bottom - amigawin_rect.top;
+ if (hAmigaWnd && isfullscreen () <= 0) {
+ DWORD aw, ah;
+ if (!IsIconic (hWnd))
+ GetWindowRect (hAmigaWnd, &amigawin_rect);
+ aw = amigawin_rect.right - amigawin_rect.left;
+ ah = amigawin_rect.bottom - amigawin_rect.top;
if (in_sizemove > 0)
break;
#define GETBDD(x) ((x) % 100)
#define WINUAEBETA 1
-#define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2008, 8, 17)
+#define WINUAEPUBLICBETA 2
+#define WINUAEDATE MAKEBD(2008, 8, 23)
#define WINUAEEXTRA ""
#define WINUAEREV ""
ew (hDlg, IDC_FILTERPRESETDELETE, filterpreset_selected > 0 && filterpreset_builtin < 0);
}
-static void makefilter(char *s, int x, int flags)
+static void makefilter (char *s, int x, int flags)
{
sprintf (s, "%dx", x);
if ((flags & (UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32)) == (UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32)) {
&workprefs.gfx_filter_keep_aspect, &workprefs.gfx_filter_aspect,
NULL
};
+static int *filtervars2[] = {
+ NULL, &currprefs.gfx_filter_filtermode,
+ &currprefs.gfx_filter_vert_zoom, &currprefs.gfx_filter_horiz_zoom,
+ &currprefs.gfx_filter_vert_zoom_mult, &currprefs.gfx_filter_horiz_zoom_mult,
+ &currprefs.gfx_filter_vert_offset, &currprefs.gfx_filter_horiz_offset,
+ &currprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlineratio,
+ &currprefs.gfx_resolution, &currprefs.gfx_linedbl, &currprefs.gfx_correct_aspect,
+ &currprefs.gfx_xcenter, &currprefs.gfx_ycenter,
+ &currprefs.gfx_filter_luminance, &currprefs.gfx_filter_contrast, &currprefs.gfx_filter_saturation,
+ &currprefs.gfx_filter_gamma, &currprefs.gfx_filter_blur, &currprefs.gfx_filter_noise,
+ &currprefs.gfx_filter_keep_aspect, &currprefs.gfx_filter_aspect,
+ NULL
+ };
struct filterpreset {
char *name;
*t++ = 0;
for (i = 0; filtervars[i]; i++) {
*(filtervars[i]) = atol(s);
+ if (filtervars2[i])
+ *(filtervars2[i]) = *(filtervars[i]);
s = t;
t = strchr (s, ',');
if (!t)
}
end:
regclosetree (fkey);
+ enable_for_hw3ddlg (hDlg);
if (load) {
values_to_hw3ddlg (hDlg);
SendMessage (hDlg, WM_HSCROLL, 0, 0);
}
- enable_for_hw3ddlg (hDlg);
}
static void filter_handle (HWND hDlg)
case IDC_FILTERPRESETLOAD:
case IDC_FILTERPRESETSAVE:
case IDC_FILTERPRESETDELETE:
+ recursive--;
filter_preset (hDlg, wParam);
+ recursive++;
break;
case IDC_FILTERENABLE:
filter_handle (hDlg);
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib capsimg.lib dxerr9.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib wpcap.lib packet.lib"
+ AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib capsimg.lib dxerr9.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib wpcap.lib packet.lib openal32.lib"
ShowProgress="0"
OutputFile="d:\amiga\winuae.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateManifest="false"
- DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_39.dll"
+ DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_39.dll;openal32.dll"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/winuae.pdb"
SubSystem="2"
+Beta 2:
+
+- RTG mode and width set to bigger than resolution (autoscroll)
+ = bottom part of display was not updated (1.5.0)
+- windowed mode minimize and restore, only title bar was visible
+- mute on/off inputevent fixed
+- added analog joystick emulation multiplier and offset config
+ entries (not in GUI yet)
+- analog joystick emulation improvements, pot line (=2nd/3rd
+ firebutton) capacitor charging/discharging emulated. Not yet
+ perfect, F19 Stealth Fighter still not working in analog joy mode.
+- directory harddrive/uaehf.device hardfile didn't enable
+ uaelib hooks (used by uae-configuration/uaectrl)
+- added log message if bsdsocket host-side initialization fails
+- filter preset load didn't redraw the display using new parameters
+
Beta 1: (crashing bug = this will be quick beta series, really!)
- 4th floppy drive track display number was clipped in windowed mode
- non-vsync RTG mode run in "warp"-mode if native mode was set to
fullscreen+vsync
- USB "non-friendly" name buffer overflow, caused random crashes
- and weird behavior.. (1.5.1)
+ and weird behavior, including uae-configuration issue. (1.5.1)
+- sprite garbage was possible if sprite(s) active during resolution
+ change from higher to lower resolution (AGA only) (1.5.0)
- OpenAL sound support (experimental, OpenAL may be better API for
new AHI driver than DSound) Note that OpenAL uses internally
DirectSound if sound card does not have native OpenAL support.
devices only available if OpenAL is installed. DO NOT ASK something
like "What is OpenAL". Learn to use search engines first or ignore
this feature.
-- sprite garbage was possible if sprite(s) active during resolution
- change from higher to lower resolution (AGA only) (1.5.0)
Final 1.5.1