From b6c88b3338550f2122d81ded8aeb2149c60a761c Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 31 Oct 2007 19:37:27 +0200 Subject: [PATCH] imported winuaesrc1450b7.zip --- cdtv.c | 8 ++ custom.c | 25 +++-- drawing.c | 182 +++++++++++++++++++++++++++++++--- include/custom.h | 2 +- include/drawing.h | 2 +- inputdevice.c | 15 ++- od-win32/resources/resource | 4 +- od-win32/resources/resource.h | 1 + od-win32/resources/winuae.rc | 29 +++--- od-win32/sysconfig.h | 3 +- od-win32/win32.c | 13 +-- od-win32/win32.h | 4 +- od-win32/win32gui.c | 73 ++++++++++++-- od-win32/winuaechangelog.txt | 19 ++++ 14 files changed, 321 insertions(+), 59 deletions(-) diff --git a/cdtv.c b/cdtv.c index 42c7f20f..4f04f80e 100644 --- a/cdtv.c +++ b/cdtv.c @@ -53,6 +53,8 @@ #define AUDIO_STATUS_PLAY_ERROR 0x14 #define AUDIO_STATUS_NO_STATUS 0x15 +#define MODEL_NAME "MATSHITA0.97" /* also MATSHITA0.96 exists */ + static smp_comm_pipe requests; static volatile int thread_alive; @@ -500,6 +502,12 @@ static void cdrom_command_thread(uae_u8 b) cd_finished = 1; } break; + case 0x83: + if (cdrom_command_cnt_in == 7) { + memcpy (cdrom_command_output, MODEL_NAME, strlen (MODEL_NAME)); + cdrom_command_accepted(strlen (MODEL_NAME), s, &cdrom_command_cnt_in); + cd_finished = 1; + } case 0x84: if (cdrom_command_cnt_in == 7) { cdrom_command_accepted(cdrom_modeset(cdrom_command_input), s, &cdrom_command_cnt_in); diff --git a/custom.c b/custom.c index 091c96ea..f4103d9f 100644 --- a/custom.c +++ b/custom.c @@ -523,7 +523,8 @@ static void remember_ctable_for_border (void) * checked. */ static void decide_diw (int hpos) { - int pix_hpos = coord_diw_to_window_x (hpos == 227 ? 455 : hpos * 2); /* (227.5*2 = 455) */ + /* Last hpos = hpos + 0.5, eg. normal PAL end hpos is 227.5 * 2 = 455 */ + int pix_hpos = coord_diw_to_window_x (hpos == maxhpos ? hpos * 2 + 1 : hpos * 2); if (hdiwstate == DIW_waiting_start && thisline_decision.diwfirstword == -1 && pix_hpos >= diwfirstword && last_diw_pix_hpos < diwfirstword) { @@ -1665,13 +1666,18 @@ static int expand_sprres (uae_u16 con0, uae_u16 con3) int res; switch ((con3 >> 6) & 3) { + default: + res = RES_LORES; + break; +#ifdef ECS_DENISE case 0: /* ECS defaults (LORES,HIRES=LORES sprite,SHRES=HIRES sprite) */ if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) && GET_RES (con0) == RES_SUPERHIRES) res = RES_HIRES; else res = RES_LORES; break; - /* AGA */ +#endif +#ifdef AGA case 1: res = RES_LORES; break; @@ -1682,6 +1688,7 @@ static int expand_sprres (uae_u16 con0, uae_u16 con3) res = RES_SUPERHIRES; break; } +#endif return res; } @@ -2869,8 +2876,8 @@ static void BPLCON0 (int hpos, uae_u16 v) bplcon0 = v; record_register_change (hpos, 0x100, v); -#ifdef AGA - if (currprefs.chipset_mask & CSMASK_AGA) { +#ifdef ECS_DENISE + if (currprefs.chipset_mask & CSMASK_ECS_DENISE) { decide_sprites (hpos); sprres = expand_sprres (bplcon0, bplcon3); } @@ -3174,8 +3181,13 @@ STATIC_INLINE void SPRxCTLPOS (int num) sprxp = (sprpos[num] & 0xFF) * 2 + (sprctl[num] & 1); sprxp <<= sprite_buffer_res; /* Quite a bit salad in this register... */ +#ifdef ECS_DENISE + if (currprefs.chipset_mask & CSMASK_ECS_DENISE) { + sprxp |= ((sprctl[num] >> 3) & 2) >> (2 - sprite_buffer_res); + } +#endif #ifdef AGA - if (currprefs.chipset_mask & CSMASK_AGA) { + else if (currprefs.chipset_mask & CSMASK_AGA) { sprxp |= ((sprctl[num] >> 3) & 3) >> (2 - sprite_buffer_res); s->dblscan = sprpos[num] & 0x80; } @@ -3821,11 +3833,12 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) if (vpos == sprite_vblank_endline) spr_arm (num, 0); +#ifdef AGA if (s->dblscan && (fmode & 0x8000) && (vpos & 1) != (s->vstart & 1) && s->dmastate) { spr_arm (num, 1); return; } - +#endif #if SPRITE_DEBUG > 3 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) write_log ("%d:%d:slot%d:%d\n", vpos, hpos, num, cycle); diff --git a/drawing.c b/drawing.c index 78285a81..1095b3b5 100644 --- a/drawing.c +++ b/drawing.c @@ -193,7 +193,7 @@ static int first_block_line, last_block_line; /* These are generated by the drawing code from the line_decisions array for each line that needs to be drawn. These are basically extracted out of bit fields in the hardware registers. */ -static int bplehb, bplham, bpldualpf, bpldualpfpri, bpldualpf2of, bplplanecnt, bplres, issprites; +static int bplehb, bplham, bpldualpf, bpldualpfpri, bpldualpf2of, bplplanecnt, bplres, ecsshres, issprites; static int plf1pri, plf2pri; static uae_u32 plf_sprite_mask; static int sbasecol[2] = { 16, 16 }; @@ -325,7 +325,7 @@ void record_diw_line (int plfstrt, int first, int last) static int playfield_start, playfield_end; static int real_playfield_start, real_playfield_end; -static int pixels_offset, sprite_pixels_offset; +static int pixels_offset; static int src_pixel; /* How many pixels in window coordinates which are to the left of the left border. */ static int unpainted; @@ -397,9 +397,6 @@ static void pfield_init_linetoscr (void) res_shift = lores_shift - bplres; ddf_left -= DISPLAY_LEFT_SHIFT; pixels_offset = MAX_PIXELS_PER_LINE - (ddf_left << bplres); - sprite_pixels_offset = MAX_PIXELS_PER_LINE - (ddf_left << sprite_buffer_res); - if (sprite_pixels_offset > pixels_offset) - sprite_pixels_offset = pixels_offset; ddf_left <<= bplres; unpainted = visible_left_border < playfield_start ? 0 : visible_left_border - playfield_start; @@ -553,10 +550,130 @@ static int linetoscr_double_offset; #include "linetoscr.c" +#ifdef ECS_DENISE +/* ECS SuperHires special cases */ +static int NOINLINE linetoscr_16_sh (int spix, int dpix, int stoppos) +{ + uae_u16 *buf = (uae_u16 *) xlinebuffer; + + while (dpix < stoppos) { + uae_u16 spix_val1, spix_val2; + uae_u16 v; + int off; + spix_val1 = pixdata.apixels[spix++]; + spix_val2 = pixdata.apixels[spix++]; + off = ((spix_val2 & 3) * 4) + (spix_val1 & 3) + ((spix_val1 | spix_val2) & 16); + v = (colors_for_drawing.color_regs_ecs[off] & 0xccc) << 0; + v |= v >> 2; + buf[dpix++] = xcolors[v]; + v = (colors_for_drawing.color_regs_ecs[off] & 0x333) << 2; + v |= v >> 2; + buf[dpix++] = xcolors[v]; + } + return spix; +} +static int NOINLINE linetoscr_32_sh (int spix, int dpix, int stoppos) +{ + uae_u32 *buf = (uae_u32 *) xlinebuffer; + + while (dpix < stoppos) { + uae_u32 spix_val1, spix_val2; + uae_u16 v; + int off; + spix_val1 = pixdata.apixels[spix++]; + spix_val2 = pixdata.apixels[spix++]; + off = ((spix_val2 & 3) * 4) + (spix_val1 & 3) + ((spix_val1 | spix_val2) & 16); + v = (colors_for_drawing.color_regs_ecs[off] & 0xccc) << 0; + v |= v >> 2; + buf[dpix++] = xcolors[v]; + v = (colors_for_drawing.color_regs_ecs[off] & 0x333) << 2; + v |= v >> 2; + buf[dpix++] = xcolors[v]; + } + return spix; +} +static int NOINLINE linetoscr_32_shrink1_sh (int spix, int dpix, int stoppos) +{ + uae_u32 *buf = (uae_u32 *) xlinebuffer; + + while (dpix < stoppos) { + uae_u32 spix_val1, spix_val2; + uae_u16 v; + int off; + spix_val1 = pixdata.apixels[spix++]; + spix_val2 = pixdata.apixels[spix++]; + off = ((spix_val2 & 3) * 4) + (spix_val1 & 3) + ((spix_val1 | spix_val2) & 16); + v = (colors_for_drawing.color_regs_ecs[off] & 0xccc) << 0; + v |= v >> 2; + buf[dpix++] = xcolors[v]; + } + return spix; +} +static int NOINLINE linetoscr_32_shrink2_sh (int spix, int dpix, int stoppos) +{ + uae_u32 *buf = (uae_u32 *) xlinebuffer; + + while (dpix < stoppos) { + uae_u32 spix_val1, spix_val2, dpix_val1, dpix_val2; + uae_u16 v; + int off; + spix_val1 = pixdata.apixels[spix++]; + spix_val2 = pixdata.apixels[spix++]; + off = ((spix_val2 & 3) * 4) + (spix_val1 & 3) + ((spix_val1 | spix_val2) & 16); + v = (colors_for_drawing.color_regs_ecs[off] & 0xccc) << 0; + v |= v >> 2; + dpix_val1 = xcolors[v]; + v = (colors_for_drawing.color_regs_ecs[off] & 0x333) << 2; + v |= v >> 2; + dpix_val2 = xcolors[v]; + buf[dpix++] = merge_2pixel32 (dpix_val1, dpix_val2); + } + return spix; +} +static int NOINLINE linetoscr_16_shrink1_sh (int spix, int dpix, int stoppos) +{ + uae_u16 *buf = (uae_u16 *) xlinebuffer; + + while (dpix < stoppos) { + uae_u16 spix_val1, spix_val2; + uae_u16 v; + int off; + spix_val1 = pixdata.apixels[spix++]; + spix_val2 = pixdata.apixels[spix++]; + off = ((spix_val2 & 3) * 4) + (spix_val1 & 3) + ((spix_val1 | spix_val2) & 16); + v = (colors_for_drawing.color_regs_ecs[off] & 0xccc) << 0; + v |= v >> 2; + buf[dpix++] = xcolors[v]; + } + return spix; +} +static int NOINLINE linetoscr_16_shrink2_sh (int spix, int dpix, int stoppos) +{ + uae_u16 *buf = (uae_u16 *) xlinebuffer; + + while (dpix < stoppos) { + uae_u16 spix_val1, spix_val2, dpix_val1, dpix_val2; + uae_u16 v; + int off; + spix_val1 = pixdata.apixels[spix++]; + spix_val2 = pixdata.apixels[spix++]; + off = ((spix_val2 & 3) * 4) + (spix_val1 & 3) + ((spix_val1 | spix_val2) & 16); + v = (colors_for_drawing.color_regs_ecs[off] & 0xccc) << 0; + v |= v >> 2; + dpix_val1 = xcolors[v]; + v = (colors_for_drawing.color_regs_ecs[off] & 0x333) << 2; + v |= v >> 2; + dpix_val2 = xcolors[v]; + buf[dpix++] = merge_2pixel16 (dpix_val1, dpix_val2); + } + return spix; +} +#endif + static void pfield_do_linetoscr (int start, int stop) { xlinecheck(start, stop); - if (issprites && ((currprefs.chipset_mask & CSMASK_AGA) || sprite_buffer_res > 0)) { + if (issprites && (currprefs.chipset_mask & CSMASK_AGA)) { if (res_shift == 0) { switch (gfxvidinfo.pixbytes) { case 1: src_pixel = linetoscr_8_aga_spr (src_pixel, start, stop); break; @@ -627,6 +744,28 @@ static void pfield_do_linetoscr (int start, int stop) } } } else +#endif +#ifdef ECS_DENISE + if (ecsshres) { + if (res_shift == 0) { + switch (gfxvidinfo.pixbytes) { + case 2: src_pixel = linetoscr_16_sh (src_pixel, start, stop); break; + case 4: src_pixel = linetoscr_32_sh (src_pixel, start, stop); break; + } + } else if (res_shift < 0) { + if (currprefs.gfx_lores_mode) { + switch (gfxvidinfo.pixbytes) { + case 2: src_pixel = linetoscr_16_shrink2_sh (src_pixel, start, stop); break; + case 4: src_pixel = linetoscr_32_shrink2_sh (src_pixel, start, stop); break; + } + } else { + switch (gfxvidinfo.pixbytes) { + case 2: src_pixel = linetoscr_16_shrink1_sh (src_pixel, start, stop); break; + case 4: src_pixel = linetoscr_32_shrink1_sh (src_pixel, start, stop); break; + } + } + } + } else #endif if (1) { if (res_shift == 0) { @@ -1065,6 +1204,8 @@ static void NOINLINE draw_sprites_ham_sp_hi_nat (struct sprite_entry *e) { draw_ static void NOINLINE draw_sprites_normal_sp_hi_at (struct sprite_entry *e) { draw_sprites_1 (e, 0, 0, 1, 0, 1); } static void NOINLINE draw_sprites_normal_dp_hi_at (struct sprite_entry *e) { draw_sprites_1 (e, 0, 1, 1, 0, 1); } static void NOINLINE draw_sprites_ham_sp_hi_at (struct sprite_entry *e) { draw_sprites_1 (e, 1, 0, 1, 0, 1); } +/* shres bitplane, lores sprites (emulation restriction, real ECS SHRES uses hires), ECS DENISE only */ +static void NOINLINE draw_sprites_normal_sp_shi_nat (struct sprite_entry *e) { draw_sprites_2 (e, 0, 0, 2, 0, 1, 0, 0, 0); } #ifdef AGA /* not very optimized */ @@ -1087,8 +1228,9 @@ STATIC_INLINE void draw_sprites_aga (struct sprite_entry *e) STATIC_INLINE void draw_sprites_ecs (struct sprite_entry *e) { - if (e->has_attached) - if (bplres == 1) + int res = bplres; + if (e->has_attached) { + if (res == 1) if (dp_for_drawing->ham_seen) draw_sprites_ham_sp_hi_at (e); else @@ -1104,8 +1246,8 @@ STATIC_INLINE void draw_sprites_ecs (struct sprite_entry *e) draw_sprites_normal_dp_lo_at (e); else draw_sprites_normal_sp_lo_at (e); - else - if (bplres == 1) + } else { + if (res == 1) if (dp_for_drawing->ham_seen) draw_sprites_ham_sp_hi_nat (e); else @@ -1113,7 +1255,7 @@ STATIC_INLINE void draw_sprites_ecs (struct sprite_entry *e) draw_sprites_normal_dp_hi_nat (e); else draw_sprites_normal_sp_hi_nat (e); - else + else if (bplres == 0) if (dp_for_drawing->ham_seen) draw_sprites_ham_sp_lo_nat (e); else @@ -1121,6 +1263,11 @@ STATIC_INLINE void draw_sprites_ecs (struct sprite_entry *e) draw_sprites_normal_dp_lo_nat (e); else draw_sprites_normal_sp_lo_nat (e); +#ifdef ECS_DENISE + else if (res == 2) /* ECS SHRES = hardware limits to non-attached */ + draw_sprites_normal_sp_shi_nat (e); +#endif + } } #ifdef AGA @@ -1438,6 +1585,9 @@ static void pfield_expand_dp_bplcon (void) bplplanecnt = dp_for_drawing->nr_planes; bplham = dp_for_drawing->ham_seen; issprites = dip_for_drawing->nr_sprites; +#ifdef ECS_DENISE + ecsshres = bplres == RES_SUPERHIRES && (currprefs.chipset_mask & CSMASK_ECS_DENISE) && !(currprefs.chipset_mask & CSMASK_AGA); +#endif if (bplres > 0) frame_res = 1; @@ -1467,6 +1617,7 @@ static void pfield_expand_dp_bplcon (void) brdsprt = !brdblank && (currprefs.chipset_mask & CSMASK_AGA) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x02); #endif } + static void pfield_expand_dp_bplcon2 (int regno, int v) { regno -= 0x1000; @@ -1669,7 +1820,7 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) pfield_init_linetoscr (); pfield_doline (lineno); - adjust_drawing_colors (dp_for_drawing->ctable, dp_for_drawing->ham_seen || bplehb); + adjust_drawing_colors (dp_for_drawing->ctable, dp_for_drawing->ham_seen || bplehb || ecsshres); /* The problem is that we must call decode_ham() BEFORE we do the sprites. */ @@ -1685,6 +1836,7 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) } bplham = dp_for_drawing->ham_at_start; } + if (plf2pri > 5 && bplplanecnt == 5 && !(currprefs.chipset_mask & CSMASK_AGA)) weird_bitplane_fix (); @@ -1696,7 +1848,7 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) #endif for (i = 0; i < dip_for_drawing->nr_sprites; i++) { #ifdef AGA - if ((currprefs.chipset_mask & CSMASK_AGA) || sprite_buffer_res > RES_LORES) + if (currprefs.chipset_mask & CSMASK_AGA) draw_sprites_aga (curr_sprite_entries + dip_for_drawing->first_sprite_entry + i); else #endif @@ -1813,7 +1965,7 @@ static void center_image (void) } else { visible_left_border = max_diwlastword - gfxvidinfo.width; if (doublescan) - visible_left_border = max_diwlastword / 2 - gfxvidinfo.width; + visible_left_border = (max_diwlastword - 48) / 2 - gfxvidinfo.width; } if (visible_left_border > max_diwlastword - 32) visible_left_border = max_diwlastword - 32; @@ -1884,7 +2036,7 @@ static void init_drawing_frame (void) changed_prefs.gfx_resolution = (m & 2) == 0 ? 0 : 1; changed_prefs.gfx_linedbl = (m & 1) == 0 ? 0 : 1; if (currprefs.gfx_autoresolution) { - changed_prefs.gfx_filter_horiz_zoom_mult = 1000 / (changed_prefs.gfx_resolution); + changed_prefs.gfx_filter_horiz_zoom_mult = 1000 >> changed_prefs.gfx_resolution; changed_prefs.gfx_filter_vert_zoom_mult = (changed_prefs.gfx_linedbl + 1) * 500; } else { *dst = *src; diff --git a/include/custom.h b/include/custom.h index ff03c98c..a47b76c7 100644 --- a/include/custom.h +++ b/include/custom.h @@ -89,7 +89,7 @@ extern uae_u16 INTREQR (void); #define MAXVPOS 312 #else #define MAXHPOS 256 -#define MAXVPOS 576 +#define MAXVPOS 592 #endif /* PAL/NTSC values */ diff --git a/include/drawing.h b/include/drawing.h index 083fe5d2..c510c284 100644 --- a/include/drawing.h +++ b/include/drawing.h @@ -166,7 +166,7 @@ struct color_change { /* No divisors for MAX_PIXELS_PER_LINE; we support AGA and may one day want to use SHRES sprites. */ -#define MAX_SPR_PIXELS (((MAXVPOS + 1)*2 + 1) * MAX_PIXELS_PER_LINE) +#define MAX_SPR_PIXELS (((MAXVPOS + 1) * 2 + 1) * MAX_PIXELS_PER_LINE) struct sprite_entry { diff --git a/inputdevice.c b/inputdevice.c index a30f0e50..6da35694 100644 --- a/inputdevice.c +++ b/inputdevice.c @@ -1741,26 +1741,33 @@ int handle_input_event (int nr, int state, int max, int autofire) case 4: /* ->Parallel port joystick adapter port #2 */ joy = ie->unit - 1; if (ie->type & 4) { + if (state) joybutton[joy] |= 1 << ie->data; else joybutton[joy] &= ~(1 << ie->data); + } else if (ie->type & 8) { + /* real mouse / analog stick mouse emulation */ int delta; int deadzone = currprefs.input_joymouse_deadzone * max / 100; if (max) { - if (state < deadzone && state > -deadzone) { + if (state <= deadzone && state >= -deadzone) { state = 0; + mouse_deltanoreset[joy][ie->data] = 0; } else if (state < 0) { state += deadzone; + mouse_deltanoreset[joy][ie->data] = 1; } else { state -= deadzone; + mouse_deltanoreset[joy][ie->data] = 1; } max -= deadzone; delta = state * currprefs.input_joymouse_multiplier / max; } else { delta = state; + mouse_deltanoreset[joy][ie->data] = 0; } mouse_delta[joy][ie->data] += delta; @@ -1789,9 +1796,10 @@ int handle_input_event (int nr, int state, int max, int autofire) mouse_deltanoreset[joy][0] = 0; } else if (ie->type & 128) { /* analog (paddle) */ + int deadzone = currprefs.input_joymouse_deadzone * max / 100; if (max) { - if (state < deadzone && state > -deadzone) { + if (state <= deadzone && state >= -deadzone) { state = 0; } else if (state < 0) { state += deadzone; @@ -1802,7 +1810,9 @@ int handle_input_event (int nr, int state, int max, int autofire) } state = state / 256 + 128; joydirpot[joy][ie->data] = state; + } else { + int left = oleft[joy], right = oright[joy], top = otop[joy], bot = obot[joy]; if (ie->type & 16) { /* button to axis mapping */ @@ -1828,6 +1838,7 @@ int handle_input_event (int nr, int state, int max, int autofire) if (right) joydir[joy] |= DIR_RIGHT; if (top) joydir[joy] |= DIR_UP; if (bot) joydir[joy] |= DIR_DOWN; + } break; case 0: /* ->KEY */ diff --git a/od-win32/resources/resource b/od-win32/resources/resource index 53226b34..d5da9321 100644 --- a/od-win32/resources/resource +++ b/od-win32/resources/resource @@ -320,7 +320,6 @@ #define IDC_PORT1_JOYS 1027 #define IDC_SCREENMODE_RTG 1027 #define IDC_MBMEM1 1028 -#define IDC_SCREENMODE_RTG2 1028 #define IDC_SLOWMEM 1030 #define IDC_MBMEM2 1031 #define IDC_PARALLEL 1033 @@ -918,6 +917,7 @@ #define IDC_FS_RW 1777 #define IDC_DF3ENABLE 1778 #define IDC_HDF_RW 1778 +#define IDC_HDFINFO 1779 #define ID__FLOPPYDRIVES 40004 #define ID_FLOPPYDRIVES_DF0 40005 #define ID_ST_CONFIGURATION 40010 @@ -947,7 +947,7 @@ #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 334 #define _APS_NEXT_COMMAND_VALUE 40029 -#define _APS_NEXT_CONTROL_VALUE 1779 +#define _APS_NEXT_CONTROL_VALUE 1780 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 247d6943..ce69f506 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -917,6 +917,7 @@ #define IDC_FS_RW 1777 #define IDC_DF3ENABLE 1778 #define IDC_HDF_RW 1778 +#define IDC_HDFINFO 1779 #define ID__FLOPPYDRIVES 40004 #define ID_FLOPPYDRIVES_DF0 40005 #define ID_ST_CONFIGURATION 40010 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 104f21dd..b1cb98fd 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script. // -#include "resource.h" +#include "resource." #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -427,12 +427,12 @@ BEGIN CONTROL "uaenet.device",IDC_SANA2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,92,94,10 END -IDD_HARDFILE DIALOGEX 0, 0, 299, 224 +IDD_HARDFILE DIALOGEX 0, 0, 299, 249 STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | DS_CENTERMOUSE | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Hardfile Settings" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - GROUPBOX "Settings",IDC_STATIC,10,5,280,127 + GROUPBOX "Settings",IDC_STATIC,10,5,280,146 RTEXT "Path:",IDC_HARDFILE_DIR_TEXT,26,18,22,10 EDITTEXT IDC_PATH_NAME,52,15,213,15,ES_AUTOHSCROLL PUSHBUTTON "...",IDC_SELECTOR,271,15,11,15 @@ -453,20 +453,21 @@ BEGIN EDITTEXT IDC_SECTORS,155,111,35,15,ES_NUMBER RTEXT "Block size:",IDC_BLOCKSIZE_TEXT,197,116,35,10 EDITTEXT IDC_BLOCKSIZE,237,111,35,15,ES_NUMBER - GROUPBOX "New hard disk image file",IDC_STATIC,10,134,280,62 - PUSHBUTTON "Create",IDC_HF_CREATE,50,149,80,14 - EDITTEXT IDC_HF_SIZE,146,149,61,15,ES_NUMBER - PUSHBUTTON "OK",IDOK,102,205,50,14 - PUSHBUTTON "Cancel",IDCANCEL,158,205,50,14 - EDITTEXT IDC_HF_DOSTYPE,146,172,61,15 - COMBOBOX IDC_HF_TYPE,50,172,80,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + GROUPBOX "New hard disk image file",IDC_STATIC,10,156,280,62 + PUSHBUTTON "Create",IDC_HF_CREATE,50,171,80,14 + EDITTEXT IDC_HF_SIZE,146,171,61,15,ES_NUMBER + PUSHBUTTON "OK",IDOK,102,226,50,14 + PUSHBUTTON "Cancel",IDCANCEL,158,226,50,14 + EDITTEXT IDC_HF_DOSTYPE,146,194,61,15 + COMBOBOX IDC_HF_TYPE,50,194,80,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_HDF_CONTROLLER,73,112,41,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - RTEXT "DOS type",IDC_STATIC,214,174,32,10,SS_CENTERIMAGE - RTEXT "MB",IDC_STATIC,214,152,13,10,SS_CENTERIMAGE - RTEXT "Type:",IDC_STATIC,18,160,25,10,SS_CENTERIMAGE + RTEXT "DOS type",IDC_STATIC,214,196,32,10,SS_CENTERIMAGE + RTEXT "MB",IDC_STATIC,214,174,13,10,SS_CENTERIMAGE + RTEXT "Type:",IDC_STATIC,18,182,25,10,SS_CENTERIMAGE RTEXT "HD Controller:",IDC_STATIC,13,113,52,10,SS_CENTERIMAGE CONTROL "Autoboot",IDC_HDF_AUTOBOOT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,73,53,10 CONTROL "Do not mount",IDC_HDF_DONOTMOUNT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,217,74,67,10 + EDITTEXT IDC_HDFINFO,16,131,268,12,ES_CENTER | ES_READONLY END IDD_FILESYS DIALOGEX 15, 25, 299, 111 @@ -995,7 +996,7 @@ GUIDELINES DESIGNINFO BEGIN IDD_HARDFILE, DIALOG BEGIN - BOTTOMMARGIN, 212 + BOTTOMMARGIN, 224 END END #endif // APSTUDIO_INVOKED diff --git a/od-win32/sysconfig.h b/od-win32/sysconfig.h index 4de5b6f6..ff35aa8a 100644 --- a/od-win32/sysconfig.h +++ b/od-win32/sysconfig.h @@ -25,7 +25,8 @@ #define CATWEASEL /* Catweasel MK2/3 support */ #define AHI /* AHI sound emulation */ #define ENFORCER /* UAE Enforcer */ -#define AGA /* AGA chipset emulation */ +#define ECS_DENISE /* ECS DENISE new features */ +#define AGA /* AGA chipset emulation (ECS_DENISE must be enabled) */ #define CD32 /* CD32 emulation */ #define CDTV /* CDTV emulation */ #define D3D /* D3D display filter support */ diff --git a/od-win32/win32.c b/od-win32/win32.c index 834afda1..87c6ffc7 100644 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -781,7 +781,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, if (!minimized) winuae_active (hWnd, minimized); if (is3dmode() && normal_display_change_starting == 0) - normal_display_change_starting = 1; + normal_display_change_starting = 10; } } recursive--; @@ -975,7 +975,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, 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); } @@ -3462,26 +3462,27 @@ end: typedef BOOL (CALLBACK* SETPROCESSDPIAWARE)(void); typedef BOOL (CALLBACK* CHANGEWINDOWMESSAGEFILTER)(UINT, DWORD); -#define MSGFLT_ADD 1 int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { SETPROCESSDPIAWARE pSetProcessDPIAware; DWORD_PTR sys_aff; + HANDLE thread; + CHANGEWINDOWMESSAGEFILTER pChangeWindowMessageFilter; original_affinity = 1; GetProcessAffinityMask (GetCurrentProcess(), &original_affinity, &sys_aff); -#if 0 - HANDLE thread; thread = GetCurrentThread(); original_affinity = SetThreadAffinityMask(thread, 1); - CHANGEWINDOWMESSAGEFILTER pChangeWindowMessageFilter; pChangeWindowMessageFilter = (CHANGEWINDOWMESSAGEFILTER)GetProcAddress( GetModuleHandle("user32.dll"), "ChangeWindowMessageFilter"); +#if 0 +#define MSGFLT_ADD 1 if (pChangeWindowMessageFilter) pChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD); #endif + pSetProcessDPIAware = (SETPROCESSDPIAWARE)GetProcAddress( GetModuleHandle("user32.dll"), "SetProcessDPIAware"); if (pSetProcessDPIAware) diff --git a/od-win32/win32.h b/od-win32/win32.h index f5f57388..d4302f8f 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,9 +15,9 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEBETA 6 +#define WINUAEBETA 7 #define WINUAEPUBLICBETA 1 -#define WINUAEDATE MAKEBD(2007, 10, 28) +#define WINUAEDATE MAKEBD(2007, 10, 31) #define WINUAEEXTRA "" #define WINUAEREV "" diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index 983490b3..15969a9a 100644 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -1500,7 +1500,7 @@ static int CalculateHardfileSize (HWND hDlg) BOOL Translated = FALSE; UINT mbytes = 0; - mbytes = GetDlgItemInt( hDlg, IDC_HF_SIZE, &Translated, FALSE ); + mbytes = GetDlgItemInt(hDlg, IDC_HF_SIZE, &Translated, FALSE); if (mbytes <= 0) mbytes = 0; if( !Translated ) @@ -5967,9 +5967,9 @@ static INT_PTR CALLBACK SoundDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM struct fsvdlg_vals { - char volume[4096]; - char device[4096]; - char rootdir[4096]; + char volume[MAX_DPATH]; + char device[MAX_DPATH]; + char rootdir[MAX_DPATH]; int bootpri; int autoboot; int donotmount; @@ -5982,10 +5982,10 @@ static struct fsvdlg_vals current_fsvdlg; struct hfdlg_vals { - char volumename[4096]; - char devicename[4096]; - char filename[4096]; - char fsfilename[4096]; + char volumename[MAX_DPATH]; + char devicename[MAX_DPATH]; + char filename[MAX_DPATH]; + char fsfilename[MAX_DPATH]; int sectors; int reserved; int surfaces; @@ -6184,10 +6184,58 @@ static void hardfile_testrdb (HWND hDlg) sethardfile (hDlg); } +static void updatehdfinfo (HWND hDlg, int force) +{ + static uae_u64 bsize; + static uae_u8 id[4]; + int blocks, cyls, i; + char tmp[200], idtmp[5], tmp2[200]; + + if (force) { + struct zfile *zf = zfile_fopen (current_hfdlg.filename, "rb"); + if (zf) { + memset (id, 0, sizeof (id)); + zfile_fread (id, 1, sizeof (id), zf); + zfile_fseek (zf, 0, SEEK_END); + bsize = zfile_ftell (zf); + zfile_fclose (zf); + } + } + cyls = 0; + if (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces) + cyls = bsize / (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces); + blocks = cyls * (current_hfdlg.sectors * current_hfdlg.surfaces); + for (i = 0; i < 4; i++) { + unsigned char c = id[i]; + if (c < 32 || c > 126) + c = '.'; + idtmp[i] = c; + idtmp[i + 1] = 0; + } + + tmp[0] = 0; + if (bsize) { + sprintf (tmp2, " %s [%02X%02X%02X%02X]", idtmp, id[0], id[1], id[2], id[3]); + if (!cyls || !blocks) + sprintf (tmp, "%dMB", bsize / (1024 * 1024)); + else + sprintf (tmp, "%d cyls, %d blocks, %.1fMB/%.1fMB", + cyls, blocks, + (double)blocks * 1.0 * current_hfdlg.blocksize / (1024.0 * 1024.0), + (double)bsize / (1024.0 * 1024.0)); + if (cyls > 65535) + strcat (tmp, " [Too many cyls]"); + strcat (tmp, tmp2); + } + SetDlgItemText (hDlg, IDC_HDFINFO, tmp); +} + + static INT_PTR CALLBACK HardfileSettingsProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static int recursive = 0; LRESULT res, posn; + char tmp[MAX_DPATH]; switch (msg) { case WM_INITDIALOG: @@ -6195,6 +6243,7 @@ static INT_PTR CALLBACK HardfileSettingsProc (HWND hDlg, UINT msg, WPARAM wParam inithardfile (hDlg); sethardfile (hDlg); sethfdostype (hDlg, 0); + updatehdfinfo (hDlg, 1); recursive--; return TRUE; @@ -6235,6 +6284,7 @@ static INT_PTR CALLBACK HardfileSettingsProc (HWND hDlg, UINT msg, WPARAM wParam GetDlgItemText (hDlg, IDC_PATH_NAME, current_hfdlg.filename, sizeof current_hfdlg.filename); hardfile_testrdb (hDlg); inithardfile(hDlg); + updatehdfinfo (hDlg, 1); break; case IDC_FILESYS_SELECTOR: DiskSelection (hDlg, IDC_PATH_FILESYS, 12, &workprefs, 0); @@ -6278,7 +6328,11 @@ static INT_PTR CALLBACK HardfileSettingsProc (HWND hDlg, UINT msg, WPARAM wParam break; } - GetDlgItemText (hDlg, IDC_PATH_NAME, current_hfdlg.filename, sizeof current_hfdlg.filename); + GetDlgItemText (hDlg, IDC_PATH_NAME, tmp, sizeof tmp); + if (strcmp (tmp, current_hfdlg.filename)) { + strcpy (current_hfdlg.filename, tmp); + updatehdfinfo (hDlg, 1); + } GetDlgItemText (hDlg, IDC_PATH_FILESYS, current_hfdlg.fsfilename, sizeof current_hfdlg.fsfilename); GetDlgItemText (hDlg, IDC_HARDFILE_DEVICE, current_hfdlg.devicename, sizeof current_hfdlg.devicename); current_hfdlg.sectors = GetDlgItemInt(hDlg, IDC_SECTORS, NULL, FALSE); @@ -6289,6 +6343,7 @@ static INT_PTR CALLBACK HardfileSettingsProc (HWND hDlg, UINT msg, WPARAM wParam posn = SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_GETCURSEL, 0, 0); if (posn != CB_ERR) current_hfdlg.controller = posn; + updatehdfinfo (hDlg, 0); recursive--; break; diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 57b05766..a6ebcc4c 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,23 @@ +Beta 7: + +- added information text to hardfile panel. + RDB hardfile: size of selected file, first 4 bytes of data. + Regular hardfile: cylinders (warns if > 65535, OS3.5+ only), blocks, + current size and total size of hardfile, first 4 bytes of data. +- analog joystick mouse emulation didn't "repeat" +- graphics garbage in right border fixed (happened for example when + productivity mode with vgaonly was enabled) +- CDTV CD ROM command 0x83 emulated, returns drive name/version string + ("MATSHITA0.97", also "MATSHITA0.96" exists. No idea if there are any + real differences). Another quite pointless feature because CDTV's + driver does not use command 0x83.. +- ECS superhires sprite positioning fixed. Note that ECS shres sprites + always have halved resolution (not size) due to emulation limitation +- ECS superhires "palette scrambling" emulated, ECS shres colors should + be now 100% correct +- some doublescan emulation tweaks + Beta 6: - do not call CD32 CD emulation handler when non-CD controller -- 2.47.3