static int cdrom_command_something (void)
{
+ int v = cdrom_command_buffer[1];
+ if (v & 0x80)
+ return 1;
return 0;
}
int len;
cdrom_command_offset_complete = (cdrom_command_offset_complete + cdrom_command_length + 1) & 0xff;
- memset (cdrom_result_buffer, 0, sizeof(cdrom_result_buffer));
+ memset (cdrom_result_buffer, 0, sizeof (cdrom_result_buffer));
switch (cdrom_command & 0x0f)
{
case 2:
cdp->pt = cdp->lc;
cdp->intreq2 = 1;
if (sampleripper_enabled)
- do_samplerip(cdp);
+ do_samplerip (cdp);
#ifdef DEBUG_AUDIO
if (debugchannel (cdp - audio_channel))
write_log ("Channel %d looped, LC=%08X LEN=%d\n", cdp - audio_channel, cdp->pt, cdp->wlen);
int napnav = (!audav && !audap) || audav;
int evtime = cdp->evtime;
- audio_activate();
+ audio_activate ();
cdp->evtime = MAX_EV;
switch (cdp->state)
{
int nr, handle;
static int old_dma;
- if (!isaudio())
+ if (!isaudio ())
return;
if (old_dma != (dmacon & (DMA_MASTER | 15))) {
old_dma = dmacon & (DMA_MASTER | 15);
- audio_activate();
+ audio_activate ();
}
if (audio_work_to_do > 0 && currprefs.sound_auto) {
audio_work_to_do--;
if (audio_work_to_do == 0)
- audio_deactivate();
+ audio_deactivate ();
}
- if (!is_audio_active())
+ if (!is_audio_active ())
return;
update_audio ();
if (cdp->state == 5) {
cdp->pt = cdp->lc;
if (sampleripper_enabled)
- do_samplerip(cdp);
+ do_samplerip (cdp);
#ifdef DEBUG_AUDIO
if (debugchannel (nr))
write_log ("%d:>5: LEN=%d PT=%08X\n", nr, cdp->wlen, cdp->pt);
p->produce_sound = 2;
p->cachesize = 8192;
p->dfxtype[0] = DRV_35_HD;
- p->dfxtype[1] = DRV_35_HD;
p->floppy_speed = 0;
p->cpu_idle = 150;
p->cs_compatible = CP_A3000;
uae_u16 dmacon;
uae_u16 adkcon; /* used by audio code */
-static uae_u32 cop1lc,cop2lc,copcon;
+static uae_u32 cop1lc, cop2lc, copcon;
int maxhpos = MAXHPOS_PAL;
int maxvpos = MAXVPOS_PAL;
};
static int plffirstline, plflastline;
-static int plfstrt, plfstop;
+static int plfstrt_start, plfstrt, plfstop;
static int sprite_minx, sprite_maxx;
static int first_bpl_vpos;
static int last_diw_pix_hpos, last_ddf_pix_hpos;
#endif
static struct decision thisline_decision;
-static int passed_plfstop, fetch_cycle, fetch_modulo_cycle;
+static int fetch_cycle, fetch_modulo_cycle;
+
+enum plfstate
+{
+ plf_idle,
+ plf_start,
+ plf_active,
+ plf_passed_stop,
+ plf_passed_stop2,
+ plf_end
+} plfstate;
enum fetchstate {
fetch_not_started,
#ifdef NEWHSYNC
#define HARD_DDF_STOP 0xd8
-#define HARD_DDF_START 0x14
+#define HARD_DDF_START 0x18
#else
/* The HRM says 0xD8, but that can't work... */
#define HARD_DDF_STOP 0xd4
{
int fetchunit = fetchunits[fetchmode * 4 + bplcon0_res];
- if (! passed_plfstop) {
+ if (plfstate < plf_passed_stop) {
int stop = plfstop < hpos || plfstop > HARD_DDF_STOP ? HARD_DDF_STOP : plfstop;
/* We know that fetching is up-to-date up until hpos, so we can use fetch_cycle. */
int fetch_cycle_at_stop = fetch_cycle + (stop - hpos);
estimated_last_fetch_cycle = hpos + (starting_last_block_at - fetch_cycle) + fetchunit;
} else {
int starting_last_block_at = (fetch_cycle + fetchunit - 1) & ~(fetchunit - 1);
- if (passed_plfstop == 2)
+ if (plfstate == plf_passed_stop2)
starting_last_block_at -= fetchunit;
estimated_last_fetch_cycle = hpos + (starting_last_block_at - fetch_cycle) + fetchunit;
STATIC_INLINE void compute_delay_offset (void)
{
- delayoffset = (16 << fetchmode) - (((plfstrt - HARD_DDF_START) & fetchstart_mask) << 1);
+#ifdef NEWHSYNC
+ int v = 4;
+#else
+ int v = 0;
+#endif
+ delayoffset = (16 << fetchmode) - (((plfstrt - v - HARD_DDF_START) & fetchstart_mask) << 1);
#if 0
/* maybe we can finally get rid of this stupid table.. */
if (tmp == 4)
break;
#endif
}
- if (passed_plfstop == 2 && fetch_cycle >= (fetch_cycle & ~fetchunit_mask) + fetch_modulo_cycle) {
+ if (plfstate == plf_passed_stop2 && fetch_cycle >= (fetch_cycle & ~fetchunit_mask) + fetch_modulo_cycle) {
int mod;
if (fmode & 0x4000) {
if (((diwstrt >> 8) ^ vpos) & 1)
toscr_1 (16, fm);
toscr_1 (16, fm);
+
+ if (fm == 2) {
+ /* flush full 64-bits */
+ i += 32;
+ toscr_1 (16, fm);
+ toscr_1 (16, fm);
+ }
+
return i >> (1 + toscr_res);
}
{
if (thisline_decision.plfleft == -1)
return;
- if (passed_plfstop == 3)
+ if (plfstate == plf_end)
return;
- passed_plfstop = 3;
+ plfstate = plf_end;
ddfstate = DIW_waiting_start;
i += flush_plane_data (fm);
thisline_decision.plfright = i;
STATIC_INLINE int one_fetch_cycle_0 (int i, int ddfstop_to_test, int dma, int fm)
{
- if (! passed_plfstop && i == ddfstop_to_test)
- passed_plfstop = 1;
+ if (plfstate < plf_passed_stop && i == ddfstop_to_test)
+ plfstate = plf_passed_stop;
if ((fetch_cycle & fetchunit_mask) == 0) {
- if (passed_plfstop == 2) {
+ if (plfstate == plf_passed_stop2) {
finish_final_fetch (i, fm);
return 1;
}
- if (passed_plfstop)
- passed_plfstop++;
+ if (plfstate >= plf_passed_stop)
+ plfstate++;
}
if (dma) {
int ddfstop_to_test;
- if (nodraw() || passed_plfstop == 3)
+ if (nodraw() || plfstate == plf_end)
return;
/* We need an explicit test against HARD_DDF_STOP here to guard against
#ifdef SPEEDUP
/* Unrolled version of the for loop below. */
- if (! passed_plfstop && ddf_change != vpos && ddf_change + 1 != vpos
+ if (plfstate < plf_passed_stop && ddf_change != vpos && ddf_change + 1 != vpos
&& dma
&& (fetch_cycle & fetchstart_mask) == (fm_maxplane & fetchstart_mask)
&& toscr_delay1 == toscr_delay1x && toscr_delay2 == toscr_delay2x
maybe_first_bpl1dat (pos);
if (pos <= ddfstop_to_test && pos + count > ddfstop_to_test)
- passed_plfstop = 1;
+ plfstate = plf_passed_stop;
if (pos <= ddfstop_to_test && pos + count > ddf2)
- passed_plfstop = 2;
+ plfstate = plf_passed_stop2;
if (pos <= ddf2 && pos + count >= ddf2 + fm_maxplane)
add_modulos ();
pos += count;
}
} else {
#endif
- //maybe_first_bpl1dat (pos);
#ifdef SPEEDUP
}
#endif
if (hpos > plfstop - fetchunit)
return;
if (ddfstate != DIW_waiting_start)
- passed_plfstop = 1;
+ plfstate = plf_passed_stop;
start_bpl_dma (hpos, hpos);
}
if (dmaen (DMA_BITPLANE) && diwstate == DIW_waiting_stop) {
int ok = 0;
- /* Test if we passed the start of the DDF window. */
+ if (last_decide_line_hpos < plfstrt_start && hpos >= plfstrt_start) {
+ if (plfstate == plf_idle)
+ plfstate = plf_start;
+ }
if (last_decide_line_hpos < plfstrt && hpos >= plfstrt) {
- ok = 1;
+ if (plfstate == plf_start)
+ plfstate = plf_active;
+ if (plfstate == plf_active)
+ ok = 1;
/* hack warning.. Writing to DDFSTRT when DMA should start must be ignored
* (correct fix would be emulate this delay for every custom register, but why bother..) */
if (hpos - 2 == ddfstrt_old_hpos && ddfstrt_old_vpos == vpos)
ok = 0;
- if (ok) {
- start_bpl_dma (hpos, plfstrt);
- estimate_last_fetch_cycle (plfstrt);
- last_decide_line_hpos = hpos;
+ }
+ if (ok) {
+ start_bpl_dma (hpos, plfstrt);
+ estimate_last_fetch_cycle (plfstrt);
+ last_decide_line_hpos = hpos;
#ifndef CUSTOM_SIMPLE
- do_sprites (plfstrt);
+ do_sprites (plfstrt);
#endif
- return;
- }
+ return;
}
}
{
//magic_centering (regno, value, vpos);
if (regno == 0x100) {
- if (passed_plfstop >= 3)
+ if (plfstate >= plf_end)
return;
if (value & 0x800)
thisline_decision.ham_seen = 1;
last_sprite_point = 0;
fetch_state = fetch_not_started;
- passed_plfstop = 0;
+
+ if (plfstate > plf_active)
+ plfstate = plf_idle;
+ if (plfstate == plf_active && !(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
+ plfstate = plf_idle;
memset (todisplay, 0, sizeof todisplay);
memset (fetched, 0, sizeof fetched);
plfstrt += 4;
plfstop += 4;
#endif
- /* probably not the correct place.. */
+ /* probably not the correct place.. should use plfstate instead */
if (currprefs.chipset_mask & CSMASK_ECS_AGNUS) {
/* ECS/AGA and ddfstop > maxhpos == always-on display */
if (plfstop > maxhpos)
plfstrt = 0;
+ if (plfstrt < HARD_DDF_START)
+ plfstrt = HARD_DDF_START;
+ plfstrt_start = plfstrt - 4;
} else {
- /* OCS and ddfstop >= ddfstrt == ddsftop = max */
- if (plfstrt >= plfstop)
+ /* OCS and ddfstrt >= ddfstop == ddfstop = max */
+ if (plfstrt >= plfstop && plfstrt >= HARD_DDF_START)
plfstop = 0xff;
+ plfstrt_start = HARD_DDF_START - 2;
}
- if (plfstrt < HARD_DDF_START)
- plfstrt = HARD_DDF_START;
}
/* display mode changed (lores, doubling etc..), recalculate everything */
{
if (fetch_state == fetch_not_started || hpos < thisline_decision.plfleft)
return 0;
- if ((passed_plfstop == 3 && hpos >= thisline_decision.plfright)
+ if ((plfstate == plf_end && hpos >= thisline_decision.plfright)
|| hpos >= estimated_last_fetch_cycle)
return 0;
return curr_diagram[(hpos - cycle_diagram_shift) & fetchstart_mask];
{
if (fetch_state == fetch_not_started || hpos < thisline_decision.plfleft)
return 0;
- if ((passed_plfstop == 3 && hpos >= thisline_decision.plfright)
+ if ((plfstate == plf_end && hpos >= thisline_decision.plfright)
|| hpos >= estimated_last_fetch_cycle)
return 0;
return curr_diagram[(hpos - cycle_diagram_shift) & fetchstart_mask];
{
decide_line (hpos);
decide_fetch (hpos);
- bplpt[num] = (bplpt[num] & 0xffff) | ((uae_u32)v << 16);
+ bplpt[num] = (bplpt[num] & 0x0000ffff) | ((uae_u32)v << 16);
//write_log ("%d:%d:BPL%dPTH %08X\n", hpos, vpos, num, v);
}
static void BPLxPTL (int hpos, uae_u16 v, int num)
decide_fetch (hpos);
/* fix for "bitplane dma fetch at the same time while updating BPLxPTL" */
/* fixes "3v Demo" by Cave and "New Year Demo" by Phoenix */
- if (is_bitplane_dma(hpos - 1) == num + 1 && num > 0)
+ if (is_bitplane_dma (hpos - 1) == num + 1 && num > 0) {
delta = 2 << fetchmode;
- bplpt[num] = (bplpt[num] & ~0xffff) | ((v + delta) & 0xfffe);
+ }
+ bplpt[num] = (bplpt[num] & 0xffff0000) | ((v + delta) & 0x0000fffe);
//write_log ("%d:%d:BPL%dPTL %08X\n", hpos, vpos, num, v);
}
decide_blitter (hpos);
memset (cycle_line, 0, sizeof cycle_line);
#ifdef NEWHSYNC
- alloc_cycle (5, CYCLE_REFRESH); /* strobe */
+ alloc_cycle (3, CYCLE_REFRESH); /* strobe */
+ alloc_cycle (5, CYCLE_REFRESH);
alloc_cycle (7, CYCLE_REFRESH);
alloc_cycle (9, CYCLE_REFRESH);
- alloc_cycle (11, CYCLE_REFRESH);
#else
alloc_cycle (1, CYCLE_REFRESH); /* strobe */
alloc_cycle (3, CYCLE_REFRESH);
}
}
}
-void driveclick_init(void)
+void driveclick_init (void)
{
int v, vv, i, j;
char tmp[MAX_DPATH];
void driveclick_reset (void)
{
xfree (clickbuffer);
+ clickbuffer = NULL;
if (!wave_initialized)
return;
clickbuffer = xmalloc (sndbufsize);
for (i = 0; i < 4; i++) {
for (j = 0; j < DS_END; j++)
freesample (&drvs[i][j]);
+ drv_starting[i] = 0;
+ drv_spinning[i] = 0;
+ drv_has_spun[i] = 0;
+ drv_has_disk[i] = 0;
}
memset (drvs, 0, sizeof (drvs));
xfree (clickbuffer);
wave_initialized = 0;
}
-static int driveclick_active(void)
+static int driveclick_active (void)
{
int i;
for (i = 0; i < 4; i++) {
return 0;
}
-STATIC_INLINE uae_s16 getsample(void)
+STATIC_INLINE uae_s16 getsample (void)
{
uae_s32 smp = 0;
int div = 0, i;
}
}
-static void dr_audio_activate(void)
+static void dr_audio_activate (void)
{
if (audio_activate ())
clickcnt = 0;
printf ("\tif ((format & 0xF000) == 0x0000) { break; }\n");
printf ("\telse if ((format & 0xF000) == 0x1000) { ; }\n");
printf ("\telse if ((format & 0xF000) == 0x2000) { m68k_areg (regs, 7) += 4; break; }\n");
+ printf ("\telse if ((format & 0xF000) == 0x4000) { m68k_areg (regs, 7) += 8; break; }\n");
printf ("\telse if ((format & 0xF000) == 0x8000) { m68k_areg (regs, 7) += 50; break; }\n");
printf ("\telse if ((format & 0xF000) == 0x7000) { m68k_areg (regs, 7) += 52; break; }\n");
printf ("\telse if ((format & 0xF000) == 0x9000) { m68k_areg (regs, 7) += 12; break; }\n");
uae_u8 bplres;
unsigned int ham_seen:1;
unsigned int ham_at_start:1;
-// unsigned int valid:1;
};
/* Anything related to changes in hw registers during the DDF for one
#define UAEMAJOR 1
#define UAEMINOR 5
-#define UAESUBREV 2
+#define UAESUBREV 3
typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang;
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 digital_port[2][2];
+#define POTDAT_DELAY_PAL 8
+#define POTDAT_DELAY_NTSC 7
static int use_joysticks[MAX_INPUT_DEVICES];
static int use_mice[MAX_INPUT_DEVICES];
if (cd32_shifter[i] >= 2 && (joybutton[i] & ((1 << JOYBUTTON_CD32_PLAY) << (cd32_shifter[i] - 2))))
potgor &= ~p9dat;
} else {
+
potgor &= ~p5dat;
if (pot_cap[i][0] > 100)
potgor |= p5dat;
+
potgor &= ~p9dat;
if (pot_cap[i][1] > 100)
potgor |= p9dat;
+
}
}
return potgor;
pot_cap[joy][idx] = 511;
}
-static int calcexp (int v)
-{
- return v;
-}
-
void inputdevice_hsync (void)
{
int joy, i;
int charge = 0;
uae_u16 pdir = 0x0200 << (joy * 4 + i * 2); /* output enable */
uae_u16 pdat = 0x0100 << (joy * 4 + i * 2); /* data */
+ int isbutton = getbuttonstate (joy, i == 0 ? JOYBUTTON_3 : JOYBUTTON_2);
- if (analog_port[joy][i] && pot_cap[joy][i] < calcexp (joydirpot[joy][i]))
+ if (analog_port[joy][i] && pot_cap[joy][i] < joydirpot[joy][i])
charge = 1; // slow charge via pot variable resistor
+ if (digital_port[joy][i])
+ charge = 1; // slow charge via pull-up 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 */
+ /* first 8 lines after potgo has been started = discharge cap */
if (pot_dat_act[joy][i] == 1) {
- if (pot_dat[joy][i] < POTDAT_DELAY) {
+ if (pot_dat[joy][i] < (currprefs.ntscmode ? POTDAT_DELAY_NTSC : POTDAT_DELAY_PAL)) {
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]))
+ if (analog_port[joy][i] && pot_dat_act[joy][i] == 2 && pot_cap[joy][i] >= joydirpot[joy][i])
pot_dat_act[joy][i] = 0;
+ if (digital_port[joy][i] && pot_dat_act[joy][i] == 2) {
+ if (pot_cap[joy][i] >= 10 && !isbutton)
+ 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))
+ if (isbutton)
charge = -2; // button press overrides everything
if (currprefs.cs_cdtvcd) {
}
/* 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;
- }
+ if (mouse_port[joy] && charge == 0)
+ charge = 2;
+ /* emulate pullup resistor if button mapped because there too many broken
+ * programs that read second button in input-mode (and most 2+ button pads have
+ * pullups)
+ */
+ if (digital_port[joy][i] && charge == 0)
+ charge = 2;
charge_cap (joy, i, charge);
}
static uae_u16 POTDAT (int joy)
{
- uae_u16 v = (pot_dat[joy][0] << 8) | pot_dat[joy][1];
+ uae_u16 v = (pot_dat[joy][1] << 8) | pot_dat[joy][0];
if (inputdevice_logging & 16)
write_log ("POTDAT%d: %04X %08X\n", joy, v, M68K_GETPC);
return v;
return 0;
}
+static int isdigitalbutton (int ei)
+{
+ if (ei == INPUTEVENT_JOY1_2ND_BUTTON) {
+ digital_port[0][0] = 1;
+ return 1;
+ }
+ if (ei == INPUTEVENT_JOY1_3RD_BUTTON) {
+ digital_port[0][1] = 1;
+ return 1;
+ }
+ if (ei == INPUTEVENT_JOY2_2ND_BUTTON) {
+ digital_port[1][0] = 1;
+ return 1;
+ }
+ if (ei == INPUTEVENT_JOY2_3RD_BUTTON) {
+ digital_port[1][1] = 1;
+ return 1;
+ }
+ return 0;
+}
+
static void scanevents(struct uae_prefs *p)
{
int i, j, k, ei;
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
+ digital_port[i][j] = 0;
analog_port[i][j] = 0;
- joydirpot[i][j] = (128 * currprefs.input_analog_joystick_mult / 100) + currprefs.input_analog_joystick_offset;
+ joydirpot[i][j] = 128 / (312 * 100 / currprefs.input_analog_joystick_mult) + (128 * currprefs.input_analog_joystick_mult / 100) + currprefs.input_analog_joystick_offset;
}
}
iscd32 (ei);
isparport (ei);
ismouse (ei);
+ isdigitalbutton (ei);
if (joysticks[i].eventid[ID_BUTTON_OFFSET + j][k] > 0)
use_joysticks[i] = 1;
}
iscd32 (ei);
isparport (ei);
ismouse (ei);
+ isdigitalbutton (ei);
if (mice[i].eventid[ID_BUTTON_OFFSET + j][k] > 0)
use_mice[i] = 1;
}
isparport (ei);
ismouse (ei);
isanalog (ei);
+ isdigitalbutton (ei);
if (ei > 0)
use_joysticks[i] = 1;
}
isparport (ei);
ismouse (ei);
isanalog (ei);
+ isdigitalbutton (ei);
if (ei > 0)
use_mice[i] = 1;
}
iscd32 (ei);
isparport (ei);
ismouse (ei);
+ isdigitalbutton (ei);
}
j++;
}
DEFEVENT(JOY1_HORIZ,"Joy1 Horizontal",AM_JOY_AXIS,0,1,DIR_LEFT|DIR_RIGHT)
DEFEVENT(JOY1_VERT,"Joy1 Vertical",AM_JOY_AXIS,0,1,DIR_UP|DIR_DOWN)
-DEFEVENT(JOY1_HORIZ_POT,"Joy1 Horizontal (Analog)",AM_JOY_AXIS,128,1,0)
-DEFEVENT(JOY1_VERT_POT,"Joy1 Vertical (Analog)",AM_JOY_AXIS,128,1,1)
-DEFEVENT(JOY1_HORIZ_POT_INV,"Joy1 Horizontal (Analog, inverted)",AM_JOY_AXIS,128,1,0|IE_INVERT)
-DEFEVENT(JOY1_VERT_POT_INV,"Joy1 Vertical (Analog, inverted)",AM_JOY_AXIS,128,1,1|IE_INVERT)
+DEFEVENT(JOY1_HORIZ_POT,"Joy1 Horizontal (Analog)",AM_JOY_AXIS,128,1,1)
+DEFEVENT(JOY1_VERT_POT,"Joy1 Vertical (Analog)",AM_JOY_AXIS,128,1,0)
+DEFEVENT(JOY1_HORIZ_POT_INV,"Joy1 Horizontal (Analog, inverted)",AM_JOY_AXIS,128,1,1|IE_INVERT)
+DEFEVENT(JOY1_VERT_POT_INV,"Joy1 Vertical (Analog, inverted)",AM_JOY_AXIS,128,1,0|IE_INVERT)
DEFEVENT(JOY1_LEFT,"Joy1 Left",AM_K,16,1,DIR_LEFT)
DEFEVENT(JOY1_RIGHT,"Joy1 Right",AM_K,16,1,DIR_RIGHT)
DEFEVENT(JOY2_HORIZ,"Joy2 Horizontal",AM_JOY_AXIS,0,2,DIR_LEFT|DIR_RIGHT)
DEFEVENT(JOY2_VERT,"Joy2 Vertical",AM_JOY_AXIS,0,2,DIR_UP|DIR_DOWN)
-DEFEVENT(JOY2_HORIZ_POT,"Joy2 Horizontal (Analog)",AM_JOY_AXIS,128,2,0)
-DEFEVENT(JOY2_VERT_POT,"Joy2 Vertical (Analog)",AM_JOY_AXIS,128,2,1)
-DEFEVENT(JOY2_HORIZ_POT_INV,"Joy2 Horizontal (Analog, inverted)",AM_JOY_AXIS,128,2,0|IE_INVERT)
-DEFEVENT(JOY2_VERT_POT_INV,"Joy2 Vertical (Analog, inverted)",AM_JOY_AXIS,128,2,1|IE_INVERT)
+DEFEVENT(JOY2_HORIZ_POT,"Joy2 Horizontal (Analog)",AM_JOY_AXIS,128,2,1)
+DEFEVENT(JOY2_VERT_POT,"Joy2 Vertical (Analog)",AM_JOY_AXIS,128,2,0)
+DEFEVENT(JOY2_HORIZ_POT_INV,"Joy2 Horizontal (Analog, inverted)",AM_JOY_AXIS,128,2,1|IE_INVERT)
+DEFEVENT(JOY2_VERT_POT_INV,"Joy2 Vertical (Analog, inverted)",AM_JOY_AXIS,128,2,0|IE_INVERT)
DEFEVENT(JOY2_LEFT,"Joy2 Left",AM_K,16,2,DIR_LEFT)
DEFEVENT(JOY2_RIGHT,"Joy2 Right",AM_K,16,2,DIR_RIGHT)
// %%% BRIAN KING WAS HERE %%%
extern int canbang;
#include <sys/mman.h>
-
+extern void jit_abort(const char*,...);
compop_func *compfunctbl[65536];
compop_func *nfcompfunctbl[65536];
#ifdef NOFLAGS_SUPPORT
blockinfo* tbi=get_blockinfo_addr((void*)target);
Dif(!tbi) {
- write_log ("JIT: Could not create jmpdep!\n");
- abort();
+ jit_abort ("JIT: Could not create jmpdep!\n");
}
bi->dep[i].jmp_off=jmpaddr;
bi->dep[i].target=tbi;
}
}
if (!bi) {
- write_log ("JIT: Looking for blockinfo, can't find free one\n");
- abort();
+ jit_abort ("JIT: Looking for blockinfo, can't find free one\n");
}
#if USE_MATCHSTATE
if (live.flags_in_flags==VALID)
return;
Dif (live.flags_on_stack==TRASH) {
- write_log ("JIT: Want flags, got something on stack, but it is TRASH\n");
- abort();
+ jit_abort ("JIT: Want flags, got something on stack, but it is TRASH\n");
}
if (live.flags_on_stack==VALID) {
int tmp;
live.flags_in_flags=VALID;
return;
}
- write_log ("JIT: Huh? live.flags_in_flags=%d, live.flags_on_stack=%d, but need to make live\n",
+ jit_abort ("JIT: Huh? live.flags_in_flags=%d, live.flags_on_stack=%d, but need to make live\n",
live.flags_in_flags,live.flags_on_stack);
- abort();
}
static void flags_to_stack(void)
return;
}
Dif (live.flags_in_flags!=VALID)
- abort();
+ jit_abort("flags_to_stack != VALID");
else {
int tmp;
tmp=writereg_specific(FLAGTMP,4,FLAG_NREG1);
if (!isconst(r))
return;
Dif (live.state[r].needflush==NF_HANDLER) {
- write_log ("JIT: Trying to write back constant NF_HANDLER!\n");
- abort();
+ jit_abort ("JIT: Trying to write back constant NF_HANDLER!\n");
}
raw_mov_l_mi((uae_u32)live.state[r].mem,live.state[r].val);
Dif (live.nat[rr].locked &&
live.nat[rr].nholds==1) {
- write_log ("JIT: register %d in nreg %d is locked!\n",r,live.state[r].realreg);
- abort();
+ jit_abort ("JIT: register %d in nreg %d is locked!\n",r,live.state[r].realreg);
}
live.nat[rr].nholds--;
evict(vr);
}
Dif (live.nat[r].nholds!=0) {
- write_log ("JIT: Failed to free nreg %d, nholds is %d\n",r,live.nat[r].nholds);
- abort();
+ jit_abort ("JIT: Failed to free nreg %d, nholds is %d\n",r,live.nat[r].nholds);
}
}
}
}
Dif (bestreg==-1)
- abort();
+ jit_abort("alloc_reg_hinted bestreg=-1");
if (live.nat[bestreg].nholds>0) {
free_nreg(bestreg);
/* This will happen if we read a partially dirty register at a
bigger size */
Dif (willclobber || live.state[r].validsize>=size)
- abort();
+ jit_abort("willclobber || live.state[r].validsize>=size");
Dif (live.nat[rr].nholds!=1)
- abort();
+ jit_abort("live.nat[rr].nholds!=1");
if (size==4 && live.state[r].validsize==2) {
log_isused(bestreg);
raw_mov_l_rm(bestreg,(uae_u32)live.state[r].mem);
static void unlock(int r)
{
Dif (!live.nat[r].locked)
- abort();
+ jit_abort("unlock %d not locked", r);
live.nat[r].locked--;
}
}
}
Dif (live.nat[rr].nholds!=1) {
- write_log ("JIT: natreg %d holds %d vregs, %d not exclusive\n",
+ jit_abort ("JIT: natreg %d holds %d vregs, %d not exclusive\n",
rr,live.nat[rr].nholds,r);
- abort();
}
return;
}
alloc_reg_hinted(r,4,0,spec);
Dif (live.state[r].validsize!=4) {
- write_log ("JIT: Validsize=%d in remove_offset\n",live.state[r].validsize);
- abort();
+ jit_abort ("JIT: Validsize=%d in remove_offset\n",live.state[r].validsize);
}
make_exclusive(r,0,-1);
/* make_exclusive might have done the job already */
set_status(r,DIRTY);
return;
}
- write_log ("JIT: Failed in remove_offset\n");
- abort();
+ jit_abort ("JIT: Failed in remove_offset\n");
}
STATIC_INLINE void remove_all_offsets(void)
n=live.state[r].realreg;
Dif (live.nat[n].nholds!=1)
- abort();
+ jit_abort("live.nat[%d].nholds!=1", n);
switch(size) {
case 1:
if (live.nat[n].canbyte || spec>=0) {
}
else {
Dif (live.state[r].val) {
- write_log ("JIT: Problem with val\n");
- abort();
+ jit_abort ("JIT: Problem with val\n");
}
}
set_status(r,DIRTY);
make_exclusive(r,0,spec);
Dif (wsize<rsize) {
- write_log ("JIT: Cannot handle wsize<rsize in rmw_general()\n");
- abort();
+ jit_abort ("JIT: Cannot handle wsize<rsize in rmw_general()\n");
}
if (isinreg(r) && live.state[r].validsize>=rsize) {
n=live.state[r].realreg;
Dif (live.nat[n].nholds!=1)
- abort();
+ jit_abort("live.nat[n].nholds!=1", n);
switch(rsize) {
case 1:
live.nat[answer].touched=touchcnt++;
Dif (live.state[r].val) {
- write_log ("JIT: Problem with val(rmw)\n");
- abort();
+ jit_abort ("JIT: Problem with val(rmw)\n");
}
return answer;
}
Dif (live.fat[rr].locked &&
live.fat[rr].nholds==1) {
- write_log ("JIT: FPU register %d in nreg %d is locked!\n",r,live.fate[r].realreg);
- abort();
+ jit_abort ("JIT: FPU register %d in nreg %d is locked!\n",r,live.fate[r].realreg);
}
live.fat[rr].nholds--;
f_evict(vr);
}
Dif (live.fat[r].nholds!=0) {
- write_log ("JIT: Failed to free nreg %d, nholds is %d\n",r,live.fat[r].nholds);
- abort();
+ jit_abort ("JIT: Failed to free nreg %d, nholds is %d\n",r,live.fat[r].nholds);
}
}
static void f_unlock(int r)
{
Dif (!live.fat[r].locked)
- abort();
+ jit_abort("unlock %d", r);
live.fat[r].locked--;
}
live.fate[live.fat[rr].holds[i]].realind);
}
write_log ("\n");
- abort();
+ jit_abort("x");
}
return;
}
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,4,4);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_rol_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_rol_b\n",r);
}
raw_rol_l_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,2,2);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_rol_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_rol_b\n",r);
}
raw_rol_w_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,1,1);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_rol_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_rol_b\n",r);
}
raw_rol_b_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,4,4);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_rol_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_rol_b\n",r);
}
raw_shll_l_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,2,2);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_shll_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_shll_b\n",r);
}
raw_shll_w_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,1,1);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_shll_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_shll_b\n",r);
}
raw_shll_b_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,4,4);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_rol_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_rol_b\n",r);
}
raw_shrl_l_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,2,2);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_shrl_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_shrl_b\n",r);
}
raw_shrl_w_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,1,1);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_shrl_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_shrl_b\n",r);
}
raw_shrl_b_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,4,4);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_rol_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_rol_b\n",r);
}
raw_shra_l_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,2,2);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_shra_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_shra_b\n",r);
}
raw_shra_w_rr(d,r) ;
unlock(r);
r=readreg_specific(r,1,SHIFTCOUNT_NREG);
d=rmw(d,1,1);
Dif (r!=1) {
- write_log ("JIT: Illegal register %d in raw_shra_b\n",r);
- abort();
+ jit_abort ("JIT: Illegal register %d in raw_shra_b\n",r);
}
raw_shra_b_rr(d,r) ;
unlock(r);
}
else {
Dif (live.flags_in_flags!=VALID) {
- write_log ("JIT: setzflg() wanted flags in native flags, they are %d\n",
+ jit_abort ("JIT: setzflg() wanted flags in native flags, they are %d\n",
live.flags_in_flags);
- abort();
}
r=readreg(r,4);
{
s=readreg(s,4);
Dif (baser==s || index==s)
- abort();
+ jit_abort("mov_l_mrr_indexed");
raw_mov_l_mrr_indexed(baser,index,s);
unlock(s);
if (!reg_alloc_run)
#endif
Dif (!isconst(r)) {
- write_log ("JIT: Register %d should be constant, but isn't\n",r);
- abort();
+ jit_abort ("JIT: Register %d should be constant, but isn't\n",r);
}
return live.state[r].val;
}
int rr;
Dif (vton[i]==-1) {
- write_log ("JIT: Asked to load register %d, but nowhere to go\n",i);
- abort();
+ jit_abort ("JIT: Asked to load register %d, but nowhere to go\n",i);
}
n=vton[i];
Dif (live.nat[n].nholds>1)
- abort();
+ jit_abort("vinton");
if (live.nat[n].nholds && depth<N_REGS) {
vinton(live.nat[n].holds[0],vton,depth+1);
}
blockinfo* bi=get_blockinfo_addr(regs.pc_p);
Dif (!bi)
- abort();
+ jit_abort("recompile_block");
raise_in_cl_list(bi);
execute_normal();
return;
return;
}
Dif (!bi2 || bi==bi2) {
- write_log ("Unexplained cache miss %p %p\n",bi,bi2);
- abort();
+ jit_abort ("Unexplained cache miss %p %p\n",bi,bi2);
}
raise_in_cl_list(bi);
return;
static void catastrophe(void)
{
- abort();
+ jit_abort("catastprophe");
}
int failure;
Dif (bi!=bi2) {
/* I don't think it can happen anymore. Shouldn't, in
any case. So let's make sure... */
- write_log ("JIT: WOOOWOO count=%d, ol=%d %p %p\n",
+ jit_abort ("JIT: WOOOWOO count=%d, ol=%d %p %p\n",
bi->count,bi->optlevel,bi->handler_to_use,
cache_tags[cl].handler);
- abort();
}
Dif (bi->count!=-1 && bi->status!=BI_TARGETTED) {
/* What the heck? We are not supposed to be here! */
- abort();
+ jit_abort("BI_TARGETTED");
}
}
if (bi->count==-1) {
m68k_setpc (®s, m68k_getpc (®s));
fill_prefetch_slow (®s);
opcode = get_word (regs.pc);
- if (opcode == 0x4e72 /* RTE */
+ if (opcode == 0x4e73 /* RTE */
|| opcode == 0x4e74 /* RTD */
|| opcode == 0x4e75 /* RTS */
|| opcode == 0x4e77 /* RTR */
#define AHI_STRUCT_VERSION 1
-static int ahi_debug = 1;
+static int ahi_debug = 2;
#define UAE_MAXCHANNELS 24
#define UAE_MAXSOUNDS 256
-#define RECORDSAMPLES 2048
-#define PLAYSAMPLES 1536
+#define UAE_RECORDSAMPLES 2048
+#define UAE_MAXPLAYSAMPLES 2048
#define ub_Flags 34
#define ub_Pad1 (ub_Flags + 1)
#define AHI_TagBase (0x80000000)
#define AHI_TagBaseR (AHI_TagBase|0x8000)
- /* AHI_ControlAudioA tags */
+ /* AHI_AllocAudioA tags */
+#define AHIA_AudioID (AHI_TagBase+1) /* Desired audio mode */
+#define AHIA_MixFreq (AHI_TagBase+2) /* Suggested mixing frequency */
+#define AHIA_Channels (AHI_TagBase+3) /* Suggested number of channels */
+#define AHIA_Sounds (AHI_TagBase+4) /* Number of sounds to use */
+#define AHIA_SoundFunc (AHI_TagBase+5) /* End-of-Sound Hook */
+#define AHIA_PlayerFunc (AHI_TagBase+6) /* Player Hook */
+#define AHIA_PlayerFreq (AHI_TagBase+7) /* Frequency for player Hook (Fixed)*/
+#define AHIA_MinPlayerFreq (AHI_TagBase+8) /* Minimum Frequency for player Hook */
+#define AHIA_MaxPlayerFreq (AHI_TagBase+9) /* Maximum Frequency for player Hook */
+#define AHIA_RecordFunc (AHI_TagBase+10) /* Sample recording Hook */
+#define AHIA_UserData (AHI_TagBase+11) /* What to put in ahiac_UserData */
+#define AHIA_AntiClickSamples (AHI_TagBase+13) /* # of samples to smooth (V6) */
+
+/* AHI_ControlAudioA tags */
#define AHIC_Play (AHI_TagBase+80) /* Boolean */
#define AHIC_Record (AHI_TagBase+81) /* Boolean */
#define AHIC_MonitorVolume (AHI_TagBase+82)
int ch;
int bitspersample;
int bytespersample;
+ int dynamic;
uae_u32 addr;
uae_u32 len;
uae_u32 type;
int dsplaying;
ALuint al_source;
int samplecounter;
+ int buffertoggle;
+ int maxplaysamples;
+ int totalsamples;
};
struct DSAHI {
int channels;
int sounds;
int playerfreq;
+ uae_u32 audioid;
int enabledisable;
struct dssample *sample;
struct dschannel *channel;
evt evttime;
uae_u32 signalchannelmask;
- ALCdevice *al_dev;
+ ALCdevice *al_dev, *al_recorddev;
ALCcontext *al_ctx;
int al_bufferformat;
uae_u8 *tmpbuffer;
int tmpbuffer_size;
int dsrecording;
+ int record_samples;
int record_ch;
int record_bytespersample;
int record_wait;
if (ch > UAE_MAXCHANNELS)
ch = UAE_MAXCHANNELS;
for (i = 0; i < ch; i++) {
+ struct dschannel *dc = &dsahip->channel[i];
int v;
- alGetSourcei (dsahip->channel[i].al_source, AL_SAMPLE_OFFSET, &v);
- put_long (channelinfo + ahieci_Offset + i * 4, v);
+ alGetSourcei (dc->al_source, AL_SAMPLE_OFFSET, &v);
+ put_long (channelinfo + ahieci_Offset + i * 4, v + dc->samplecounter * dc->maxplaysamples);
}
}
static void ds_free_record (struct DSAHI *dsahip)
{
+ if (dsahip->al_recorddev)
+ alcCaptureCloseDevice (dsahip->al_recorddev);
+ dsahip->al_recorddev = NULL;
}
static int ds_init_record (struct DSAHI *dsahip)
{
uae_u32 pbase = get_long (dsahip->audioctrl + ahiac_DriverData);
int freq = get_long (dsahip->audioctrl + ahiac_MixFreq);
+ struct sound_device *sd;
+ int device;
if (!freq)
return 0;
+ device = dsahip->input;
+ sd = record_devices;
+ for (;;) {
+ if (sd->type == SOUND_DEVICE_AL) {
+ if (device <= 0)
+ break;
+ device--;
+ }
+ sd++;
+ if (sd->name == NULL)
+ return 0;
+ }
+ dsahip->record_samples = UAE_RECORDSAMPLES;
+ dsahip->record_ch = 2;
+ dsahip->record_bytespersample = 2;
+ alClear ();
+ dsahip->al_recorddev = alcCaptureOpenDevice (sd->alname, freq, AL_FORMAT_STEREO16, dsahip->record_samples);
+ if (dsahip->al_recorddev == NULL)
+ goto error;
+ return 1;
+error:
+ if (ahi_debug)
+ write_log ("AHI: OPENAL recording initialization failed\n");
return 0;
}
static int ds_init (struct DSAHI *dsahip)
{
int freq = 44100;
- int v, wrapped;
+ int v;
struct sound_device *sd;
+ int device;
- sd = &sound_devices[currprefs.win32_soundcard];
- wrapped = 0;
- while (sd->type != SOUND_DEVICE_AL) {
- sd++;
- if (sd->name == NULL) {
- if (wrapped)
- return 0;
- wrapped = 1;
- sd = sound_devices;
+ device = dsahip->output;
+ sd = sound_devices;
+ for (;;) {
+ if (sd->type == SOUND_DEVICE_AL) {
+ if (device <= 0)
+ break;
+ device--;
}
+ sd++;
+ if (sd->name == NULL)
+ return 0;
}
dsahip->al_dev = alcOpenDevice (sd->alname);
if (!dsahip->al_dev)
dsahip->chout = 2;
dsahip->al_bufferformat = AL_FORMAT_STEREO16;
- if (v = alGetEnumValue ("AL_FORMAT_QUAD16")) {
- dsahip->chout = 4;
- cansurround = 1;
- dsahip->al_bufferformat = v;
- }
- if (v = alGetEnumValue ("AL_FORMAT_51CHN16")) {
- dsahip->chout = 6;
- cansurround = 1;
- dsahip->al_bufferformat = v;
+ cansurround = 0;
+ if ((dsahip->audioid & 0xff) == 2) {
+ if (v = alGetEnumValue ("AL_FORMAT_QUAD16")) {
+ dsahip->chout = 4;
+ cansurround = 1;
+ dsahip->al_bufferformat = v;
+ }
+ if (v = alGetEnumValue ("AL_FORMAT_51CHN16")) {
+ dsahip->chout = 6;
+ cansurround = 1;
+ dsahip->al_bufferformat = v;
+ }
}
dsahip->bitspersampleout = dsahip->bits24 ? 24 : 16;
dsahip->bytespersampleout = dsahip->bitspersampleout / 8;
write_log("AHI: CH=%d BLEN=%d\n",
dsahip->chout, dsahip->channellength);
- dsahip->tmpbuffer_size = 2000000;
+ dsahip->tmpbuffer_size = 1000000;
dsahip->tmpbuffer = xmalloc (dsahip->tmpbuffer_size);
if (ahi_debug)
write_log ("AHI: OpenAL initialized: %s\n", sound_devices[dsahip->output].name);
static void dorecord (struct DSAHI *dsahip)
{
-#if 0
uae_u32 pbase = get_long (dsahip->audioctrl + ahiac_DriverData);
- HRESULT hr;
- DWORD cpos, rpos, diff;
- void *buf1, *buf2;
- DWORD size1, size2;
uae_u32 recordbuf;
- int mixlength_bytes;
+ int bytes;
- if (dsahip->dscb == NULL)
+ if (dsahip->al_recorddev == NULL)
return;
if (dsahip->record_wait && !get_word (pbase + pub_RecordHookDone))
return;
dsahip->record_wait = 0;
- mixlength_bytes = dsahip->mixlength_record * dsahip->record_ch * dsahip->record_bytespersample;
+ bytes = dsahip->record_samples * dsahip->record_ch * dsahip->record_bytespersample;
recordbuf = get_long (pbase + pub_RecordBuffer);
- if (recordbuf == 0 || !valid_address (recordbuf, mixlength_bytes))
+ if (recordbuf == 0 || !valid_address (recordbuf, bytes))
return;
- hr = IDirectSoundCaptureBuffer_GetCurrentPosition (dsahip->dscb, &cpos, &rpos);
- if (FAILED (hr)) {
- write_log ("AHI: IDirectSoundCaptureBuffer_GetCurrentPosition() failed %s\n", DXError (hr));
- return;
- }
- if (rpos < dsahip->recordingcursor)
- rpos += dsahip->channellength_record;
- diff = rpos - dsahip->recordingcursor;
- if (diff < mixlength_bytes)
+ alClear ();
+ alcCaptureSamples (dsahip->al_recorddev, (void*)recordbuf, dsahip->record_samples);
+ if (alGetError () != AL_NO_ERROR)
return;
- hr = IDirectSoundCaptureBuffer_Lock (dsahip->dscb, dsahip->recordingcursor, mixlength_bytes, &buf1, &size1, &buf2, &size2, 0);
- if (SUCCEEDED (hr)) {
- uae_u8 *addr = get_real_address (recordbuf);
- uae_u8 *b = (uae_u8*)buf1;
- int s;
- b = (uae_u8*)buf1;
- s = size1;
- while (s > 0) {
- addr[0] = b[1];
- addr[1] = b[0];
- addr += 2;
- b += 2;
- s -= 2;
- }
- b = (uae_u8*)buf2;
- s = size2;
- while (s > 0) {
- addr[0] = b[1];
- addr[1] = b[0];
- addr += 2;
- b += 2;
- s -= 2;
- }
- IDirectSoundCaptureBuffer_Unlock (dsahip->dscb, buf1, size1, buf2, size2);
- put_word (pbase + pub_RecordHookDone, 0);
- dsahip->record_wait = 1;
- put_word (pbase + pub_FuncMode, get_word (pbase + pub_FuncMode) | FUNCMODE_RECORD);
- sendsignal (dsahip);
- }
- dsahip->recordingcursor += mixlength_bytes;
- if (dsahip->recordingcursor >= dsahip->channellength_record)
- dsahip->recordingcursor -= dsahip->channellength_record;
-#endif
+ put_word (pbase + pub_RecordHookDone, 0);
+ dsahip->record_wait = 1;
+ put_word (pbase + pub_FuncMode, get_word (pbase + pub_FuncMode) | FUNCMODE_RECORD);
+ sendsignal (dsahip);
}
static void al_startplay (struct dschannel *dc)
{
- al_setloop (dc, TRUE);
alClear ();
alSourcePlay (dc->al_source);
alError ("AHI: ds_play() alSourcePlay");
{
uae_u8 *p, *ps, *pe;
struct dssample *ds;
- int num, slen, dlen, offset;
+ int slen, dlen;
- memcpy (&dc->cs, &dc->csnext, sizeof (struct chsample));
- dc->csnext.ds = NULL;
ds = dc->cs.ds;
ps = p = get_real_address (ds->addr);
pe = ps + ds->len * ds->bytespersample * ds->ch;
- num = ds->len / dsahip->maxplaysamples;
- offset = dsahip->maxplaysamples * dc->samplecounter;
- slen = dsahip->maxplaysamples;
- if (dc->samplecounter == num - 1)
- slen = ds->len - dsahip->maxplaysamples * (num - 1);
- p += (offset + dc->cs.srcplayoffset) * ds->bytespersample * ds->ch;
+
+ slen = dc->maxplaysamples;
+ if (dc->samplecounter == dc->totalsamples - 1)
+ slen = ds->len - dc->maxplaysamples * (dc->totalsamples - 1);
+
+ p += (dc->maxplaysamples * dc->samplecounter + dc->cs.srcplayoffset) * ds->bytespersample * ds->ch;
dlen = copysampledata (dsahip, dc, ds, &p, pe, ps, dsahip->tmpbuffer, slen);
alClear ();
- alBufferData (ds->al_buffer[dc->samplecounter], dsahip->al_bufferformat, dsahip->tmpbuffer, dlen, dc->cs.frequency);
- alError ("AHI: preparesample:alBufferData()");
+ alBufferData (ds->al_buffer[dc->buffertoggle], dsahip->al_bufferformat, dsahip->tmpbuffer, dlen, dc->cs.frequency);
+ alError ("AHI: preparesample:alBufferData(len=%d,freq=%d)", dlen, dc->cs.frequency);
+ alClear ();
+ alSourceQueueBuffers (dc->al_source, 1, &ds->al_buffer[dc->buffertoggle]);
+ alError ("AHI: al_initsample:alSourceQueueBuffers(freq=%d)", dc->cs.frequency);
+ if (ahi_debug > 1)
+ write_log ("AHI: sample queued %d: %d/%d\n",
+ dc->num, dc->samplecounter, dc->totalsamples);
+ dc->samplecounter++;
+ dc->buffertoggle ^= 1;
}
+/* called when sample is started for the first time */
static void al_initsample (struct DSAHI *dsahip, struct dschannel *dc)
{
struct dssample *ds;
alClear ();
alSourcei (dc->al_source, AL_BUFFER, AL_NONE);
alError ("AHI: al_initsample:AL_BUFFER=AL_NONE");
+
+ memcpy (&dc->cs, &dc->csnext, sizeof (struct chsample));
+ dc->csnext.ds = NULL;
+ ds = dc->cs.ds;
+ if (ds == NULL)
+ return;
+
dc->samplecounter = 0;
+ if (ds->dynamic)
+ dc->maxplaysamples = dsahip->maxplaysamples / 2;
+ else
+ dc->maxplaysamples = ds->len / 2;
+ if (dc->maxplaysamples > dsahip->tmpbuffer_size)
+ dc->maxplaysamples = dsahip->tmpbuffer_size;
+
+ dc->totalsamples = ds->len / dc->maxplaysamples;
+
+ /* queue first half */
preparesample (dsahip, dc);
- ds = dc->cs.ds;
- alClear ();
- alSourceQueueBuffers (dc->al_source, 1, &ds->al_buffer[dc->samplecounter]);
- alError ("AHI: al_initsample:alSourceQueueBuffers(freq=%d)", dc->cs.frequency);
+ /* queue second half */
+ preparesample (dsahip, dc);
+
if (dc->dsplaying) {
dc->dsplaying = 1;
al_startplay (dc);
setchannelevent (dsahip, dc);
}
- dc->samplecounter++;
}
+/* called when previous sample is still playing */
static void al_queuesample (struct DSAHI *dsahip, struct dschannel *dc)
{
int v, restart;
- al_setloop (dc, FALSE);
- if (!dc->csnext.ds)
+ if (!dc->cs.ds)
return;
restart = 0;
if (dc->dsplaying) {
restart = 1;
if (ahi_debug)
write_log ("AHI: queuesample, play restart\n");
+ preparesample (dsahip, dc);
}
}
- dc->samplecounter = 0;
preparesample (dsahip, dc);
- alClear ();
- alSourceQueueBuffers (dc->al_source, 1, &dc->cs.ds->al_buffer[dc->samplecounter]);
- alError ("AHI: al_queuesample:alSourceQueueBuffers(freq=%d)", dc->cs.frequency);
if (dc->dsplaying)
dc->dsplaying = 1;
if (restart)
al_startplay (dc);
- al_setloop (dc, FALSE);
- if (ahi_debug)
+ if (ahi_debug > 1)
write_log ("AHI: sample %d queued to channel %d\n", dc->cs.ds->num, dc->num);
}
if (v != AL_PLAYING) {
setchannelevent (dsahip, dc);
if (ahi_debug)
- write_log ("AHI: channel %d stopped state=%d\n", dc->num, v);
- if (dc->csnext.ds)
- al_queuesample (dsahip, dc);
- else
- dc->dsplaying = 2;
+ write_log ("AHI: ********* channel %d stopped state=%d!\n", dc->num, v);
+ removed = 1;
+ dc->dsplaying = 2;
}
if (removed) {
- if (ahi_debug)
- write_log ("sample end channel %d\n", dc->num);
- setchannelevent (dsahip, dc);
- if (dc->csnext.ds)
- al_queuesample (dsahip, dc);
+ int evt = 0;
+ if (ahi_debug > 1)
+ write_log ("sample end channel %d: %d/%d\n", dc->num, dc->samplecounter, dc->totalsamples);
+ if (dc->samplecounter >= dc->totalsamples) {
+ evt = 1;
+ if (ahi_debug > 1)
+ write_log ("sample finished channel %d: %d\n", dc->num, dc->totalsamples);
+ dc->samplecounter = 0;
+ if (dc->csnext.ds) {
+ memcpy (&dc->cs, &dc->csnext, sizeof (struct chsample));
+ dc->csnext.ds = NULL;
+ }
+ }
+ al_queuesample (dsahip, dc);
+ if (evt)
+ setchannelevent (dsahip, dc);
}
}
put_long (pbase + pub_ChannelSignalAck, flags);
static void ds_record (struct DSAHI *dsahip, int start)
{
+ alClear ();
+ if (start) {
+ if (!dsahip->dsrecording)
+ alcCaptureStart (dsahip->al_recorddev);
+ dsahip->dsrecording = 1;
+ } else {
+ alcCaptureStop (dsahip->al_recorddev);
+ dsahip->dsrecording = 0;
+ }
+ alError ("AHI: alcCapture%s failed", start ? "Start" : "Stop");
}
static void ds_stop (struct DSAHI *dsahip, struct dschannel *dc)
return AHISF_ERROR;
}
-
v = get_long (pbase + pub_Index);
if (v != -1) {
write_log ("AHI: corrupted memory\n");
put_long (pbase + pub_Index, dsahip - dsahi);
dsahip->audioctrl = audioctrl;
- if (!ds_init (dsahip))
- return AHISF_ERROR;
- dsahip->maxplaysamples = PLAYSAMPLES;
+ dsahip->maxplaysamples = UAE_MAXPLAYSAMPLES;
dsahip->sounds = UAE_MAXSOUNDS;
dsahip->channels = UAE_MAXCHANNELS;
- if (xahi_input_num)
- ret |= AHISF_CANRECORD;
- if (cansurround)
- ret |= AHISF_KNOWMULTICHANNEL;
-
+ dsahip->audioid = 0x003b0001;
while ((tag = gettag (&tags, &data))) {
if (ahi_debug)
write_log ("- TAG %08x=%d: %08x=%u\n", tag, tag & 0x7fff, data, data);
+ switch (tag)
+ {
+ case AHIA_AudioID:
+ dsahip->audioid = data;
+ break;
+ }
}
- if (dsahip->sounds < 0 || dsahip->sounds > 1000) {
- ds_free (dsahip);
- ds_free_record (dsahip);
+
+ if ((dsahip->audioid >> 16) != 0x3b)
return AHISF_ERROR;
- }
+
+ if (dsahip->sounds < 0 || dsahip->sounds > 1000)
+ return AHISF_ERROR;
+
+ if (!ds_init (dsahip))
+ return AHISF_ERROR;
+
+ if (xahi_input_num)
+ ret |= AHISF_CANRECORD;
+ if (cansurround)
+ ret |= AHISF_KNOWMULTICHANNEL;
+
dsahip->sample = xcalloc (sizeof (struct dssample), dsahip->sounds);
dsahip->channel = xcalloc (sizeof (struct dschannel), dsahip->channels);
for (i = 0; i < dsahip->channels; i++) {
case AHIDB_FullDuplex:
return -1;
case AHIDB_MaxRecordSamples:
- return RECORDSAMPLES;
+ return UAE_RECORDSAMPLES;
case AHIDB_MaxPlaySamples:
if (def < dsahip->maxplaysamples)
def = dsahip->maxplaysamples;
ds_setvolume (dsahip, dc);
if (dc->cs.ds == NULL)
al_initsample (dsahip, dc);
- else
- al_queuesample (dsahip, dc);
return 0;
}
ds->sampletype = sampletype;
ds->type = type;
ds->len = len;
+ ds->dynamic = type == AHIST_DYNAMICSAMPLE;
switch (sampletype)
{
if(bsd->hSockWnd) {
// Make sure we're outrunning the wolves
- int pri = THREAD_PRIORITY_ABOVE_NORMAL;
- SetThreadPriority(GetCurrentThread(), pri);
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
while(bsd->hSockThread && bsd->hSockWnd) {
DWORD wait;
WaitHandle = bsd->hSockReq;
wait = MsgWaitForMultipleObjects (1, &WaitHandle, FALSE, INFINITE, QS_POSTMESSAGE);
+ if (wait == WAIT_ABANDONED_0)
+ break;
if (wait == WAIT_OBJECT_0) {
if (!bsd->hSockThread || !bsd->hSockWnd)
break;
- if(HandleStuff()) // See if its time to quit...
+ if (HandleStuff()) // See if its time to quit...
break;
- }
- if (wait == WAIT_OBJECT_0 + 1) {
+ } else if (wait == WAIT_OBJECT_0 + 1) {
if (!bsd->hSockThread || !bsd->hSockWnd)
break;
- Sleep(10);
- while(PeekMessage(&msg, NULL, WM_USER, 0xB000 + MAXPENDINGASYNC * 2, PM_REMOVE) > 0) {
+ while(PeekMessage(&msg, NULL, WM_USER, 0xB000 + MAXPENDINGASYNC * 2, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
for (i = 0; i < sizeof (kc); i++) {
if (i == 0x80) /* USB KB led causes this, better ignore it */
continue;
- if (kc[i] & 0x80) kc[i] = 1; else kc[i] = 0;
+ if (kc[i] & 0x80)
+ kc[i] = 1;
+ else
+ kc[i] = 0;
if (kc[i] != di_keycodes[num][i]) {
write_log ("%02X -> %d\n", i, kc[i]);
di_keycodes[num][i] = kc[i];
for (j = 0; j < elements; j++) {
int scancode = didod[j].dwOfs;
int pressed = (didod[j].dwData & 0x80) ? 1 : 0;
+ //write_log ("%d: %02X %d\n", j, scancode, pressed);
if (!istest)
scancode = keyhack (scancode, pressed, i);
if (scancode < 0)
//\r
\r
VS_VERSION_INFO VERSIONINFO\r
- FILEVERSION 1,5,2,0\r
- PRODUCTVERSION 1,5,2,0\r
+ FILEVERSION 1,5,3,0\r
+ PRODUCTVERSION 1,5,3,0\r
FILEFLAGSMASK 0x3fL\r
#ifdef _DEBUG\r
FILEFLAGS 0x1L\r
BLOCK "040904b0"\r
BEGIN\r
VALUE "FileDescription", "WinUAE"\r
- VALUE "FileVersion", "1.5.2"\r
+ VALUE "FileVersion", "1.5.3"\r
VALUE "InternalName", "WinUAE"\r
VALUE "LegalCopyright", "© 1996-2008 under the GNU Public License (GPL)"\r
VALUE "OriginalFilename", "WinUAE.exe"\r
VALUE "ProductName", "WinUAE"\r
- VALUE "ProductVersion", "1.5.2"\r
+ VALUE "ProductVersion", "1.5.3"\r
END\r
END\r
BLOCK "VarFileInfo"\r
static int mm_timerres;
static int timermode, timeon;
-static HANDLE timehandle;
+#define MAX_TIMEHANDLES 8
+static int timehandlecounter;
+static HANDLE timehandle[MAX_TIMEHANDLES];
int sleep_resolution;
+static CRITICAL_SECTION cs_time;
char start_path_data[MAX_DPATH];
char start_path_exe[MAX_DPATH];
static int init_mmtimer (void)
{
TIMECAPS tc;
+ int i;
+
mm_timerres = 0;
if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR)
return 0;
mm_timerres = min (max (tc.wPeriodMin, 1), tc.wPeriodMax);
sleep_resolution = 1000 / mm_timerres;
- timehandle = CreateEvent (NULL, TRUE, FALSE, NULL);
+ for (i = 0; i < MAX_TIMEHANDLES; i++)
+ timehandle[i] = CreateEvent (NULL, TRUE, FALSE, NULL);
+ InitializeCriticalSection(&cs_time);
+ timehandlecounter = 0;
return 1;
}
{
UINT TimerEvent;
int start;
+ int cnt;
start = read_processor_time ();
- TimerEvent = timeSetEvent (ms, 0, timehandle, 0, TIME_ONESHOT | TIME_CALLBACK_EVENT_SET);
- WaitForSingleObject (timehandle, ms);
- ResetEvent (timehandle);
+ EnterCriticalSection (&cs_time);
+ cnt = timehandlecounter++;
+ if (timehandlecounter >= MAX_TIMEHANDLES)
+ timehandlecounter = 0;
+ LeaveCriticalSection (&cs_time);
+ TimerEvent = timeSetEvent (ms, 0, timehandle[cnt], 0, TIME_ONESHOT | TIME_CALLBACK_EVENT_SET);
+ WaitForSingleObject (timehandle[cnt], ms);
+ ResetEvent (timehandle[cnt]);
timeKillEvent (TimerEvent);
idletime += read_processor_time () - start;
}
return;
}
mouseposx = mouseposy = 0;
-// if (oldx < amigawin_rect.left || oldy < amigawin_rect.top || oldx > amigawin_rect.right || oldy > amigawin_rect.bottom) {
if (oldx < 0 || oldy < 0 || oldx > amigawin_rect.right - amigawin_rect.left || oldy > amigawin_rect.bottom - amigawin_rect.top) {
write_log ("Mouse out of range: %dx%d (%dx%d %dx%d)\n", oldx, oldy,
amigawin_rect.left, amigawin_rect.top, amigawin_rect.right, amigawin_rect.bottom);
WIN32GUI_LoadUIString (currprefs.win32_middle_mouse ? IDS_WINUAETITLE_MMB : IDS_WINUAETITLE_NORMAL,
txt2, sizeof (txt2));
}
- if (WINUAEBETA > 0) {
+ if (strlen (WINUAEBETA) > 0) {
strcat (txt, BetaStr);
if (strlen (WINUAEEXTRA) > 0) {
strcat (txt, " ");
cfgfile_target_dwrite (f, "map_cd_drives=%s\n", p->win32_automount_cddrives ? "true" : "false");
cfgfile_target_dwrite (f, "map_net_drives=%s\n", p->win32_automount_netdrives ? "true" : "false");
serdevtoname (p->sername);
- cfgfile_target_dwrite (f, "serial_port=%s\n", p->sername[0] ? p->sername : "none" );
+ cfgfile_target_dwrite (f, "serial_port=%s\n", p->sername[0] ? p->sername : "none");
sernametodev (p->sername);
- cfgfile_target_dwrite (f, "parallel_port=%s\n", p->prtname[0] ? p->prtname : "none" );
+ cfgfile_target_dwrite (f, "parallel_port=%s\n", p->prtname[0] ? p->prtname : "none");
cfgfile_target_dwrite (f, "active_priority=%d\n", priorities[p->win32_active_priority].value);
cfgfile_target_dwrite (f, "inactive_priority=%d\n", priorities[p->win32_inactive_priority].value);
static void makeverstr(char *s)
{
-#if WINUAEBETA > 0
- sprintf (BetaStr, " (%sBeta %d, %d.%02d.%02d)", WINUAEPUBLICBETA > 0 ? "Public " : "", WINUAEBETA,
- GETBDY(WINUAEDATE), GETBDM(WINUAEDATE), GETBDD(WINUAEDATE));
- sprintf (s, "WinUAE %d.%d.%d%s%s",
- UAEMAJOR, UAEMINOR, UAESUBREV, WINUAEREV, BetaStr);
-#else
- sprintf(s, "WinUAE %d.%d.%d%s (%d.%02d.%02d)",
- UAEMAJOR, UAEMINOR, UAESUBREV, WINUAEREV, GETBDY(WINUAEDATE), GETBDM(WINUAEDATE), GETBDD(WINUAEDATE));
-#endif
+ if (strlen (WINUAEBETA) > 0) {
+ sprintf (BetaStr, " (%sBeta %s, %d.%02d.%02d)", WINUAEPUBLICBETA > 0 ? "Public " : "", WINUAEBETA,
+ GETBDY(WINUAEDATE), GETBDM(WINUAEDATE), GETBDD(WINUAEDATE));
+ sprintf (s, "WinUAE %d.%d.%d%s%s",
+ UAEMAJOR, UAEMINOR, UAESUBREV, WINUAEREV, BetaStr);
+ } else {
+ sprintf(s, "WinUAE %d.%d.%d%s (%d.%02d.%02d)",
+ UAEMAJOR, UAEMINOR, UAESUBREV, WINUAEREV, GETBDY(WINUAEDATE), GETBDM(WINUAEDATE), GETBDD(WINUAEDATE));
+ }
if (strlen (WINUAEEXTRA) > 0) {
strcat (s, " ");
strcat (s, WINUAEEXTRA);
#define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
#define GETBDD(x) ((x) % 100)
-#define WINUAEPUBLICBETA 0
+#define WINUAEPUBLICBETA 1
-#define WINUAEBETA 0
-#define WINUAEDATE MAKEBD(2008, 9, 5)
+#define WINUAEBETA "0.1"
+#define WINUAEDATE MAKEBD(2008, 9, 26)
#define WINUAEEXTRA ""
#define WINUAEREV ""
#define IHF_WINDOWHIDDEN 6
-#define NORMAL_WINDOW_STYLE (WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_SIZEBOX)
+#define NORMAL_WINDOW_STYLE (WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_SIZEBOX)
extern HMODULE hUIDLL;
extern HWND hAmigaWnd, hMainWnd, hHiddenWnd, hGUIWnd;
c |= currprefs.gfx_lores_mode != changed_prefs.gfx_lores_mode ? (2 | 8) : 0;
c |= currprefs.gfx_display != changed_prefs.gfx_display ? (2|4|8) : 0;
c |= strcmp (currprefs.gfx_display_name, changed_prefs.gfx_display_name) ? (2|4|8) : 0;
- c |= currprefs.win32_alwaysontop != changed_prefs.win32_alwaysontop ? 1 : 0;
- c |= currprefs.win32_borderless != changed_prefs.win32_borderless ? 1 : 0;
+ c |= currprefs.win32_alwaysontop != changed_prefs.win32_alwaysontop ? 32 : 0;
+ c |= currprefs.win32_notaskbarbutton != changed_prefs.win32_notaskbarbutton ? 32 : 0;
+ c |= currprefs.win32_borderless != changed_prefs.win32_borderless ? 32 : 0;
c |= currprefs.win32_rtgmatchdepth != changed_prefs.win32_rtgmatchdepth ? 2 : 0;
c |= currprefs.win32_rtgscaleifsmall != changed_prefs.win32_rtgscaleifsmall ? 8 : 0;
c |= currprefs.win32_rtgallowscaling != changed_prefs.win32_rtgallowscaling ? 8 : 0;
currprefs.gfx_display = changed_prefs.gfx_display;
strcpy (currprefs.gfx_display_name, changed_prefs.gfx_display_name);
currprefs.win32_alwaysontop = changed_prefs.win32_alwaysontop;
+ currprefs.win32_notaskbarbutton = changed_prefs.win32_notaskbarbutton;
currprefs.win32_borderless = changed_prefs.win32_borderless;
currprefs.win32_rtgmatchdepth = changed_prefs.win32_rtgmatchdepth;
currprefs.win32_rtgscaleifsmall = changed_prefs.win32_rtgscaleifsmall;
if (reopen (c & 2))
c |= 2;
}
- if ((c & 2) && !keepfsmode) {
+ if ((c & 32) || ((c & 2) && !keepfsmode)) {
close_windows ();
graphics_init ();
}
void machdep_free (void)
{
#ifdef LOGITECHLCD
- lcd_close();
+ lcd_close ();
#endif
}
{
if (!DirectDraw_Start (NULL))
return 0;
- DirectDraw_Release();
+ DirectDraw_Release ();
#ifdef PICASSO96
- InitPicasso96();
+ InitPicasso96 ();
#endif
return 1;
}
int dxfs = currentmode->flags & (DM_DX_FULLSCREEN);
int d3dfs = currentmode->flags & (DM_D3D_FULLSCREEN);
int fsw = currentmode->flags & (DM_W_FULLSCREEN);
- DWORD exstyle = currprefs.win32_notaskbarbutton ? 0 : WS_EX_APPWINDOW;
+ DWORD exstyle = currprefs.win32_notaskbarbutton ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW;
DWORD flags = 0;
- HWND hhWnd = currprefs.win32_notaskbarbutton ? hHiddenWnd : NULL;
+ HWND hhWnd = NULL;//currprefs.win32_notaskbarbutton ? hHiddenWnd : NULL;
int borderless = currprefs.win32_borderless;
DWORD style = NORMAL_WINDOW_STYLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
int cymenu = GetSystemMetrics (SM_CYMENU);
if (d3dfs || dxfs)
SetCursorPos (x + w / 2, y + h / 2);
write_log ("window already open\n");
+#ifdef RETROPLATFORM
+ rp_set_hwnd (hAmigaWnd);
+#endif
return 1;
}
hwnd = phwnd;
if (hwnd && !title[0]) {
GetWindowText (hwnd, title, sizeof (title));
- if (WINUAEBETA > 0) {
+ if (strlen (WINUAEBETA) > 0) {
strcat (title, BetaStr);
if (strlen(WINUAEEXTRA) > 0) {
strcat (title, " ");
LRESULT index;
i = 0; index = 0;
- while ((freq = DisplayModes[dmode].refresh[i]) > 0 && index < MAX_REFRESH_RATES) {
+ while (dmode >= 0 && (freq = DisplayModes[dmode].refresh[i]) > 0 && index < MAX_REFRESH_RATES) {
storedrefreshrates[index++] = freq;
i++;
}
static void init_display_mode (HWND hDlg)
{
int d, d2, index;
+ int i, cnt;
switch (workprefs.color_mode)
{
d = d / 8;
}
- if ((index = display_mode_index (workprefs.gfx_size_fs.width, workprefs.gfx_size_fs.height, d)) >= 0) {
- int i, cnt;
+ index = display_mode_index (workprefs.gfx_size_fs.width, workprefs.gfx_size_fs.height, d);
+ if (index >= 0)
SendDlgItemMessage (hDlg, IDC_RESOLUTION, CB_SETCURSEL, DisplayModes[index].residx, 0);
- SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_RESETCONTENT, 0, 0);
- cnt = 0;
- gui_display_depths[0] = gui_display_depths[1] = gui_display_depths[2] = -1;
- for (i = 0; DisplayModes[i].depth >= 0; i++) {
- if (DisplayModes[i].depth > 1 && DisplayModes[i].residx == DisplayModes[index].residx) {
- char tmp[64];
- sprintf (tmp, "%d", DisplayModes[i].depth * 8);
- SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_ADDSTRING, 0, (LPARAM)tmp);
- if (DisplayModes[i].depth == d)
- SendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_SETCURSEL, cnt, 0);
- gui_display_depths[cnt] = DisplayModes[i].depth;
- cnt++;
- }
+ else
+ index = 0;
+ SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_RESETCONTENT, 0, 0);
+ cnt = 0;
+ gui_display_depths[0] = gui_display_depths[1] = gui_display_depths[2] = -1;
+ for (i = 0; DisplayModes[i].depth >= 0; i++) {
+ if (DisplayModes[i].depth > 1 && DisplayModes[i].residx == DisplayModes[index].residx) {
+ char tmp[64];
+ sprintf (tmp, "%d", DisplayModes[i].depth * 8);
+ SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_ADDSTRING, 0, (LPARAM)tmp);
+ if (DisplayModes[i].depth == d)
+ SendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_SETCURSEL, cnt, 0);
+ gui_display_depths[cnt] = DisplayModes[i].depth;
+ cnt++;
}
- init_frequency_combo (hDlg, index);
}
+ init_frequency_combo (hDlg, index);
+
}
static int display_toselect(int fs, int vsync, int p96)
{
case IDC_PORT0_JOYS:
case IDC_PORT1_JOYS:
+ case IDC_PRINTERLIST:
+ case IDC_SERIAL:
+ case IDC_MIDIOUTLIST:
+ case IDC_MIDIINLIST:
values_from_portsdlg (hDlg);
updatejoyport (hDlg);
inputdevice_updateconfig (&workprefs);
}
}
-static void values_from_inputdlg (HWND hDlg, int inputchange)
+static void values_from_inputdlgbottom (HWND hDlg)
{
- int doselect = 0, v;
+ int v;
BOOL success;
- LRESULT item;
v = GetDlgItemInt (hDlg, IDC_INPUTDEADZONE, &success, FALSE);
if (success) {
v = GetDlgItemInt (hDlg, IDC_INPUTSPEEDM, &success, FALSE);
if (success)
currprefs.input_mouse_speed = workprefs.input_mouse_speed = v;
+}
+
+static void values_from_inputdlg (HWND hDlg, int inputchange)
+{
+ int doselect = 0;
+ LRESULT item;
item = SendDlgItemMessage (hDlg, IDC_INPUTAMIGACNT, CB_GETCURSEL, 0, 0L);
if (item != CB_ERR && input_selected_sub_num != item) {
inputdevice_set_device_status (input_selected_device, IsDlgButtonChecked( hDlg, IDC_INPUTDEVICEDISABLE) ? 1 : 0);
break;
default:
+ switch (LOWORD (wParam))
+ {
+ case IDC_INPUTDEADZONE:
+ case IDC_INPUTAUTOFIRERATE:
+ case IDC_INPUTSPEEDD:
+ case IDC_INPUTSPEEDA:
+ case IDC_INPUTSPEEDM:
+ values_from_inputdlgbottom (hDlg);
+ break;
+ }
if (HIWORD (wParam) == CBN_SELCHANGE || HIWORD (wParam) == CBN_KILLFOCUS) {
switch (LOWORD (wParam))
{
switch (msg)
{
case WM_INITDIALOG:
- #if WINUAEBETA == 0
- ShowWindow (GetDlgItem(hDlg, IDC_FILTERAUTORES), SW_HIDE);
- #endif
+ if (strlen (WINUAEBETA) == 0)
+ ShowWindow (GetDlgItem(hDlg, IDC_FILTERAUTORES), SW_HIDE);
pages[HW3D_ID] = hDlg;
currentpage = HW3D_ID;
SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_RESETCONTENT, 0, 0);
int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage)
{
- int cnt, i, drv, firstdrv, list;
+ int cnt, i, drv, drvdrag, firstdrv, list;
char file[MAX_DPATH];
int dfxtext[] = { IDC_DF0TEXT, IDC_DF0TEXTQ, IDC_DF1TEXT, IDC_DF1TEXTQ, IDC_DF2TEXT, -1, IDC_DF3TEXT, -1 };
POINT pt;
if (!cnt)
return 0;
drv = 0;
+ drvdrag = 0;
if (currentpage < 0) {
GetClientRect (hMainWnd, &r2);
GetClientRect (hStatusWnd, &r);
if (pt.x >= window_led_drives && pt.x < window_led_drives_end && window_led_drives > 0) {
drv = pt.x - window_led_drives;
drv /= (window_led_drives_end - window_led_drives) / 4;
+ drvdrag = 1;
if (drv < 0 || drv > 3)
drv = 0;
}
}
}
- if (zip) {
+ if (drvdrag) {
+ type = ZFILE_DISKIMAGE;
+ } else if (zip) {
do_filesys_insert (file);
continue;
}
-Final
+Beta 0.1:
+
+- "always on top" change works on the fly
+- "no taskbar button" works on the fly
+- missing stack frame type 4 added to RTE
+- dragging zipped adf to floppy leds mounted it as a filesystem, not
+ as a disk image (I guess zip containing only disk image(s) dropped to
+ WinUAE window should also mount as a disk image?)
+- emulated OCS-only "scanline" effect if DDFSTRT < 0x18. (Music disks
+ Ode to Ramon I and II by Digital Force. ECS = scroller is unreadable
+ and without "scanline" effect)
+- "latest news/abandon"-fix broke "nakudemo"-fix, both work now
+- parallel/serial/midi select menus didn't work
+- Input-panel numeric boxes at the bottom didn't work (same as above)
+- sleep_millis() was not thread-safe (could have caused random timing
+ glitches in some very rare cases)
+- emulate joystick 2nd/3rd button pullup resistor because some games
+ require it (and apparently some/many Amiga compatible 2+ button pads
+ have it). For example BC.Kid 2-button mode won't work without
+ joystick/pad with pullup resistor in second button pin. (regular
+ single button joysticks don't have pullups) Analog joystick update in
+ 1.5.x "broke" this.
+- POTxDAT X and Y counter bytes were inverted (Aladdin second button)
+- reset current disk sound parameters when on the fly drive sound
+ settings are changed (does not fix missing motor sound until drive
+ motor restarts, not worth the trouble, at least not yet)
+- replaced "shouldn't happen" abort()'s in JIT with error dialog and
+ forced hard reset
+- highgfx superhires mode missing pixels fixed (also possible in some
+ normal max overscanned AGA-only screenmodes)
+
+
+Final 1.5.2
- uaescsi.device only updated CMD_GETGEOMETRY parameters when emulation
was started (and also broke CMD_READ if there was no CD in drive)
#include "debug_win32.h"
#include "win32.h"
#include "registry.h"
+#include "uae.h"
#define SHOW_CONSOLE 0
{
fclose (f);
}
+
+void jit_abort (const char *format,...)
+{
+ static int happened;
+ int count;
+ char buffer[WRITE_LOG_BUF_SIZE];
+ va_list parms;
+ va_start (parms, format);
+
+ count = _vsnprintf (buffer, WRITE_LOG_BUF_SIZE - 1, format, parms);
+ writeconsole (buffer);
+ va_end (parms);
+ if (!happened)
+ gui_message ("JIT: Serious error:\n%s", buffer);
+ happened = 1;
+ uae_reset (1);
+}
+
+
+