#ifdef HAVE_STEREO_SUPPORT
+static void make6ch (uae_s32 d0, uae_s32 d1, uae_s32 d2, uae_s32 d3)
+{
+ uae_s32 sum = d0 + d1 + d2 + d3;
+ PUT_SOUND_WORD (sum >> 1);
+ PUT_SOUND_WORD (sum >> 1);
+}
+
void sample16ss_handler (void)
{
uae_u32 data0 = audio_channel[0].current_sample;
put_sound_word_left (data0 << 2);
put_sound_word_right (data1 << 2);
- if (currprefs.sound_stereo == SND_6CH) {
- PUT_SOUND_WORD (0);
- PUT_SOUND_WORD (0);
- }
+ if (currprefs.sound_stereo == SND_6CH)
+ make6ch (data0, data1, data2, data3);
put_sound_word_left2 (data3 << 2);
put_sound_word_right2 (data2 << 2);
samplexx_anti_handler (datas);
put_sound_word_left (datas[0] << 2);
put_sound_word_right (datas[1] << 2);
- if (currprefs.sound_stereo == SND_6CH) {
- PUT_SOUND_WORD (0);
- PUT_SOUND_WORD (0);
- }
+ if (currprefs.sound_stereo == SND_6CH)
+ make6ch (datas[0], datas[1], datas[2], datas[3]);
put_sound_word_left2 (datas[3] << 2);
put_sound_word_right2 (datas[2] << 2);
check_sound_buffers ();
samplexx_sinc_handler (datas);
put_sound_word_left (datas[0] << 2);
put_sound_word_right (datas[1] << 2);
- if (currprefs.sound_stereo == SND_6CH) {
- PUT_SOUND_WORD (0);
- PUT_SOUND_WORD (0);
- }
+ if (currprefs.sound_stereo == SND_6CH)
+ make6ch (datas[0], datas[1], datas[2], datas[3]);
put_sound_word_left2 (datas[3] << 2);
put_sound_word_right2 (datas[2] << 2);
check_sound_buffers ();
STATIC_INLINE int sound_prefs_changed (void)
{
- return (changed_prefs.produce_sound != currprefs.produce_sound
+ if (changed_prefs.produce_sound != currprefs.produce_sound
|| changed_prefs.win32_soundcard != currprefs.win32_soundcard
|| changed_prefs.sound_stereo != currprefs.sound_stereo
- || changed_prefs.sound_stereo_separation != currprefs.sound_stereo_separation
- || changed_prefs.sound_mixed_stereo_delay != currprefs.sound_mixed_stereo_delay
|| changed_prefs.sound_maxbsiz != currprefs.sound_maxbsiz
|| changed_prefs.sound_freq != currprefs.sound_freq
- || changed_prefs.sound_auto != currprefs.sound_auto
+ || changed_prefs.sound_auto != currprefs.sound_auto)
+ return 1;
+
+ if (changed_prefs.sound_stereo_separation != currprefs.sound_stereo_separation
+ || changed_prefs.sound_mixed_stereo_delay != currprefs.sound_mixed_stereo_delay
|| changed_prefs.sound_interpol != currprefs.sound_interpol
|| changed_prefs.sound_volume != currprefs.sound_volume
|| changed_prefs.sound_stereo_swap_paula != currprefs.sound_stereo_swap_paula
|| changed_prefs.sound_stereo_swap_ahi != currprefs.sound_stereo_swap_ahi
|| changed_prefs.sound_filter != currprefs.sound_filter
- || changed_prefs.sound_filter_type != currprefs.sound_filter_type);
+ || changed_prefs.sound_filter_type != currprefs.sound_filter_type)
+ return -1;
+ return 0;
}
/* This computes the 1st order low-pass filter term b0.
void check_prefs_changed_audio (void)
{
+ int ch;
#ifdef DRIVESOUND
driveclick_check_prefs ();
#endif
- if (!sound_available || !sound_prefs_changed ())
+ if (!sound_available)
+ return;
+ ch = sound_prefs_changed ();
+ if (!ch)
return;
+ if (ch > 0) {
#ifdef AVIOUTPUT
- AVIOutput_Restart ();
+ AVIOutput_Restart ();
#endif
- clear_sound_buffers();
- set_audio();
+ clear_sound_buffers ();
+ }
+ set_audio ();
audio_activate();
}
-void set_audio(void)
+void set_audio (void)
{
int old_mixed_on = mixed_on;
int old_mixed_size = mixed_stereo_size;
int sep, delay;
+ int ch;
+
+
+ ch = sound_prefs_changed ();
+ if (ch >= 0)
+ close_sound ();
- close_sound ();
currprefs.produce_sound = changed_prefs.produce_sound;
currprefs.win32_soundcard = changed_prefs.win32_soundcard;
currprefs.sound_stereo = changed_prefs.sound_stereo;
- currprefs.sound_stereo_separation = changed_prefs.sound_stereo_separation;
- currprefs.sound_mixed_stereo_delay = changed_prefs.sound_mixed_stereo_delay;
currprefs.sound_auto = changed_prefs.sound_auto;
- currprefs.sound_interpol = changed_prefs.sound_interpol;
currprefs.sound_freq = changed_prefs.sound_freq;
currprefs.sound_maxbsiz = changed_prefs.sound_maxbsiz;
+
+ currprefs.sound_stereo_separation = changed_prefs.sound_stereo_separation;
+ currprefs.sound_mixed_stereo_delay = changed_prefs.sound_mixed_stereo_delay;
+ currprefs.sound_interpol = changed_prefs.sound_interpol;
currprefs.sound_filter = changed_prefs.sound_filter;
currprefs.sound_filter_type = changed_prefs.sound_filter_type;
currprefs.sound_volume = changed_prefs.sound_volume;
currprefs.sound_stereo_swap_paula = changed_prefs.sound_stereo_swap_paula;
currprefs.sound_stereo_swap_ahi = changed_prefs.sound_stereo_swap_ahi;
- if (currprefs.produce_sound >= 2) {
- if (!init_audio ()) {
- if (! sound_available) {
- write_log ("Sound is not supported.\n");
- } else {
- write_log ("Sorry, can't initialize sound.\n");
- currprefs.produce_sound = 0;
- /* So we don't do this every frame */
- changed_prefs.produce_sound = 0;
+ if (ch >= 0) {
+ if (currprefs.produce_sound >= 2) {
+ if (!init_audio ()) {
+ if (! sound_available) {
+ write_log ("Sound is not supported.\n");
+ } else {
+ write_log ("Sorry, can't initialize sound.\n");
+ currprefs.produce_sound = 0;
+ /* So we don't do this every frame */
+ changed_prefs.produce_sound = 0;
+ }
}
}
+ next_sample_evtime = scaled_sample_evtime;
+ last_cycles = get_cycles () - 1;
+ compute_vsynctime ();
+ } else {
+ sound_volume (0);
}
- next_sample_evtime = scaled_sample_evtime;
- last_cycles = get_cycles () - 1;
- compute_vsynctime ();
sep = (currprefs.sound_stereo_separation = changed_prefs.sound_stereo_separation) * 3 / 2;
delay = currprefs.sound_mixed_stereo_delay = changed_prefs.sound_mixed_stereo_delay;
else if (currprefs.sound_filter_type == FILTER_SOUND_TYPE_A1200)
sound_use_filter = FILTER_MODEL_A1200;
}
- a500e_filter1_a0 = rc_calculate_a0(currprefs.sound_freq, 6200);
- a500e_filter2_a0 = rc_calculate_a0(currprefs.sound_freq, 20000);
- filter_a0 = rc_calculate_a0(currprefs.sound_freq, 7000);
- led_filter_audio();
+ a500e_filter1_a0 = rc_calculate_a0 (currprefs.sound_freq, 6200);
+ a500e_filter2_a0 = rc_calculate_a0 (currprefs.sound_freq, 20000);
+ filter_a0 = rc_calculate_a0 (currprefs.sound_freq, 7000);
+ led_filter_audio ();
/* Select the right interpolation method. */
if (sample_handler == sample16_handler
led_filter_on = 0;
if (led_filter_forced > 0 || (gui_data.powerled && led_filter_forced >= 0))
led_filter_on = 1;
- gui_led (0, gui_data.powerled);
}
uae_u8 *restore_audio (int i, uae_u8 *src)
#endif
if (!blitter_cycle_exact)
return;
+
+ if (blit_linecyclecounter > 0) {
+ while (blit_linecyclecounter > 0 && blit_last_hpos < hpos) {
+ blit_linecyclecounter--;
+ blit_last_hpos++;
+ }
+ if (blit_last_hpos > maxhpos)
+ blit_last_hpos = 0;
+ }
+ if (blit_linecyclecounter > 0) {
+ blit_last_hpos = hpos;
+ return;
+ }
+
if (blitline) {
blt_info.got_cycle = 1;
decide_blitter_line (hpos);
blitter_vcounter1 = blitter_vcounter2 = 0;
if (blit_nod)
blitter_vcounter2 = blt_info.vblitsize;
- blit_linecyclecounter = 0;
+ blit_linecyclecounter = 2;
if (blit_ch == 0)
blit_maxcyclecounter = blt_info.hblitsize * blt_info.vblitsize;
return;
p->ghostscript_parameters[0] = 0;
p->uae_hide = 0;
+ memset (&p->jports[0], 0, sizeof (struct jport));
+ memset (&p->jports[1], 0, sizeof (struct jport));
p->jports[0].id = JSEM_MICE;
p->jports[1].id = JSEM_KBDLAYOUT;
p->keyboard_lang = KBD_LANG_US;
static unsigned long ciaatod, ciabtod, ciaatol, ciabtol, ciaaalarm, ciabalarm;
static int ciaatlatch, ciabtlatch;
-static int oldled, oldovl;
+static int oldled, oldovl, led_changed;
unsigned int ciabpra;
}
#endif
-void CIA_vsync_handler ()
+static int led_times;
+static unsigned long led_on, led_cycle;
+
+
+static void calc_led (int old_led)
{
+ unsigned long c = get_cycles ();
+ unsigned long t = c - led_cycle;
+ if (old_led)
+ led_on += t;
+ led_times++;
+ led_cycle = c;
+}
+
+static void led_vsync (void)
+{
+ gui_data.powerled_brightness = gui_data.powerled ? 255 : 0;
+ calc_led (gui_data.powerled);
+ if (led_on > 0 && led_times > 2) {
+ int v = led_on / CYCLE_UNIT * 256 / (maxhpos * maxvpos);
+ if (v < 0)
+ v = 0;
+ if (v > 255)
+ v = 255;
+ gui_data.powerled_brightness = v;
+ }
+ led_on = 0;
+ led_times = 0;
+ if (led_changed)
+ gui_led (0, gui_data.powerled_brightness);
+ led_changed = 0;
+ led_cycle = get_cycles ();
+}
+
+void CIA_vsync_handler (void)
+{
+ led_vsync ();
#ifdef TOD_HACK
if (currprefs.tod_hack && ciaatodon) {
struct timeval tv;
static void bfe001_change (void)
{
uae_u8 v = ciaapra;
-
+ int led;
+
v |= ~ciaadra; /* output is high when pin's direction is input */
- if ((v & 2) != oldled) {
- int led = (v & 2) ? 0 : 1;
- oldled = v & 2;
+ led = (v & 2) ? 0 : 1;
+ if (led != oldled) {
+ calc_led (oldled);
+ oldled = led;
gui_data.powerled = led;
+ led_changed = 1;
led_filter_audio ();
}
if (currprefs.cs_ciaoverlay && (v & 1) != oldovl) {
zfile_fclose (f);
}
-void rtc_hardreset(void)
+void rtc_hardreset (void)
{
if (currprefs.cs_rtc == 1) { /* MSM6242B */
clock_bank.name = "Battery backed up clock (MSM6242B)";
int vblank_hz = VBLANK_HZ_PAL, fake_vblank_hz, vblank_skip, doublescan;
frame_time_t syncbase;
static int fmode;
-unsigned int beamcon0, new_beamcon0;
+uae_u16 beamcon0, new_beamcon0;
uae_u16 vtotal = MAXVPOS_PAL, htotal = MAXHPOS_PAL;
static uae_u16 hsstop, hbstrt, hbstop, vsstop, vbstrt, vbstop, hsstrt, vsstrt, hcenter;
static int interlace_started;
static void calcsprite (void)
{
- sprite_maxx = max_diwlastword;
+ sprite_maxx = 0x7fff;
sprite_minx = 0;
if (thisline_decision.diwlastword >= 0)
sprite_maxx = tospritexdiw (thisline_decision.diwlastword);
}
}
-static void CIA_vsync_prehandler(void)
+static void CIA_vsync_prehandler (void)
{
CIA_vsync_handler ();
#if 0
if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) {
decide_blitter (hpos);
memset (cycle_line, 0, sizeof cycle_line);
- alloc_cycle(1, CYCLE_REFRESH);
- alloc_cycle(3, CYCLE_REFRESH);
- alloc_cycle(5, CYCLE_REFRESH);
- alloc_cycle(7, CYCLE_REFRESH);
+ alloc_cycle (1, CYCLE_REFRESH); /* strobe */
+ alloc_cycle (3, CYCLE_REFRESH);
+ alloc_cycle (5, CYCLE_REFRESH);
+ alloc_cycle (7, CYCLE_REFRESH);
}
#endif
static int cia_hsync;
cia_hsync -= 256;
if (cia_hsync <= 0) {
- CIA_vsync_prehandler();
+ CIA_vsync_prehandler ();
cia_hsync += ((MAXVPOS_PAL * MAXHPOS_PAL * 50 * 256) / (maxhpos * (currprefs.cs_ciaatod == 2 ? 60 : 50)));
}
}
visible_left_border = prev_x_adjust;
}
} else {
- visible_left_border = max_diwlastword - gfxvidinfo.width;
- if (doublescan)
- visible_left_border = (max_diwlastword - 48) / 2 - gfxvidinfo.width;
+ if (beamcon0 & 0x80) {
+ int w = gfxvidinfo.width;
+ if (max_diwstop - min_diwstart < w)
+ visible_left_border = (max_diwstop - min_diwstart - w) / 2 + min_diwstart;
+ else
+ visible_left_border = max_diwstop - w - (max_diwstop - min_diwstart - w) / 2;
+ } else {
+ visible_left_border = max_diwlastword - gfxvidinfo.width;
+ }
}
if (currprefs.gfx_xcenter_pos >= 0) {
int val = currprefs.gfx_xcenter_pos >> RES_MAX;
side = gui_data.drive_side;
} else if (led == 0) {
pos = 3;
+ //on = gui_data.powerled_brightness > 0;
+ on_rgb = ((gui_data.powerled_brightness * 10 / 16) + 0x33) << 16;
on = gui_data.powerled;
- on_rgb = 0xcc0000;
+ //on_rgb = 0xcc0000;
off_rgb = 0x330000;
} else if (led == 5) {
pos = 5;
lightpen_y1 = lightpen_y2 = -1;
sprite_buffer_res = (currprefs.chipset_mask & CSMASK_AGA) ? RES_SUPERHIRES : RES_LORES;
- if (sprite_buffer_res > currprefs.gfx_resolution)
- sprite_buffer_res = currprefs.gfx_resolution;
+ if (sprite_buffer_res > currprefs.gfx_resolution + (doublescan ? 1 : 0))
+ sprite_buffer_res = currprefs.gfx_resolution + (doublescan ? 1 : 0);
+ if (sprite_buffer_res > RES_SUPERHIRES)
+ sprite_buffer_res = RES_SUPERHIRES;
}
void drawing_init (void)
#include "a2091.h"
#include "cdtv.h"
#include "sana2.h"
+#include "uaeresource.h"
#define TRACING_ENABLED 0
#if TRACING_ENABLED
}
}
-/*
-static uaecptr uaeresource_startup (uaecptr resaddr)
-{
- uaecptr ROM_uaeresource_resname, ROM_uaeresource_resid;
-
- ROM_uaeresource_resname = ds ("uae.resource");
- ROM_uaeresource_resid = ds ("uae.resource 0.1");
- put_word (resaddr + 0x0, 0x4AFC);
- put_long (resaddr + 0x2, resaddr);
- put_long (resaddr + 0x6, resaddr + 0x1A); // Continue scan here
- put_word (resaddr + 0xA, 0x0001); // RTF_COLDSTART; Version 1
- put_word (resaddr + 0xC, 0x0801); // NT_RESOURCE; pri 01
- put_long (resaddr + 0xE, ROM_uaeresource_resname);
- put_long (resaddr + 0x12, ROM_uaeresource_resid);
- put_long (resaddr + 0x16, 0);
- resaddr += 0x1A;
- return resaddr;
-}
-*/
-
static uae_u32 REGPARAM2 filesys_diagentry (TrapContext *context)
{
uaecptr resaddr = m68k_areg (&context->regs, 2) + 0x10;
* Resident structures and call InitResident() for them at the end of the
* diag entry. */
- //resaddr = uaeresource_startup(resaddr);
+ resaddr = uaeres_startup (resaddr);
#ifdef SCSIEMU
resaddr = scsidev_startup (resaddr);
#endif
buf2[3] = 0;
}
- if (!GetDiskFreeSpaceEx (buf2, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes))
- {
+ if (!GetDiskFreeSpaceEx (buf2, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) {
write_log ("GetDiskFreeSpaceEx() failed err=%d\n", GetLastError());
return -1;
}
extern void audio_update_irq (uae_u16);
extern void update_sound (int freq);
extern void led_filter_audio (void);
-extern void set_audio(void);
-extern int audio_activate(void);
+extern void set_audio (void);
+extern int audio_activate (void);
extern void audio_sampleripper(int);
extern int sampleripper_enabled;
extern unsigned long frametime, timeframes;
extern int plfstrt, plfstop, plffirstline, plflastline;
-extern uae_u16 htotal, vtotal;
+extern uae_u16 htotal, vtotal, beamcon0;
/* 100 words give you 1600 horizontal pixels. Should be more than enough for
* superhires. Don't forget to update the definition in genp2c.c as well.
#define NT_LIBRARY 9
#define NT_SIGNALSEM 15
+#define SIZEOF_LIBRARY 34
+
#ifndef MEMF_PUBLIC /* protection for AmigaDOS */
#define MEMF_PUBLIC 1
#define MEMF_CHIP 2
uae_u8 drive_writing[4]; /* drive is writing */
uae_u8 drive_disabled[4]; /* drive is disabled */
uae_u8 powerled; /* state of power led */
+ uae_u8 powerled_brightness; /* 0 to 255 */
uae_u8 drive_side; /* floppy side */
uae_u8 hd; /* harddrive */
uae_u8 cd; /* CD */
uae_u8 enabled;
};
+#define MAX_JPORTNAME 128
struct jport {
int id;
- char *name;
- char *configname;
+ char name[MAX_JPORTNAME];
+ char configname[MAX_JPORTNAME];
};
#define MAX_SPARE_DRIVES 20
extern uae_u8 *restore_hrtmon (uae_u8 *);
extern uae_u8 *save_hrtmon (int *, uae_u8 *);
-extern void savestate_initsave (char *filename, int docompress);
-extern int save_state (char *filename, char *description);
-extern void restore_state (char *filename);
+extern void savestate_initsave (const char *filename, int docompress, int nodialogs);
+extern int save_state (const char *filename, const char *description);
+extern void restore_state (const char *filename);
extern void savestate_restore_finish (void);
extern void custom_save_state (void);
--- /dev/null
+
+uaecptr uaeres_startup (uaecptr resaddr);
+void uaeres_install (void);
\ No newline at end of file
};
static struct input_queue_struct input_queue[INPUT_QUEUE_SIZE];
+
+static void freejport (struct uae_prefs *dst, int num)
+{
+ memset (&dst->jports[num], 0, sizeof (struct jport));
+}
+static void copyjport (const struct uae_prefs *src, struct uae_prefs *dst, int num)
+{
+ freejport (dst, num);
+ strcpy (dst->jports[num].configname, src->jports[num].configname);
+ strcpy (dst->jports[num].name, src->jports[num].name);
+ dst->jports[num].id = src->jports[num].id;
+}
+
static void out_config (struct zfile *f, int id, int num, char *s1, char *s2)
{
cfgfile_write (f, "input.%d.%s%d=%s\n", id, s1, num, s2);
sound_volume (1);
break;
case AKS_VOLMUTE:
- sound_volume (0);
+ sound_mute (0);
break;
case AKS_MVOLDOWN:
master_sound_volume (-1);
int joy, i;
int used[4] = { 0, 0, 0, 0};
- for (i = 0; i < 2; i++) {
- xfree (prefs->jports[i].name);
- xfree (prefs->jports[i].configname);
- prefs->jports[i].name = NULL;
- prefs->jports[i].configname = NULL;
- }
+ prefs->jports[0].name[0] = prefs->jports[1].name[0] = 0;
+ prefs->jports[0].configname[0] = prefs->jports[1].configname[0] = 0;
compatibility_device[0] = -1;
compatibility_device[1] = -1;
for (i = 0; i < MAX_INPUT_DEVICES; i++) {
if ((joy = jsem_ismouse (0, prefs)) >= 0) {
input_get_default_mouse (mice, joy, 0);
mice[joy].enabled = 1;
- prefs->jports[0].name = my_strdup (idev[IDTYPE_MOUSE].get_friendlyname (joy));
- prefs->jports[0].configname = my_strdup (idev[IDTYPE_MOUSE].get_uniquename (joy));
+ strncpy (prefs->jports[0].name, idev[IDTYPE_MOUSE].get_friendlyname (joy), MAX_JPORTNAME - 1);
+ strncpy (prefs->jports[0].configname, idev[IDTYPE_MOUSE].get_uniquename (joy), MAX_JPORTNAME - 1);
}
if ((joy = jsem_ismouse (1, prefs)) >= 0) {
input_get_default_mouse (mice, joy, 1);
mice[joy].enabled = 1;
- prefs->jports[1].name = my_strdup (idev[IDTYPE_MOUSE].get_friendlyname (joy));
- prefs->jports[1].configname = my_strdup (idev[IDTYPE_MOUSE].get_uniquename (joy));
+ strncpy (prefs->jports[1].name, idev[IDTYPE_MOUSE].get_friendlyname (joy), MAX_JPORTNAME - 1);
+ strncpy (prefs->jports[1].configname, idev[IDTYPE_MOUSE].get_uniquename (joy), MAX_JPORTNAME - 1);
}
joy = jsem_isjoy (1, prefs);
used[joy] = 1;
input_get_default_joystick (joysticks, joy, 1);
joysticks[joy].enabled = 1;
- prefs->jports[1].name = my_strdup (idev[IDTYPE_JOYSTICK].get_friendlyname (joy));
- prefs->jports[1].configname = my_strdup (idev[IDTYPE_JOYSTICK].get_uniquename (joy));
+ strncpy (prefs->jports[1].name, idev[IDTYPE_JOYSTICK].get_friendlyname (joy), MAX_JPORTNAME - 1);
+ strncpy (prefs->jports[1].configname, idev[IDTYPE_JOYSTICK].get_uniquename (joy), MAX_JPORTNAME - 1);
}
joy = jsem_isjoy (0, prefs);
used[joy] = 1;
input_get_default_joystick (joysticks, joy, 0);
joysticks[joy].enabled = 1;
- prefs->jports[0].name = my_strdup (idev[IDTYPE_JOYSTICK].get_friendlyname (joy));
- prefs->jports[0].configname = my_strdup (idev[IDTYPE_JOYSTICK].get_uniquename (joy));
+ strncpy (prefs->jports[0].name, idev[IDTYPE_JOYSTICK].get_friendlyname (joy), MAX_JPORTNAME - 1);
+ strncpy (prefs->jports[0].configname, idev[IDTYPE_JOYSTICK].get_uniquename (joy), MAX_JPORTNAME - 1);
}
for (joy = 0; used[joy]; joy++);
int m = jsem_ismouse (1, &currprefs);
int k = jsem_iskbdjoy (1, &currprefs);
- currprefs.jports[0].id = changed_prefs.jports[0].id;
- currprefs.jports[1].id = changed_prefs.jports[1].id;
+ copyjport (&changed_prefs, &currprefs, 0);
+ copyjport (&changed_prefs, &currprefs, 1);
#ifdef RETROPLATFORM
rp_input_change (0);
rp_input_change (1);
dst->input_joymouse_speed = src->input_joymouse_speed;
dst->input_mouse_speed = src->input_mouse_speed;
dst->input_autofire_framecnt = src->input_autofire_framecnt;
- dst->jports[0].id = src->jports[0].id;
- dst->jports[1].id = src->jports[1].id;
+ copyjport (src, dst, 0);
+ copyjport (src, dst, 1);
for (i = 0; i < MAX_INPUT_SETTINGS + 1; i++) {
for (j = 0; j < MAX_INPUT_DEVICES; j++) {
#include "sana2.h"
#include "blkdev.h"
#include "gfxfilter.h"
+#include "uaeresource.h"
#ifdef USE_SDL
#include "SDL.h"
#endif
-long int version = 256*65536L*UAEMAJOR + 65536L*UAEMINOR + UAESUBREV;
+long int version = 256 * 65536L * UAEMAJOR + 65536L * UAEMINOR + UAESUBREV;
struct uae_prefs currprefs, changed_prefs;
#endif
#ifdef FILESYS
rtarea_init ();
+ uaeres_install ();
hardfile_install ();
#endif
savestate_init ();
static uae_u32 chipmem_dummy (void)
{
/* not really right but something random that has more ones than zeros.. */
- return rand () | rand ();
+ return 0xffff & ~((1 << (rand () & 31)) | (1 << (rand () & 31)));
}
void REGPARAM2 chipmem_dummy_bput (uaecptr addr, uae_u32 b)
{
#ifdef JIT
special_mem |= S_READ;
#endif
- return chipmem_dummy ();
+ return (chipmem_dummy () << 16) | chipmem_dummy ();
}
static uae_u32 REGPARAM2 chipmem_agnus_lget (uaecptr addr)
};
#define fkickmem_size 524288
+static int a3000_f0;
void a3000_fakekick (int map)
{
static uae_u8 *blop;
- static int f0;
if (map) {
uae_u8 *fkickmemory = a3000lmemory + allocated_a3000lmem - fkickmem_size;
if (fkickmemory[5] == 0xfc) {
memcpy (kickmemory, fkickmemory, fkickmem_size / 2);
memcpy (kickmemory + fkickmem_size / 2, fkickmemory, fkickmem_size / 2);
- if (!extendedkickmemory) {
- if (need_uae_boot_rom () != 0xf00000) {
- extendedkickmem_size = 65536;
- extendedkickmem_mask = extendedkickmem_size - 1;
- extendedkickmemory = mapped_malloc (extendedkickmem_size, "rom_f0");
- extendedkickmem_bank.baseaddr = extendedkickmemory;
- memcpy (extendedkickmemory, fkickmemory + fkickmem_size / 2, 65536);
- map_banks (&extendedkickmem_bank, 0xf0, 1, 1);
- f0 = 1;
- } else {
- write_log ("A3000 Bonus hack: can't map bonus when uae boot rom is enabled\n");
- }
+ if (need_uae_boot_rom () != 0xf00000) {
+ extendedkickmem_size = 65536;
+ extendedkickmem_mask = extendedkickmem_size - 1;
+ extendedkickmemory = mapped_malloc (extendedkickmem_size, "rom_f0");
+ extendedkickmem_bank.baseaddr = extendedkickmemory;
+ memcpy (extendedkickmemory, fkickmemory + fkickmem_size / 2, 65536);
+ map_banks (&extendedkickmem_bank, 0xf0, 1, 1);
+ a3000_f0 = 1;
+ } else {
+ write_log ("A3000 Bonus hack: can't map bonus when uae boot rom is enabled\n");
}
} else {
memcpy (kickmemory, fkickmemory, fkickmem_size);
}
}
} else {
- if (f0) {
+ if (a3000_f0) {
map_banks (&dummy_bank, 0xf0, 1, 1);
mapped_free(extendedkickmemory);
extendedkickmemory = NULL;
- f0 = 0;
+ a3000_f0 = 0;
}
if (blop)
memcpy (kickmemory, blop, fkickmem_size);
return;
if (x->size > size) {
- write_log ("NATMEM WARNING: size mismatch mapping at %08x (size %08x, delsize %08x)\n",start,x->size,size);
+ if (isdirectjit ())
+ write_log ("NATMEM WARNING: size mismatch mapping at %08x (size %08x, delsize %08x)\n",start,x->size,size);
size = x->size;
}
#if 0
#ifdef AUTOCONFIG
map_banks (&expamem_bank, 0xE8, 1, 0);
#endif
+ if (a3000_f0)
+ a3000_fakekick (1);
/* Map the chipmem into all of the lower 8MB */
map_overlay (1);
: License version 2 as published by the Free Software Foundation.
Authors : os, mcb
Created : 2007-08-27 13:55:49
- Updated : 2008-04-03 15:18:00
+ Updated : 2008-05-20 10:37:00
Comment : RP Player interprocess communication include file
*****************************************************************************/
#include <windows.h>
-#define RPLATFORM_API_VER "1.0"
+#define RPLATFORM_API_VER "1.1"
#define RPLATFORM_API_VER_MAJOR 1
-#define RPLATFORM_API_VER_MINOR 0
+#define RPLATFORM_API_VER_MINOR 1
#define RPIPC_HostWndClass "RetroPlatformHost%s"
#define RPIPC_GuestWndClass "RetroPlatformGuest%d"
#define RPIPCHM_ESCAPEKEY (WM_APP + 210)
#define RPIPCHM_EVENT (WM_APP + 211)
#define RPIPCHM_MOUSECAPTURE (WM_APP + 212)
+#define RPIPCHM_SAVESTATE (WM_APP + 213)
+#define RPIPCHM_LOADSTATE (WM_APP + 214)
// ****************************************************************************
#define RP_FEATURE_PAUSE 0x00000080 // pause functionality is available (see RPIPCHM_PAUSE message)
#define RP_FEATURE_TURBO 0x00000100 // turbo mode functionality is available (see RPIPCHM_TURBO message)
#define RP_FEATURE_VOLUME 0x00000200 // volume adjustment is possible (see RPIPCHM_VOLUME message)
+#define RP_FEATURE_STATE 0x00000400 // loading and saving of emulation state is supported (see RPIPCHM_SAVESTATE message)
// Screen Modes
#define RP_SCREENMODE_1X 0x00000000 // 1x window or full-screen mode ("CGA mode")
#define RP_SCREENMODE_2X 0x00000001 // 2x window or full-screen mode ("VGA mode")
#define RP_SCREENMODE_3X 0x00000002 // 3x window or full-screen mode ("triple CGA mode")
#define RP_SCREENMODE_4X 0x00000003 // 4x window or full-screen mode ("double VGA mode")
+#define RP_SCREENMODE_XX 0x000000FF // autoset maximum nX (integer n, preserve ratio)
#define RP_SCREENMODE_FULLSCREEN_1 0x00000100 // full screen on primary (default) display
#define RP_SCREENMODE_FULLSCREEN_2 0x00000200 // full screen on secondary display (fallback to 1 if unavailable)
#define RP_SCREENMODE_FULLWINDOW 0x00010000 // use "full window" when in fullscreen (no gfx card full screen)
-#define RP_SCREENMODE_XX 0x000000FF
#define RP_SCREENMODE_MODE(m) ((m) & 0x000000FF) // given a mode 'm' returns the #X mode
#define RP_SCREENMODE_DISPLAY(m) (((m) >> 8) & 0x000000FF) // given a mode 'm' returns the display number (1-255) or 0 if full screen is not active
write_log ("'%s'\n", buf);
did->configname = my_strdup (buf);
rdi = (PRID_DEVICE_INFO)buf;
+ memset (rdi, 0, sizeof (RID_DEVICE_INFO));
rdi->cbSize = sizeof (RID_DEVICE_INFO);
if (pGetRawInputDeviceInfo (h, RIDI_DEVICEINFO, NULL, &vtmp) == -1)
continue;
PRID_DEVICE_INFO_MOUSE rdim = &rdi->mouse;
write_log ("id=%d buttons=%d hw=%d rate=%d\n",
rdim->dwId, rdim->dwNumberOfButtons, rdim->fHasHorizontalWheel, rdim->dwSampleRate);
+ if (rdim->dwNumberOfButtons >= MAX_MAPPINGS) {
+ write_log ("bogus number of buttons, ignored\n");
+ continue;
+ }
did->buttons = rdim->dwNumberOfButtons;
for (j = 0; j < did->buttons; j++) {
did->buttonsort[j] = j;
return dierr;
}
-static D3DXMATRIX* xD3DXMatrixPerspectiveFovLH(D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf)
+static D3DXMATRIX* xD3DXMatrixPerspectiveFovLH (D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf)
{
double xscale, yscale, sine, dz;
memset(pOut, 0, sizeof(D3DXMATRIX));
d3d_enabled = 0;
}
-static int restoredeviceobjects(void)
+static int restoredeviceobjects (void)
{
// Store render target surface desc
LPDIRECT3DSURFACE9 bb;
switch (currprefs.gfx_filter_filtermode & 1)
{
- case 0:
+ case 0:
v = D3DTEXF_POINT;
break;
- case 1:
- default:
+ case 1:
+ default:
v = D3DTEXF_LINEAR;
break;
}
{
LPDIRECT3DTEXTURE9 t;
HRESULT hr;
- int w = *ww;
- int h = *hh;
-
- if (w < 256)
- w = 256;
- else if (w < 512)
- w = 512;
- else if (w < 1024)
- w = 1024;
- else if (w < 2048)
- w = 2048;
- else
- w = 4096;
-
- if (h < 256)
- h = 256;
- else if (h < 512)
- h = 512;
- else if (h < 1024)
- h = 1024;
- else if (h < 2048)
- h = 2048;
- else
- h = 4096;
-
- hr = IDirect3DDevice9_CreateTexture (d3ddev, w, h, 1, 0, format, D3DPOOL_MANAGED, &t, NULL);
- if (FAILED (hr)) {
- write_log ("DIDirect3DDevice9_CreateTexture failed: %s\n", D3D_ErrorString (hr));
- return 0;
+ int w, h, npot;
+
+ for (npot = 1; npot >= 0; npot--) {
+ w = *ww;
+ h = *hh;
+ if (!npot) {
+ if (w < 256)
+ w = 256;
+ else if (w < 512)
+ w = 512;
+ else if (w < 1024)
+ w = 1024;
+ else if (w < 2048)
+ w = 2048;
+ else
+ w = 4096;
+
+ if (h < 256)
+ h = 256;
+ else if (h < 512)
+ h = 512;
+ else if (h < 1024)
+ h = 1024;
+ else if (h < 2048)
+ h = 2048;
+ else
+ h = 4096;
+ }
+
+ hr = IDirect3DDevice9_CreateTexture (d3ddev, w, h, 1, 0, format, D3DPOOL_MANAGED, &t, NULL);
+ if (FAILED (hr)) {
+ write_log ("DIDirect3DDevice9_CreateTexture failed: %s\n", D3D_ErrorString (hr));
+ if (npot)
+ continue;
+ return 0;
+ }
+ break;
}
*ww = w;
return errmsg;
}
- d3dDLL = LoadLibrary("D3D9.DLL");
+ d3dDLL = LoadLibrary ("D3D9.DLL");
if (d3dDLL == NULL) {
strcpy (errmsg, "Direct3D: DirectX 9 or newer required");
return errmsg;
t_depth = depth;
switch (depth)
{
- case 32:
+ case 32:
if (currprefs.gfx_filter_scanlines)
tformat = D3DFMT_A8R8G8B8;
else
tformat = D3DFMT_X8R8G8B8;
break;
- case 15:
- case 16:
+ case 15:
+ case 16:
if (currprefs.gfx_filter_scanlines)
tformat = D3DFMT_A1R5G5B5;
else
#if 1
static void calc (float *xp, float *yp, float *sxp, float *syp)
{
+ float xm ,ym;
RECT sr, dr;
- float mx = (float)twidth / tin_w;
- float my = (float)theight / tin_h;
- int aw = twidth * window_w / tin_w;
- int ah = theight * window_h / tin_h;
- mx = 1 / mx;
- my = 1 / my;
+ //write_log("%d/%d/%d %d/%d/%d\n", twidth, window_w, tin_w, theight, window_h, tin_h);
getfilterrect2 (&sr, &dr, window_w, window_h, tin_w, tin_h, 1, tin_w, tin_h);
- OffsetRect (&dr, aw / 2, ah / 2);
+
+ //write_log ("%dx%d %dx%d\n", dr.left, dr.top, dr.right, dr.bottom);
+
+ xm = (float)twidth / tin_w;
+ ym = (float)theight / tin_h;
+
+ //write_log ("%fx%f\n", xm, ym);
+
*xp = dr.left;
*yp = dr.top;
- *sxp = *xp + (dr.right - dr.left) * mx;
- *syp = *yp + (dr.bottom - dr.top) * my;
+ *sxp = dr.right * xm;
+ *syp = dr.bottom * ym;
}
#else
static void calc (float *xp, float *yp, float *sxp, float *syp)
int D3D_needreset (void)
{
- HRESULT hr = IDirect3DDevice9_TestCooperativeLevel(d3ddev);
+ HRESULT hr = IDirect3DDevice9_TestCooperativeLevel (d3ddev);
if (hr == D3DERR_DEVICENOTRESET)
return 1;
return 0;
ti2d_type = -1;
if (depth == 15 || depth == 16) {
if (!packed_pixels) {
- sprintf(errmsg, "OPENGL: can't use 15/16 bit screen depths because\n"
+ sprintf (errmsg, "OPENGL: can't use 15/16 bit screen depths because\n"
"EXT_packed_pixels extension was not found.");
OGL_free ();
return errmsg;
static void OGL_dorender (int newtex)
{
uae_u8 *data = gfxvidinfo.bufmem;
- float x1, y1, x2, y2;
- double fx, fy, xm, ym;
-
-#if 0
- double mx, my, fx, fy, fx2, fy2, xm, ym;
- float tx, ty;
-
- xm = currprefs.gfx_lores ? 2 : 1;
- ym = currprefs.gfx_linedbl ? 2 : 1;
+ float x1, y1, x2, y2, xm, ym;
+ RECT sr, dr;
- fx = (required_texture_size * w_width / t_width) / 2.0;
- fy = (required_texture_size * w_height / t_height) / 2.0;
+#if 1
+ getfilterrect2 (&sr, &dr, w_width, w_height, t_width, t_height, 1, t_width, t_height);
+ xm = (float)required_texture_size / t_width;
+ ym = (float)required_texture_size / t_height;
- tx = fx / ((currprefs.gfx_filter_horiz_zoom_mult + currprefs.gfx_filter_horiz_zoom / 4.0) / 1000.0);
- ty = fy / ((currprefs.gfx_filter_vert_zoom_mult + currprefs.gfx_filter_vert_zoom / 4.0) / 1000.0);
+ //write_log ("%fx%f\n", xm, ym);
- mx = (currprefs.gfx_filter_horiz_offset / 1000.0) * fx;
- my = (currprefs.gfx_filter_vert_offset / 1000.0) * fy;
-
- x1 = -tx;
- y1 = -ty;
- x2 = tx;
- y2 = ty;
- x1 += fx + mx;
- y1 += fy + my;
- x2 += tx + mx;
- y2 += ty + my;
+ x1 = dr.left;
+ y1 = dr.top;
+ x2 = dr.right * xm;
+ y2 = dr.bottom * ym;
#else
+ double fx, fy, xm, ym;
xm = 2 >> currprefs.gfx_resolution;
ym = currprefs.gfx_linedbl ? 1 : 2;
* 2. Picasso-->Picasso transition, via SetPanning().
* 3. whenever the graphics code notifies us that the screen contents have been lost.
*/
-extern unsigned int new_beamcon0;
+extern uae_u16 new_beamcon0;
void picasso_refresh (void)
{
struct RenderInfo ri;
#define IDS_SOUND_STEREO2 256
#define IDS_INPUT_CUSTOMEVENT 257
#define IDS_DEFAULT_NEWWINUAE 258
+#define IDS_SOUND_CLONED51 259
+#define IDS_SOUND_51 260
#define IDS_NUMSG_NEEDEXT2 300
#define IDS_NUMSG_NOROMKEY 301
#define IDS_NUMSG_KSROMCRCERROR 302
IDS_SOUND_STEREO2 "Cloned Stereo (4 Channels)"
IDS_INPUT_CUSTOMEVENT "<Custom event>"
IDS_DEFAULT_NEWWINUAE "WinUAE default (new)"
+ IDS_SOUND_CLONED51 "Cloned Stereo (5.1)"
+ IDS_SOUND_51 "5.1 Channels"
END
STRINGTABLE
#include "win32.h"
#include "win32gfx.h"
#include "filesys.h"
+#include "savestate.h"
#include "gfxfilter.h"
static int initialized;
case RPIPCGM_DEVICECONTENT: return "RPIPCGM_DEVICECONTENT";
case RPIPCGM_DEVICESEEK: return "RPIPCGM_DEVICESEEK";
case RPIPCGM_ESCAPED: return "RPIPCGM_ESCAPED";
+
case RPIPCHM_CLOSE: return "RPIPCHM_CLOSE";
case RPIPCHM_SCREENMODE: return "RPIPCHM_SCREENMODE";
case RPIPCHM_SCREENCAPTURE: return "RPIPCHM_SCREENCAPTURE";
case RPIPCHM_MOUSECAPTURE: return "RPIPCHM_MOUSECAPTURE";
case RPIPCHM_DEVICECONTENT: return "RPIPCHM_DEVICECONTENT";
case RPIPCHM_PING: return "RPIPCHM_PING";
+ case RPIPCHM_SAVESTATE: return "RPIPCHM_SAVESTATE";
+ case RPIPCHM_LOADSTATE: return "RPIPCHM_LOADSTATE";
default: return "UNKNOWN";
}
xfree (s);
return ok ? TRUE : FALSE;
}
+ case RPIPCHM_SAVESTATE:
+ {
+ char *s = ua ((WCHAR*)pData);
+ DWORD ret = FALSE;
+ if (vpos == 0) {
+ save_state (s, "AF");
+ ret = 1;
+ } else {
+ savestate_initsave (s, 1, TRUE);
+ ret = -1;
+ }
+ xfree (s);
+ return ret;
+ }
+ case RPIPCHM_LOADSTATE:
+ {
+ char *s = ua ((WCHAR*)pData);
+ DWORD ret = FALSE;
+ DWORD attr = GetFileAttributes (s);
+ if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY)) {
+ savestate_state = STATE_DORESTORE;
+ strcpy (savestate_fname, s);
+ ret = -1;
+ }
+ xfree (s);
+ return ret;
+ }
}
return FALSE;
}
feat = RP_FEATURE_POWERLED | RP_FEATURE_SCREEN1X | RP_FEATURE_FULLSCREEN;
feat |= RP_FEATURE_PAUSE | RP_FEATURE_TURBO | RP_FEATURE_VOLUME | RP_FEATURE_SCREENCAPTURE;
+ feat |= RP_FEATURE_STATE;
if (!WIN32GFX_IsPicassoScreen ())
feat |= RP_FEATURE_SCREEN2X | RP_FEATURE_SCREEN4X;
RPSendMessagex (RPIPCGM_FEATURES, feat, 0, NULL, 0, &guestinfo, NULL);
switch (led)
{
case 0:
- RPSendMessage (RPIPCGM_POWERLED, onoff ? 100 : 0, 0, NULL, 0, &guestinfo, NULL);
+ RPSendMessage (RPIPCGM_POWERLED, onoff >= 250 ? 100 : onoff * 10 / 26, 0, NULL, 0, &guestinfo, NULL);
break;
case 1:
case 2:
return setget_master_volume_xp (0, volume, mute);
}
-void sound_volume (int dir)
+void sound_mute (int newmute)
{
- if (dir == 0)
+ if (newmute < 0)
mute = mute ? 0 : 1;
+ else
+ mute = newmute;
+ set_volume (currprefs.sound_volume, mute);
+}
+
+void sound_volume (int dir)
+{
currprefs.sound_volume -= dir * 10;
if (currprefs.sound_volume < 0)
currprefs.sound_volume = 0;
extern char **enumerate_sound_devices (int *total);
extern int drivesound_init (void);
extern void drivesound_free (void);
+extern void sound_mute (int);
extern void sound_volume (int);
extern void set_volume (int, int);
extern void master_sound_volume (int);
((uae_u16*)sndbufpt)[1] = ((uae_u16*)sndbufpt)[-1];
sndbufpt = (uae_u16 *)(((uae_u8 *)sndbufpt) + 2 * 2);
} else if (currprefs.sound_stereo == SND_6CH_CLONEDSTEREO) {
- ((uae_u16*)sndbufpt)[2] = ((uae_u16*)sndbufpt)[-2];
- ((uae_u16*)sndbufpt)[3] = ((uae_u16*)sndbufpt)[-1];
+ uae_s16 *p = ((uae_s16*)sndbufpt);
+ uae_s32 sum;
+ p[2] = p[-2];
+ p[3] = p[-1];
+ sum = (uae_s32)(p[-2]) + (uae_s32)(p[-1]) + (uae_s32)(p[2]) + (uae_s32)(p[3]);
+ p[0] = sum >> 3;
+ p[1] = sum >> 3;
sndbufpt = (uae_u16 *)(((uae_u8 *)sndbufpt) + 4 * 2);
}
if ((char *)sndbufpt - (char *)sndbuffer >= sndbufsize) {
my = (signed short) HIWORD (lParam);
mx -= mouseposx;
my -= mouseposy;
- if (recapture && isfullscreen() <= 0) {
+ if (recapture && isfullscreen () <= 0) {
setmouseactive (1);
setamigamouse (mx, my);
return 0;
setmousestate (dinput_winmouse (), 0, mx, 0);
setmousestate (dinput_winmouse (), 1, my, 0);
}
- } else if (!mouseactive && isfullscreen() <= 0) {
+ } else if (!mouseactive && isfullscreen () <= 0) {
setmousestate (0, 0, mx, 1);
setmousestate (0, 1, my, 1);
}
case WM_MOVING:
{
LRESULT lr = DefWindowProc (hWnd, message, wParam, lParam);
- WIN32GFX_WindowMove();
+ WIN32GFX_WindowMove ();
return lr;
}
case WM_MOVE:
rkey = HKEY_LOCAL_MACHINE;
else
rkey = HKEY_CURRENT_USER;
- strcpy(rpath1, "Software\\Classes\\");
- strcpy(rpath2, rpath1);
- strcpy(rpath3, rpath1);
- strcat(rpath1, ".uae");
- strcat(rpath2, "WinUAE\\shell\\Edit\\command");
- strcat(rpath3, "WinUAE\\shell\\Open\\command");
+ strcpy (rpath1, "Software\\Classes\\");
+ strcpy (rpath2, rpath1);
+ strcpy (rpath3, rpath1);
+ strcat (rpath1, ".uae");
+ strcat (rpath2, "WinUAE\\shell\\Edit\\command");
+ strcat (rpath3, "WinUAE\\shell\\Open\\command");
/* Create/Open the hWinUAEKey which points to our config-info */
if (RegCreateKeyEx (rkey, rpath1, 0, "", REG_OPTION_NON_VOLATILE,
size = sizeof (version);
if (regquerystr (NULL, "Version", version, &size)) {
if (checkversion (version))
- regsetstr(NULL, "Version", VersionStr);
+ regsetstr (NULL, "Version", VersionStr);
} else {
regsetstr (NULL, "Version", VersionStr);
}
strcpy (tmp2, tmp);
strcat (tmp2, "Amiga Files");
strcpy (tmp, tmp2);
- strcat(tmp, "\\WinUAE");
+ strcat (tmp, "\\WinUAE");
if (remove) {
if (GetFileAttributes (tmp) != INVALID_FILE_ATTRIBUTES) {
RemoveDirectory (tmp);
#define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
#define GETBDD(x) ((x) % 100)
-#define WINUAEBETA 19
+#define WINUAEBETA 20
#define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2008, 5, 17)
+#define WINUAEDATE MAKEBD(2008, 5, 24)
#define WINUAEEXTRA ""
#define WINUAEREV ""
case IDC_DOSAVESTATE:
case IDC_DOLOADSTATE:
statefile_previousfilter = openFileName.nFilterIndex;
- savestate_initsave (full_path, openFileName.nFilterIndex);
+ savestate_initsave (full_path, openFileName.nFilterIndex, FALSE);
break;
case IDC_CREATE:
{
SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_ADDSTRING, 0, (LPARAM)txt);
WIN32GUI_LoadUIString (IDS_SOUND_4CHANNEL, txt, sizeof (txt));
SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_ADDSTRING, 0, (LPARAM)txt);
- SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_ADDSTRING, 0, (LPARAM)"Cloned Stereo (4 Channels in 5.1)");
- SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_ADDSTRING, 0, (LPARAM)"4 Channels in 5.1");
+ WIN32GUI_LoadUIString (IDS_SOUND_CLONED51, txt, sizeof (txt));
+ SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_ADDSTRING, 0, (LPARAM)txt);
+ WIN32GUI_LoadUIString (IDS_SOUND_51, txt, sizeof (txt));
+ SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_ADDSTRING, 0, (LPARAM)txt);
SendDlgItemMessage (hDlg, IDC_SOUNDSTEREO, CB_SETCURSEL, workprefs.sound_stereo, 0);
SendDlgItemMessage(hDlg, IDC_SOUNDSWAP, CB_RESETCONTENT, 0, 0);
}
}
-static void init_portsdlg( HWND hDlg )
+static void init_portsdlg (HWND hDlg)
{
static int first;
int port, numdevs;
unload_ghostscript ();
ghostscript_available = 1;
}
+ joy0previous = joy1previous = -1;
}
if (!ghostscript_available) {
workprefs.parallel_postscript_emulation = 0;
}
- joy0previous = joy1previous = -1;
-
SendDlgItemMessage (hDlg, IDC_SERIAL, CB_RESETCONTENT, 0, 0L);
SendDlgItemMessage (hDlg, IDC_SERIAL, CB_ADDSTRING, 0, (LPARAM)szNone);
for (port = 0; port < MAX_SERIAL_PORTS && comports[port].name; port++) {
RelativePath="..\..\uaelib.c"
>
</File>
+ <File
+ RelativePath="..\..\uaeresource.c"
+ >
+ </File>
<File
RelativePath="..\..\uaeserial.c"
>
+Beta 20:
+
+- only reset sound when changing configuration if sound mode, sound card,
+ frequency, channels, or buffer size is changed
+- 5.1 sound settings now also send mixed sound to center and LFE channel
+ (mixing volume may need adjusting, please test)
+- superhires sprites in doublescan mode had halved horizontal resolution
+- power led fade support (very crappy)
+- possible fix to random joystick/mouse switch crash
+- programmed resolutions (doublescan) are now horizontally centered
+- right side max sprite clipping position was incorrect
+- D3D/OGL filters do not crash anymore but still do not work as expected..
+- added Amiga-side uae.resource, safe method to find "uae rom" base and
+ other information. Version of resource is UAEVERSION.UAEREVISION
+ NOTE: in compatible modes resource may not be available.
+ Check source for more information.
+
Beta 19:
- lha/lzh archives with directory entries ("-lhd-") crash fix
struct zfile *savestate_file;
static uae_u8 *replaybuffer, *replaybufferend;
-static int savestate_docompress, savestate_specialdump;
+static int savestate_docompress, savestate_specialdump, savestate_nodialogs;
static int replaybuffersize;
char savestate_fname[MAX_DPATH];
/* restore all subsystems */
-void restore_state (char *filename)
+void restore_state (const char *filename)
{
struct zfile *f;
uae_u8 *chunk,*end;
}
/* 1=compressed,2=not compressed,3=ram dump,4=audio dump */
-void savestate_initsave (char *filename, int mode)
+void savestate_initsave (const char *filename, int mode, int nodialogs)
{
strcpy (savestate_fname, filename);
savestate_docompress = (mode == 1) ? 1 : 0;
savestate_specialdump = (mode == 3) ? 1 : (mode == 4) ? 2 : 0;
+ savestate_nodialogs = nodialogs;
}
static void save_rams (struct zfile *f, int comp)
/* Save all subsystems */
-int save_state (char *filename, char *description)
+int save_state (const char *filename, const char *description)
{
uae_u8 endhunk[] = { 'E', 'N', 'D', ' ', 0, 0, 0, 8 };
uae_u8 header[1000];
char name[5];
int comp = savestate_docompress;
- if (!savestate_specialdump) {
+ if (!savestate_specialdump && !savestate_nodialogs) {
state_incompatible_warn ();
if (!save_filesys_cando ()) {
gui_message("Filesystem active. Try again later");
return -1;
}
}
+ savestate_nodialogs = 0;
custom_prepare_savestate ();
f = zfile_fopen (filename, "w+b");
if (!f)
dw (0x0004); /* 0.4 */
dw (0xD000); /* INITWORD */
dw (0x0016); /* LIB_REVISION */
- dw (0x0000); /* end of table already ??? */
+ dw (0x0000);
dw (0xC000); /* INITLONG */
dw (0x0018); /* LIB_IDSTRING */
dl (ROM_scsidev_resid);
--- /dev/null
+ /*
+ * UAE - The Un*x Amiga Emulator
+ *
+ * uae.resource
+ *
+ */
+
+#include "sysconfig.h"
+#include "sysdeps.h"
+
+#include "options.h"
+#include "memory.h"
+#include "custom.h"
+#include "newcpu.h"
+#include "traps.h"
+#include "autoconf.h"
+#include "execlib.h"
+#include "uaeresource.h"
+
+#if 0
+ struct uaebase
+ {
+ struct Library lib;
+ UWORD uae_version;
+ UWORD uae_revision;
+ UWORD uae_subrevision;
+ UWORD zero;
+ APTR uae_rombase;
+ };
+#endif
+
+static uaecptr res_init, res_name, res_id;
+
+static uae_u32 REGPARAM2 res_close (TrapContext *context)
+{
+ uaecptr base = m68k_areg (&context->regs, 6);
+ put_word (base + 32, get_word (base + 32) - 1);
+ return 0;
+}
+static uae_u32 REGPARAM2 res_open (TrapContext *context)
+{
+ uaecptr base = m68k_areg (&context->regs, 6);
+ put_word (base + 32, get_word (base + 32) + 1);
+ return 0;
+}
+static uae_u32 REGPARAM2 res_expunge (TrapContext *context)
+{
+ return 0;
+}
+static uae_u32 REGPARAM2 res_initcode (TrapContext *context)
+{
+ uaecptr base = m68k_dreg (&context->regs, 0);
+ uaecptr rb = base + SIZEOF_LIBRARY;
+ put_word (rb + 0, UAEMAJOR);
+ put_word (rb + 2, UAEMINOR);
+ put_word (rb + 4, UAESUBREV);
+ put_word (rb + 6, 0);
+ put_long (rb + 8, rtarea_base);
+ return base;
+}
+
+uaecptr uaeres_startup (uaecptr resaddr)
+{
+ put_word (resaddr + 0x0, 0x4AFC);
+ put_long (resaddr + 0x2, resaddr);
+ put_long (resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */
+ put_word (resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */
+ put_word (resaddr + 0xC, 0x0878); /* NT_DEVICE; pri 05 */
+ put_long (resaddr + 0xE, res_name);
+ put_long (resaddr + 0x12, res_id);
+ put_long (resaddr + 0x16, res_init);
+ resaddr += 0x1A;
+ return resaddr;
+}
+
+void uaeres_install (void)
+{
+ uae_u32 functable, datatable;
+ uae_u32 initcode, openfunc, closefunc, expungefunc;
+ char tmp[100];
+
+ sprintf (tmp, "UAE resource %d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV);
+ res_name = ds ("uae.resource");
+ res_id = ds (tmp);
+
+ /* initcode */
+ initcode = here ();
+ calltrap (deftrap (res_initcode)); dw (RTS);
+ /* Open */
+ openfunc = here ();
+ calltrap (deftrap (res_open)); dw (RTS);
+ /* Close */
+ closefunc = here ();
+ calltrap (deftrap (res_close)); dw (RTS);
+ /* Expunge */
+ expungefunc = here ();
+ calltrap (deftrap (res_expunge)); dw (RTS);
+
+ /* FuncTable */
+ functable = here ();
+ dl (openfunc); /* Open */
+ dl (closefunc); /* Close */
+ dl (expungefunc); /* Expunge */
+ dl (EXPANSION_nullfunc); /* Null */
+ dl (0xFFFFFFFF); /* end of table */
+
+ /* DataTable */
+ datatable = here ();
+ dw (0xE000); /* INITBYTE */
+ dw (0x0008); /* LN_TYPE */
+ dw (0x0800); /* NT_RESOURCE */
+ dw (0xC000); /* INITLONG */
+ dw (0x000A); /* LN_NAME */
+ dl (res_name);
+ dw (0xE000); /* INITBYTE */
+ dw (0x000E); /* LIB_FLAGS */
+ dw (0x0600); /* LIBF_SUMUSED | LIBF_CHANGED */
+ dw (0xD000); /* INITWORD */
+ dw (0x0014); /* LIB_VERSION */
+ dw (UAEMAJOR);
+ dw (0xD000); /* INITWORD */
+ dw (0x0016); /* LIB_REVISION */
+ dw (UAEMINOR);
+ dw (0xC000); /* INITLONG */
+ dw (0x0018); /* LIB_IDSTRING */
+ dl (res_id);
+ dw (0x0000); /* end of table */
+
+ res_init = here ();
+ dl (SIZEOF_LIBRARY + 16); /* size of device base */
+ dl (functable);
+ dl (datatable);
+ dl (initcode);
+}
return 0;
}
-static void resetparams(struct devstruct *dev, uaecptr req)
+static void resetparams (struct devstruct *dev, uaecptr req)
{
put_long (req + io_CtlChar, 0x00001311);
put_long (req + io_RBufLen, 1024);
put_word (req + io_Status, 0);
}
-static int setparams(struct devstruct *dev, uaecptr req)
+static int setparams (struct devstruct *dev, uaecptr req)
{
int v;
int rbuffer, baud, rbits, wbits, sbits, rtscts, parity, xonxoff;