Commit 0bcb3599 authored by mtufan's avatar mtufan

puae 2.3.3

parent dc18d9f0
This diff is collapsed.
...@@ -578,7 +578,7 @@ static void check_changes (int unitnum) ...@@ -578,7 +578,7 @@ static void check_changes (int unitnum)
wasopen[unitnum] = 0; wasopen[unitnum] = 0;
} }
} }
if (currprefs.scsi) { if (currprefs.scsi && wasopen[unitnum]) {
struct device_info di; struct device_info di;
device_func[unitnum]->info (unitnum, &di, 0); device_func[unitnum]->info (unitnum, &di, 0);
int pollmode; int pollmode;
......
...@@ -4055,7 +4055,7 @@ void default_prefs (struct uae_prefs *p, int type) ...@@ -4055,7 +4055,7 @@ void default_prefs (struct uae_prefs *p, int type)
p->picasso96_nocustom = 1; p->picasso96_nocustom = 1;
p->cart_internal = 1; p->cart_internal = 1;
p->sana2 = 0; p->sana2 = 0;
p->clipboard_sharing = true; p->clipboard_sharing = false;
p->cs_compatible = 1; p->cs_compatible = 1;
p->cs_rtc = 2; p->cs_rtc = 2;
...@@ -4261,7 +4261,8 @@ static void buildin_default_prefs (struct uae_prefs *p) ...@@ -4261,7 +4261,8 @@ static void buildin_default_prefs (struct uae_prefs *p)
p->immediate_blits = 0; p->immediate_blits = 0;
p->waiting_blits = 0; p->waiting_blits = 0;
p->collision_level = 2; p->collision_level = 2;
p->produce_sound = 3; if (p->produce_sound < 1)
p->produce_sound = 1;
p->scsi = 0; p->scsi = 0;
p->uaeserial = 0; p->uaeserial = 0;
p->cpu_idle = 0; p->cpu_idle = 0;
...@@ -4275,6 +4276,7 @@ static void buildin_default_prefs (struct uae_prefs *p) ...@@ -4275,6 +4276,7 @@ static void buildin_default_prefs (struct uae_prefs *p)
p->socket_emu = 0; p->socket_emu = 0;
p->sound_volume = 0; p->sound_volume = 0;
p->sound_volume_cd = -1; p->sound_volume_cd = -1;
p->clipboard_sharing = false;
p->chipmem_size = 0x00080000; p->chipmem_size = 0x00080000;
p->bogomem_size = 0x00080000; p->bogomem_size = 0x00080000;
......
...@@ -2491,13 +2491,14 @@ STATIC_INLINE int sprites_differ (struct draw_info *dip, struct draw_info *dip_o ...@@ -2491,13 +2491,14 @@ STATIC_INLINE int sprites_differ (struct draw_info *dip, struct draw_info *dip_o
if (dip->nr_sprites == 0) if (dip->nr_sprites == 0)
return 0; return 0;
for (i = 0; i < dip->nr_sprites; i++) for (i = 0; i < dip->nr_sprites; i++) {
if (this_first[i].pos != prev_first[i].pos if (this_first[i].pos != prev_first[i].pos
|| this_first[i].max != prev_first[i].max || this_first[i].max != prev_first[i].max
|| this_first[i].has_attached != prev_first[i].has_attached) || this_first[i].has_attached != prev_first[i].has_attached)
return 1; return 1;
}
npixels = this_last->first_pixel + (this_last->max - this_last->pos) - this_first->first_pixel; npixels = this_last->max - this_last->pos;
if (memcmp (spixels + this_first->first_pixel, spixels + prev_first->first_pixel, if (memcmp (spixels + this_first->first_pixel, spixels + prev_first->first_pixel,
npixels * sizeof (uae_u16)) != 0) npixels * sizeof (uae_u16)) != 0)
return 1; return 1;
...@@ -2591,8 +2592,12 @@ static void finish_decisions (void) ...@@ -2591,8 +2592,12 @@ static void finish_decisions (void)
changed = 1; changed = 1;
if (! changed && color_changes_differ (dip, dip_old)) if (! changed && color_changes_differ (dip, dip_old))
changed = 1; changed = 1;
if (!changed && thisline_decision.plfleft != -1 && sprites_differ (dip, dip_old)) if (!changed && /* bitplane visible in this line OR border sprites enabled */
(thisline_decision.plfleft != -1 || ((thisline_decision.bplcon0 & 1) && (thisline_decision.bplcon3 & 0x02) && !(thisline_decision.bplcon3 & 0x20)))
&& sprites_differ (dip, dip_old))
{
changed = 1; changed = 1;
}
if (changed) { if (changed) {
thisline_changed = 1; thisline_changed = 1;
...@@ -2868,43 +2873,45 @@ void init_hz_fullinit (bool fullinit) ...@@ -2868,43 +2873,45 @@ void init_hz_fullinit (bool fullinit)
reset_drawing (); reset_drawing ();
} }
for (i = 0; i < MAX_CHIPSET_REFRESH_TOTAL; i++) { bool found = false;
struct chipset_refresh *cr = &currprefs.cr[i]; for (i = 0; i < MAX_CHIPSET_REFRESH_TOTAL; i++) {
if ((cr->horiz < 0 || cr->horiz == maxhpos) && struct chipset_refresh *cr = &currprefs.cr[i];
(cr->vert < 0 || cr->vert == maxvpos_nom) && if ((cr->horiz < 0 || cr->horiz == maxhpos) &&
(cr->ntsc < 0 || (cr->ntsc > 0 && isntsc) || (cr->ntsc == 0 && !isntsc)) && (cr->vert < 0 || cr->vert == maxvpos_nom) &&
(cr->lace < 0 || (cr->lace > 0 && islace) || (cr->lace == 0 && !islace)) && (cr->ntsc < 0 || (cr->ntsc > 0 && isntsc) || (cr->ntsc == 0 && !isntsc)) &&
(cr->framelength < 0 || (cr->framelength > 0 && lof_store) || (cr->framelength == 0 && !lof_store)) && (cr->lace < 0 || (cr->lace > 0 && islace) || (cr->lace == 0 && !islace)) &&
((cr->rtg && picasso_on) || (!cr->rtg && !picasso_on)) && (cr->framelength < 0 || (cr->framelength > 0 && lof_store) || (cr->framelength == 0 && !lof_store) || (cr->framelength >= 0 && islace)) &&
(cr->vsync < 0 || (cr->vsync > 0 && isvsync ()) || (cr->vsync == 0 && !isvsync ()))) { ((cr->rtg && picasso_on) || (!cr->rtg && !picasso_on)) &&
double v = -1; (cr->vsync < 0 || (cr->vsync > 0 && isvsync ()) || (cr->vsync == 0 && !isvsync ()))) {
double v = -1;
if (!picasso_on) {
if (isvsync ()) { if (!picasso_on) {
if (i == CHIPSET_REFRESH_PAL || i == CHIPSET_REFRESH_NTSC) { if (isvsync ()) {
if ((abs (vblank_hz - 50) < 1 || abs (vblank_hz - 60) < 1) && currprefs.gfx_avsync == 2 && currprefs.gfx_afullscreen > 0) { if (i == CHIPSET_REFRESH_PAL || i == CHIPSET_REFRESH_NTSC) {
vsync_switchmode (vblank_hz > 55 ? 60 : 50); if ((abs (vblank_hz - 50) < 1 || abs (vblank_hz - 60) < 1) && currprefs.gfx_avsync == 2 && currprefs.gfx_afullscreen > 0) {
} vsync_switchmode (vblank_hz > 55 ? 60 : 50);
}
if (isvsync () < 0) {
double v2;
v2 = vblank_calibrate (cr->locked ? vblank_hz : cr->rate, cr->locked);
if (!cr->locked)
v = v2;
}
} else {
if (cr->locked == false) {
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = vblank_hz;
break;
} }
v = cr->rate;
} }
if (v < 0) if (isvsync () < 0) {
v = cr->rate; double v2;
if (v > 0) { v2 = vblank_calibrate (cr->locked ? vblank_hz : cr->rate, cr->locked);
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = v; if (!cr->locked)
v = v2;
}
} else {
if (cr->locked == false) {
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = vblank_hz;
cfgfile_parse_lines (&changed_prefs, cr->commands, -1); cfgfile_parse_lines (&changed_prefs, cr->commands, -1);
break;
} }
v = cr->rate;
}
if (v < 0)
v = cr->rate;
if (v > 0) {
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = v;
cfgfile_parse_lines (&changed_prefs, cr->commands, -1);
}
} else { } else {
if (cr->locked == false) if (cr->locked == false)
v = vblank_hz; v = vblank_hz;
...@@ -2913,10 +2920,15 @@ void init_hz_fullinit (bool fullinit) ...@@ -2913,10 +2920,15 @@ void init_hz_fullinit (bool fullinit)
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = v; changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = v;
cfgfile_parse_lines (&changed_prefs, cr->commands, -1); cfgfile_parse_lines (&changed_prefs, cr->commands, -1);
} }
found = true;
break; break;
} }
} }
if (!found) {
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = vblank_hz;
}
maxvpos_total = (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? 2047 : 511; maxvpos_total = (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? 2047 : 511;
if (maxvpos_total > MAXVPOS) if (maxvpos_total > MAXVPOS)
maxvpos_total = MAXVPOS; maxvpos_total = MAXVPOS;
...@@ -5064,6 +5076,9 @@ static void framewait (void) ...@@ -5064,6 +5076,9 @@ static void framewait (void)
render_screen (); render_screen ();
vsync_busywait (); vsync_busywait ();
show_screen (); show_screen ();
extern int extraframewait;
if (extraframewait)
uae_msleep (extraframewait);
return; return;
} }
render_screen (); render_screen ();
......
...@@ -2527,11 +2527,11 @@ static uaecptr get_base (const uae_char *name) ...@@ -2527,11 +2527,11 @@ static uaecptr get_base (const uae_char *name)
b = &get_mem_bank (v2); b = &get_mem_bank (v2);
if (!b || !b->check (v2, 20)) if (!b || !b->check (v2, 20))
goto fail; goto fail;
if (b->flags != ABFLAG_ROM && b->flags != ABFLAG_RAM) if (b->flags == ABFLAG_ROM || b->flags == ABFLAG_RAM) {
return 0; p = b->xlateaddr (v2);
p = b->xlateaddr (v2); if (!memcmp (p, name, strlen (name) + 1))
if (!memcmp (p, name, strlen (name) + 1)) return v;
return v; }
} }
return 0; return 0;
fail: fail:
......
...@@ -2131,7 +2131,11 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) ...@@ -2131,7 +2131,11 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos)
int i; int i;
for (i = 0; i < dip_for_drawing->nr_sprites; i++) for (i = 0; i < dip_for_drawing->nr_sprites; i++)
draw_sprites_aga (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i, 1); draw_sprites_aga (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i, 1);
uae_u16 oxor = bplxor;
memset (pixdata.apixels, 0, sizeof pixdata);
bplxor = 0;
do_color_changes (pfield_do_fill_line, pfield_do_linetoscr); do_color_changes (pfield_do_fill_line, pfield_do_linetoscr);
bplxor = oxor;
} else { } else {
...@@ -2170,9 +2174,8 @@ static void center_image (void) ...@@ -2170,9 +2174,8 @@ static void center_image (void)
int prev_y_adjust = thisframe_y_adjust; int prev_y_adjust = thisframe_y_adjust;
int tmp; int tmp;
int w = gfxvidinfo.width;
if (currprefs.gfx_xcenter && !currprefs.gfx_filter_autoscale && max_diwstop > 0) { if (currprefs.gfx_xcenter && !currprefs.gfx_filter_autoscale && max_diwstop > 0) {
int w = gfxvidinfo.width;
if (max_diwstop - min_diwstart < w && currprefs.gfx_xcenter == 2) if (max_diwstop - min_diwstart < w && currprefs.gfx_xcenter == 2)
/* Try to center. */ /* Try to center. */
visible_left_border = (max_diwstop - min_diwstart - w) / 2 + min_diwstart; visible_left_border = (max_diwstop - min_diwstart - w) / 2 + min_diwstart;
...@@ -2187,13 +2190,12 @@ static void center_image (void) ...@@ -2187,13 +2190,12 @@ static void center_image (void)
visible_left_border = prev_x_adjust; visible_left_border = prev_x_adjust;
} }
} else if ((beamcon0 & 0x80) && max_diwstop > 0 && !currprefs.gfx_filter_autoscale) { } else if ((beamcon0 & 0x80) && max_diwstop > 0 && !currprefs.gfx_filter_autoscale) {
int w = gfxvidinfo.width;
if (max_diwstop - min_diwstart < w) if (max_diwstop - min_diwstart < w)
visible_left_border = (max_diwstop - min_diwstart - w) / 2 + min_diwstart; visible_left_border = (max_diwstop - min_diwstart - w) / 2 + min_diwstart;
else else
visible_left_border = max_diwstop - w - (max_diwstop - min_diwstart - w) / 2; visible_left_border = max_diwstop - w - (max_diwstop - min_diwstart - w) / 2;
} else { } else {
visible_left_border = max_diwlastword - gfxvidinfo.width; visible_left_border = max_diwlastword - w;
} }
if (visible_left_border > max_diwlastword - 32) if (visible_left_border > max_diwlastword - 32)
......
...@@ -1298,9 +1298,9 @@ void handle_events (void) ...@@ -1298,9 +1298,9 @@ void handle_events (void)
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP: { case SDL_MOUSEBUTTONUP: {
DEBUG_LOG ("Event: mouse button %d %s\n", rEvent.button.button, state ? "down" : "up");
int state = (rEvent.type == SDL_MOUSEBUTTONDOWN); int state = (rEvent.type == SDL_MOUSEBUTTONDOWN);
int buttonno = -1; int buttonno = -1;
DEBUG_LOG ("Event: mouse button %d %s\n", rEvent.button.button, state ? "down" : "up");
switch (rEvent.button.button) { switch (rEvent.button.button) {
case SDL_BUTTON_LEFT: buttonno = 0; break; case SDL_BUTTON_LEFT: buttonno = 0; break;
...@@ -2258,4 +2258,4 @@ void setmaintitle (void) ...@@ -2258,4 +2258,4 @@ void setmaintitle (void)
} }
SDL_WM_SetCaption(txt, txt); SDL_WM_SetCaption(txt, txt);
} }
\ No newline at end of file
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#endif #endif
/* AmigaOS errors */ /* AmigaOS errors */
#define ERROR_BAD_NUMBER 6
#define ERROR_NO_FREE_STORE 103 #define ERROR_NO_FREE_STORE 103
#define ERROR_BAD_NUMBER 115
#define ERROR_OBJECT_IN_USE 202 #define ERROR_OBJECT_IN_USE 202
#define ERROR_OBJECT_EXISTS 203 #define ERROR_OBJECT_EXISTS 203
#define ERROR_DIR_NOT_FOUND 204 #define ERROR_DIR_NOT_FOUND 204
......
...@@ -189,7 +189,7 @@ extern void inputdevice_reset (void); ...@@ -189,7 +189,7 @@ extern void inputdevice_reset (void);
//extern void write_inputdevice_config (struct uae_prefs *p, struct zfile *f); //extern void write_inputdevice_config (struct uae_prefs *p, struct zfile *f);
extern void read_inputdevice_config (struct uae_prefs *p, const TCHAR *option, TCHAR *value); extern void read_inputdevice_config (struct uae_prefs *p, const TCHAR *option, TCHAR *value);
extern void reset_inputdevice_config (struct uae_prefs *pr); extern void reset_inputdevice_config (struct uae_prefs *pr);
extern int inputdevice_joyport_config (struct uae_prefs *p, TCHAR *value, int portnum, int mode, int type); extern int inputdevice_joyport_config (struct uae_prefs *p, const TCHAR *value, int portnum, int mode, int type);
extern int inputdevice_getjoyportdevice (int port, int val); extern int inputdevice_getjoyportdevice (int port, int val);
extern void inputdevice_init (void); extern void inputdevice_init (void);
......
...@@ -143,6 +143,7 @@ enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000, ...@@ -143,6 +143,7 @@ enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000,
#define AUTOSCALE_RESIZE 5 #define AUTOSCALE_RESIZE 5
#define AUTOSCALE_CENTER 6 #define AUTOSCALE_CENTER 6
#define AUTOSCALE_MANUAL 7 // use gfx_xcenter_pos and gfx_ycenter_pos #define AUTOSCALE_MANUAL 7 // use gfx_xcenter_pos and gfx_ycenter_pos
#define AUTOSCALE_INTEGER 8
#define MAX_CHIPSET_REFRESH 10 #define MAX_CHIPSET_REFRESH 10
#define MAX_CHIPSET_REFRESH_TOTAL (MAX_CHIPSET_REFRESH + 2) #define MAX_CHIPSET_REFRESH_TOTAL (MAX_CHIPSET_REFRESH + 2)
...@@ -476,6 +477,7 @@ struct uae_prefs { ...@@ -476,6 +477,7 @@ struct uae_prefs {
TCHAR win32_commandpathend[MAX_DPATH]; TCHAR win32_commandpathend[MAX_DPATH];
TCHAR win32_parjoyport0[MAX_DPATH]; TCHAR win32_parjoyport0[MAX_DPATH];
TCHAR win32_parjoyport1[MAX_DPATH]; TCHAR win32_parjoyport1[MAX_DPATH];
TCHAR win32_guipage[32];
#endif #endif
int win32_rtgvblankrate; int win32_rtgvblankrate;
......
...@@ -1486,7 +1486,7 @@ static int mouseedge (void) ...@@ -1486,7 +1486,7 @@ static int mouseedge (void)
static int melast_x, melast_y; static int melast_x, melast_y;
static int isnonzero; static int isnonzero;
if (currprefs.input_magic_mouse == 0 || currprefs.input_tablet > 0 || isfullscreen ()) if (currprefs.input_magic_mouse == 0 || currprefs.input_tablet > 0)
return 0; return 0;
if (magicmouse_ibase == 0xffffffff) if (magicmouse_ibase == 0xffffffff)
return 0; return 0;
...@@ -3066,6 +3066,10 @@ static int switchdevice (struct uae_input_device *id, int num, bool buttonmode) ...@@ -3066,6 +3066,10 @@ static int switchdevice (struct uae_input_device *id, int num, bool buttonmode)
if (num >= 4) if (num >= 4)
return 0; return 0;
#ifdef RETROPLATFORM
if (rp_isactive ())
return 0;
#endif
for (i = 0; i < MAX_INPUT_DEVICES; i++) { for (i = 0; i < MAX_INPUT_DEVICES; i++) {
if (id == &joysticks[i]) { if (id == &joysticks[i]) {
name = idev[IDTYPE_JOYSTICK].get_uniquename (i); name = idev[IDTYPE_JOYSTICK].get_uniquename (i);
...@@ -5714,7 +5718,7 @@ int jsem_iskbdjoy (int port, const struct uae_prefs *p) ...@@ -5714,7 +5718,7 @@ int jsem_iskbdjoy (int port, const struct uae_prefs *p)
return v; return v;
} }
int inputdevice_joyport_config (struct uae_prefs *p, TCHAR *value, int portnum, int mode, int type) int inputdevice_joyport_config (struct uae_prefs *p, const TCHAR *value, int portnum, int mode, int type)
{ {
switch (type) switch (type)
{ {
...@@ -5748,7 +5752,7 @@ int inputdevice_joyport_config (struct uae_prefs *p, TCHAR *value, int portnum, ...@@ -5748,7 +5752,7 @@ int inputdevice_joyport_config (struct uae_prefs *p, TCHAR *value, int portnum,
case 0: case 0:
{ {
int start = JPORT_NONE, got = 0, max = -1; int start = JPORT_NONE, got = 0, max = -1;
TCHAR *pp = 0; const TCHAR *pp = 0;
if (_tcsncmp (value, "kbd", 3) == 0) { if (_tcsncmp (value, "kbd", 3) == 0) {
start = JSEM_KBDLAYOUT; start = JSEM_KBDLAYOUT;
pp = value + 3; pp = value + 3;
......
...@@ -69,10 +69,6 @@ static struct winuae_currentmode *currentmode = &currentmodestruct; ...@@ -69,10 +69,6 @@ static struct winuae_currentmode *currentmode = &currentmodestruct;
static int serial_period_hsyncs, serial_period_hsync_counter; static int serial_period_hsyncs, serial_period_hsync_counter;
static int data_in_serdatr; /* new data received */ static int data_in_serdatr; /* new data received */
//win32gfx.cpp
static double remembered_vblank;
static int vblankbasewait, vblankbasefull;
// dinput // dinput
int rawkeyboard = -1; int rawkeyboard = -1;
static bool rawinput_enabled_mouse, rawinput_enabled_keyboard; static bool rawinput_enabled_mouse, rawinput_enabled_keyboard;
...@@ -83,7 +79,10 @@ int is_tablet (void) ...@@ -83,7 +79,10 @@ int is_tablet (void)
return tablet ? 1 : 0; return tablet ? 1 : 0;
} }
//win32gfx //win32gfx.cpp
static double remembered_vblank;
static int vblankbasewait, vblankbasefull;
void getgfxoffset (int *dxp, int *dyp, int *mxp, int *myp) void getgfxoffset (int *dxp, int *dyp, int *mxp, int *myp)
{ {
*dxp = 0; *dxp = 0;
...@@ -193,7 +192,9 @@ void serial_hsynchandler (void) ...@@ -193,7 +192,9 @@ void serial_hsynchandler (void)
*/ */
} }
//win32 //win32.cpp
int extraframewait = 5;
/* /*
static int drvsampleres[] = { static int drvsampleres[] = {
IDR_DRIVE_CLICK_A500_1, DS_CLICK, IDR_DRIVE_CLICK_A500_1, DS_CLICK,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment