From 61f6dd256ce4af01ca82cc7c20f21d2d8420093d Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 27 Aug 2006 20:19:28 +0300 Subject: [PATCH] imported winuaesrc1320b2.zip --- audio.c | 17 ++++- cfgfile.c | 15 +++- custom.c | 152 ++++++++++++++++++++++---------------- disk.c | 36 +++++---- include/options.h | 2 + inputevents.def | 16 ++-- memory.c | 3 +- od-win32/avioutput.c | 4 +- od-win32/dxwrap.c | 45 ++++------- od-win32/hardfile_win32.c | 10 +-- od-win32/win32.h | 2 +- 11 files changed, 173 insertions(+), 129 deletions(-) diff --git a/audio.c b/audio.c index 77063604..fa2c708d 100755 --- a/audio.c +++ b/audio.c @@ -42,6 +42,15 @@ int audio_channel_mask = 15; +STATIC_INLINE int isaudio(void) +{ + if (!currprefs.produce_sound) + return 0; + if (currprefs.picasso96_nocustom && picasso_on) + return 0; + return 1; +} + static int debugchannel (int ch) { if ((1 << ch) & DEBUG_CHANNEL_MASK) return 1; @@ -1320,7 +1329,9 @@ void update_audio (void) { unsigned long int n_cycles; - if (currprefs.produce_sound == 0 || savestate_state == STATE_RESTORE) + if (!isaudio()) + return; + if (savestate_state == STATE_RESTORE) return; n_cycles = get_cycles () - last_cycles; @@ -1389,7 +1400,7 @@ void audio_hsync (int dmaaction) { int nr, handle; - if (currprefs.produce_sound == 0) + if (!isaudio()) return; update_audio (); @@ -1504,7 +1515,7 @@ void AUDxPER (int nr, uae_u16 v) if (audio_channel[nr].per == PERIOD_MAX - 1 && per != PERIOD_MAX - 1) { audio_channel[nr].evtime = CYCLE_UNIT; - if (currprefs.produce_sound > 0) { + if (isaudio()) { schedule_audio (); events_schedule (); } diff --git a/cfgfile.c b/cfgfile.c index 64a0352d..387c2196 100755 --- a/cfgfile.c +++ b/cfgfile.c @@ -291,6 +291,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write (f, "sound_max_buff=%d\n", p->sound_maxbsiz); cfgfile_write (f, "sound_frequency=%d\n", p->sound_freq); + cfgfile_write (f, "sound_latency=%d\n", p->sound_latency); cfgfile_write (f, "sound_interpol=%s\n", interpolmode[p->sound_interpol]); cfgfile_write (f, "sound_adjust=%d\n", p->sound_adjust); cfgfile_write (f, "sound_filter=%s\n", soundfiltermode1[p->sound_filter]); @@ -442,6 +443,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write (f, "cpu_compatible=%s\n", p->cpu_compatible ? "true" : "false"); cfgfile_write (f, "cpu_cycle_exact=%s\n", p->cpu_cycle_exact ? "true" : "false"); cfgfile_write (f, "blitter_cycle_exact=%s\n", p->blitter_cycle_exact ? "true" : "false"); + cfgfile_write (f, "rtg_nocustom=%s\n", p->picasso96_nocustom ? "true" : "false"); cfgfile_write (f, "log_illegal_mem=%s\n", p->illegal_mem ? "true" : "false"); if (p->catweasel >= 100) @@ -636,7 +638,14 @@ static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value) } } - if (cfgfile_intval (option, value, "sound_max_buff", &p->sound_maxbsiz, 1) + if (cfgfile_intval (option, value, "sound_frequency", &p->sound_freq, 1)) { + /* backwards compatibility */ + p->sound_latency = 1000 * (p->sound_maxbsiz >> 1) / p->sound_freq; + return 1; + } + + if (cfgfile_intval (option, value, "sound_latency", &p->sound_latency, 1) + || cfgfile_intval (option, value, "sound_max_buff", &p->sound_maxbsiz, 1) || cfgfile_intval (option, value, "sound_bits", &p->sound_bits, 1) || cfgfile_intval (option, value, "state_replay_rate", &p->statecapturerate, 1) || cfgfile_intval (option, value, "state_replay_buffer", &p->statecapturebuffersize, 1) @@ -1016,6 +1025,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, char *option, char *valu || cfgfile_yesno (option, value, "fpu_strict", &p->fpu_strict) || cfgfile_yesno (option, value, "comp_midopt", &p->comp_midopt) || cfgfile_yesno (option, value, "comp_lowopt", &p->comp_lowopt) + || cfgfile_yesno (option, value, "rtg_nocustom", &p->picasso96_nocustom) || cfgfile_yesno (option, value, "scsi", &p->scsi)) return 1; if (cfgfile_intval (option, value, "cachesize", &p->cachesize, 1) @@ -2405,6 +2415,7 @@ void default_prefs (struct uae_prefs *p, int type) p->sound_bits = DEFAULT_SOUND_BITS; p->sound_freq = DEFAULT_SOUND_FREQ; p->sound_maxbsiz = DEFAULT_SOUND_MAXB; + p->sound_latency = 100; p->sound_interpol = 1; p->sound_filter = FILTER_SOUND_EMUL; p->sound_filter_type = 0; @@ -2480,6 +2491,7 @@ void default_prefs (struct uae_prefs *p, int type) p->maprom = 0; p->filesys_no_uaefsdb = 0; p->filesys_custom_uaefsdb = 1; + p->picasso96_nocustom = 0; p->cart_internal = 1; p->gfx_filter = 0; @@ -2837,6 +2849,7 @@ static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck) p->scsi = 1; p->socket_emu = 1; p->cart_internal = 0; + p->picasso96_nocustom = 1; return configure_rom (p, roms, romcheck); } diff --git a/custom.c b/custom.c index cd085e92..f4e14a5c 100755 --- a/custom.c +++ b/custom.c @@ -55,6 +55,13 @@ #include "enforcer.h" #endif +STATIC_INLINE int nocustom(void) +{ + if (picasso_on && currprefs.picasso96_nocustom) + return 1; + return 0; +} + void uae_abort (const char *format,...) { static int nomore; @@ -1564,9 +1571,9 @@ STATIC_INLINE void decide_line (int hpos) * but the new color has not been entered into the table yet. */ static void record_color_change (int hpos, int regno, unsigned long value) { - /* Early positions don't appear on-screen. */ if (regno < 0x1000 && nodraw ()) return; + /* Early positions don't appear on-screen. */ if (vpos < minfirstline) return; @@ -2459,6 +2466,8 @@ static void COPJMP (int num) int oldstrobe = cop_state.strobe; eventtab[ev_copper].active = 0; + if (nocustom()) + return; if (was_active) events_schedule (); @@ -3450,6 +3459,11 @@ static void update_copper (int until_hpos) int vp = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80); int c_hpos = cop_state.hpos; + if (nocustom()) { + eventtab[ev_copper].active = 0; + return; + } + if (eventtab[ev_copper].active) { dump_copper ("error1",until_hpos); eventtab[ev_copper].active = 0; @@ -3699,7 +3713,7 @@ static void compute_spcflag_copper (void) { copper_enabled_thisline = 0; unset_special (SPCFLAG_COPPER); - if (! dmaen (DMA_COPPER) || cop_state.state == COP_stop || cop_state.state == COP_bltwait) + if (!dmaen (DMA_COPPER) || cop_state.state == COP_stop || cop_state.state == COP_bltwait || nocustom()) return; if (cop_state.state == COP_wait) { @@ -4259,25 +4273,38 @@ static void hsync_handler (void) static int ciahsync; int hpos = current_hpos (); - sync_copper_with_cpu (maxhpos, 0); - - //copper_check (1); - - finish_decisions (); - if (thisline_decision.plfleft != -1) { - if (currprefs.collision_level > 1) - do_sprite_collisions (); - if (currprefs.collision_level > 2) - do_playfield_collisions (); + if (!nocustom()) { + sync_copper_with_cpu (maxhpos, 0); + //copper_check (1); + finish_decisions (); + if (thisline_decision.plfleft != -1) { + if (currprefs.collision_level > 1) + do_sprite_collisions (); + if (currprefs.collision_level > 2) + do_playfield_collisions (); + } + hsync_record_line_state (next_lineno, nextline_how, thisline_changed); + /* reset light pen latch */ + if (vpos == sprite_vblank_endline) + vpos_lpen = -1; +#ifdef CD32 + AKIKO_hsync_handler (); +#endif +#ifdef CPUEMU_6 + if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) { + decide_blitter (hpos); + memset (cycle_line, 0, sizeof cycle_line); + cycle_line[9] = CYCLE_REFRESH; + cycle_line[3] = CYCLE_REFRESH; + cycle_line[5] = CYCLE_REFRESH; + cycle_line[7] = CYCLE_REFRESH; + } +#endif } - hsync_record_line_state (next_lineno, nextline_how, thisline_changed); eventtab[ev_hsync].evtime += get_cycles () - eventtab[ev_hsync].oldcycles; eventtab[ev_hsync].oldcycles = get_cycles (); CIA_hsync_handler (); -#ifdef CD32 - AKIKO_hsync_handler (); -#endif #ifdef PICASSO96 picasso_handle_hsync (); @@ -4289,34 +4316,22 @@ static void hsync_handler (void) ciahsync = 0; } - /* reset light pen latch */ - if (vpos == sprite_vblank_endline) - vpos_lpen = -1; - -#ifdef CPUEMU_6 - if (currprefs.cpu_cycle_exact || currprefs.blitter_cycle_exact) { - decide_blitter (hpos); - memset (cycle_line, 0, sizeof cycle_line); - cycle_line[9] = CYCLE_REFRESH; - cycle_line[3] = CYCLE_REFRESH; - cycle_line[5] = CYCLE_REFRESH; - cycle_line[7] = CYCLE_REFRESH; - } -#endif if ((currprefs.chipset_mask & CSMASK_AGA) || (!currprefs.chipset_mask & CSMASK_ECS_AGNUS)) last_custom_value = rand (); else last_custom_value = 0xffff; - if (!currprefs.blitter_cycle_exact && bltstate != BLT_done && dmaen (DMA_BITPLANE) && diwstate == DIW_waiting_stop) - blitter_slowdown (thisline_decision.plfleft, thisline_decision.plfright - (16 << fetchmode), - cycle_diagram_total_cycles[fmode][GET_RES (bplcon0)][GET_PLANES_LIMIT (bplcon0)], - cycle_diagram_free_cycles[fmode][GET_RES (bplcon0)][GET_PLANES_LIMIT (bplcon0)]); + if (!nocustom()) { + if (!currprefs.blitter_cycle_exact && bltstate != BLT_done && dmaen (DMA_BITPLANE) && diwstate == DIW_waiting_stop) + blitter_slowdown (thisline_decision.plfleft, thisline_decision.plfright - (16 << fetchmode), + cycle_diagram_total_cycles[fmode][GET_RES (bplcon0)][GET_PLANES_LIMIT (bplcon0)], + cycle_diagram_free_cycles[fmode][GET_RES (bplcon0)][GET_PLANES_LIMIT (bplcon0)]); - if (currprefs.produce_sound) - audio_hsync (1); + if (currprefs.produce_sound) + audio_hsync (1); - hardware_line_completed (next_lineno); + hardware_line_completed (next_lineno); + } /* In theory only an equality test is needed here - but if a program goes haywire with the VPOSW register, it can cause us to miss this, @@ -4336,16 +4351,15 @@ static void hsync_handler (void) #ifdef JIT if (compiled_code) { if (currprefs.m68k_speed == -1) { - static int count=0; - + static int count = 0; count++; if (trigger_frh(count)) { frh_handler(); } is_lastline = trigger_frh(count+1) && ! rpt_did_reset; - } - else + } else { is_lastline=0; + } } else { #endif is_lastline = vpos + 1 == maxvpos + (lof == 0 ? 0 : 1) && currprefs.m68k_speed == -1 && ! rpt_did_reset; @@ -4353,33 +4367,37 @@ static void hsync_handler (void) } #endif - if (bplcon0 & 4) - notice_interlace_seen (); + if (!nocustom()) { + if (bplcon0 & 4) + notice_interlace_seen (); - if (!nodraw ()) { - int lineno = vpos; - nextline_how = nln_normal; - if (currprefs.gfx_linedbl) { - lineno *= 2; - nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack; - if (bplcon0 & 4) { - if (!lof) { - lineno++; - nextline_how = nln_lower; - } else { - nextline_how = nln_upper; + if (!nodraw ()) { + int lineno = vpos; + nextline_how = nln_normal; + if (currprefs.gfx_linedbl) { + lineno *= 2; + nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack; + if (bplcon0 & 4) { + if (!lof) { + lineno++; + nextline_how = nln_lower; + } else { + nextline_how = nln_upper; + } } } + next_lineno = lineno; + reset_decisions (); } - next_lineno = lineno; - reset_decisions (); } + #ifdef FILESYS if (uae_int_requested) { set_uae_int_flag (); INTREQ (0x8000 | 0x0008); } #endif + /* See if there's a chance of a copper wait ending this line. */ cop_state.hpos = 0; cop_state.last_write = 0; @@ -4685,6 +4703,8 @@ void custom_init (void) static uae_u32 custom_lget (uaecptr) REGPARAM; static uae_u32 custom_wget (uaecptr) REGPARAM; static uae_u32 custom_bget (uaecptr) REGPARAM; +static uae_u32 custom_lgeti (uaecptr) REGPARAM; +static uae_u32 custom_wgeti (uaecptr) REGPARAM; static void custom_lput (uaecptr, uae_u32) REGPARAM; static void custom_wput (uaecptr, uae_u32) REGPARAM; static void custom_bput (uaecptr, uae_u32) REGPARAM; @@ -4692,7 +4712,7 @@ static void custom_bput (uaecptr, uae_u32) REGPARAM; addrbank custom_bank = { custom_lget, custom_wget, custom_bget, custom_lput, custom_wput, custom_bput, - default_xlate, default_check, NULL, "Custom chipset" + default_xlate, default_check, NULL, "Custom chipset", }; STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr, int noput) @@ -4769,7 +4789,7 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr, int noput) return v; } -uae_u32 REGPARAM2 custom_wget (uaecptr addr) +static uae_u32 REGPARAM2 custom_wget (uaecptr addr) { uae_u32 v; @@ -4783,7 +4803,7 @@ uae_u32 REGPARAM2 custom_wget (uaecptr addr) return custom_wget2 (addr); } -uae_u32 REGPARAM2 custom_bget (uaecptr addr) +static uae_u32 REGPARAM2 custom_bget (uaecptr addr) { #ifdef JIT special_mem |= S_READ; @@ -4791,7 +4811,7 @@ uae_u32 REGPARAM2 custom_bget (uaecptr addr) return custom_wget2 (addr & ~1) >> (addr & 1 ? 0 : 8); } -uae_u32 REGPARAM2 custom_lget (uaecptr addr) +static uae_u32 REGPARAM2 custom_lget (uaecptr addr) { #ifdef JIT special_mem |= S_READ; @@ -4799,7 +4819,7 @@ uae_u32 REGPARAM2 custom_lget (uaecptr addr) return ((uae_u32)custom_wget (addr) << 16) | custom_wget (addr + 2); } -int REGPARAM2 custom_wput_1 (int hpos, uaecptr addr, uae_u32 value, int noget) +static int REGPARAM2 custom_wput_1 (int hpos, uaecptr addr, uae_u32 value, int noget) { addr &= 0x1FE; value &= 0xffff; @@ -5011,7 +5031,7 @@ int REGPARAM2 custom_wput_1 (int hpos, uaecptr addr, uae_u32 value, int noget) return 0; } -void REGPARAM2 custom_wput (uaecptr addr, uae_u32 value) +static void REGPARAM2 custom_wput (uaecptr addr, uae_u32 value) { int hpos = current_hpos (); #ifdef JIT @@ -5024,7 +5044,7 @@ void REGPARAM2 custom_wput (uaecptr addr, uae_u32 value) custom_wput_1 (hpos, addr, value, 0); } -void REGPARAM2 custom_bput (uaecptr addr, uae_u32 value) +static void REGPARAM2 custom_bput (uaecptr addr, uae_u32 value) { static int warned; @@ -5041,7 +5061,7 @@ void REGPARAM2 custom_bput (uaecptr addr, uae_u32 value) } } -void REGPARAM2 custom_lput(uaecptr addr, uae_u32 value) +static void REGPARAM2 custom_lput(uaecptr addr, uae_u32 value) { #ifdef JIT special_mem |= S_WRITE; @@ -5436,7 +5456,9 @@ void check_prefs_changed_custom (void) if (currprefs.chipset_mask != changed_prefs.chipset_mask || currprefs.gfx_vsync != changed_prefs.gfx_vsync || + currprefs.picasso96_nocustom != changed_prefs.picasso96_nocustom || currprefs.ntscmode != changed_prefs.ntscmode) { + currprefs.picasso96_nocustom = changed_prefs.picasso96_nocustom; currprefs.gfx_vsync = changed_prefs.gfx_vsync; currprefs.chipset_mask = changed_prefs.chipset_mask; if (currprefs.ntscmode != changed_prefs.ntscmode) { diff --git a/disk.c b/disk.c index c95a829c..d1eaf972 100755 --- a/disk.c +++ b/disk.c @@ -83,11 +83,15 @@ static uae_u8 writebuffer[544 * 11 * DDHDMULT]; #define DISK_INDEXSYNC 1 #define DISK_WORDSYNC 2 -#define DISK_REVOLUTION 4 /* 4,8,16,32 */ +#define DISK_MOTORDELAY 4 +#define DISK_REVOLUTION 8 /* 8,16,32,64 */ #define DSKREADY_TIME 4 #define DSKREADY_DOWN_TIME 10 +static int diskevent_flag; +static int disk_sync_cycle; + #if 0 #define MAX_DISK_WORDS_PER_LINE 50 /* depends on floppy_speed */ static uae_u32 dma_tab[MAX_DISK_WORDS_PER_LINE + 1]; @@ -137,6 +141,7 @@ typedef struct { int buffered_cyl, buffered_side; int cyl; int motoroff; + int motordelay; /* dskrdy needs some clock cycles before it changes after switching off motor */ int state; int wrprot; uae_u16 bigmfmbuf[0x4000 * DDHDMULT]; @@ -1109,6 +1114,14 @@ static void drive_motor (drive * drv, int off) #endif if (disk_debug_logging > 1) write_log (" ->motor off"); + if (currprefs.cpu_level <= 1) { + drv->motordelay = 1; + diskevent_flag = DISK_MOTORDELAY; + eventtab[ev_disk].oldcycles = get_cycles (); + eventtab[ev_disk].evtime = get_cycles () + 30 * CYCLE_UNIT; + eventtab[ev_disk].active = 1; + events_schedule (); + } } drv->motoroff = off; if (drv->motoroff) { @@ -2195,11 +2208,12 @@ uae_u8 DISK_status (void) /* report drive ID */ if (drv->idbit && currprefs.dfxtype[dr] != DRV_35_DD_ESCOM) st &= ~0x20; -#if 0 - if (dr == 0 && currprefs.dfxtype[dr] == DRV_35_DD && - drv->motoroff && drv->motorcycle + CYCLE_UNIT * 1 > get_cycles()) - st &= ~0x20, write_log("x %d\n", get_cycles()); -#endif + /* dskrdy needs some cycles after switching the motor off.. (Pro Tennis Tour) */ + if (drv->motordelay) { + write_log ("MOTORDELAY! %x\n", m68k_getpc()); + st &= ~0x20; + drv->motordelay = 0; + } } if (drive_track0 (drv)) st &= ~0x10; @@ -2296,9 +2310,6 @@ static void fetchnextrevolution (drive *drv) } } -static int diskevent_flag; -static int disk_sync_cycle; - void DISK_handler (void) { int flag = diskevent_flag; @@ -2312,11 +2323,11 @@ void DISK_handler (void) fetchnextrevolution (&floppy[2]); if (flag & (DISK_REVOLUTION << 3)) fetchnextrevolution (&floppy[3]); - if (flag & DISK_WORDSYNC) { + if (flag & DISK_WORDSYNC) INTREQ (0x8000 | 0x1000); - } - if (flag & DISK_INDEXSYNC) { + if (flag & DISK_INDEXSYNC) cia_diskindex (); + floppy[0].motordelay = floppy[1].motordelay = floppy[2].motordelay = floppy[3].motordelay = 0; #if 0 { int i; @@ -2333,7 +2344,6 @@ void DISK_handler (void) } } #endif - } } static void disk_doupdate_write (drive * drv, int floppybits) diff --git a/include/options.h b/include/options.h index 2eb52b58..bff8e7f2 100755 --- a/include/options.h +++ b/include/options.h @@ -89,6 +89,7 @@ struct uae_prefs { int sound_bits; int sound_freq; int sound_maxbsiz; + int sound_latency; int sound_interpol; int sound_adjust; int sound_filter; @@ -191,6 +192,7 @@ struct uae_prefs { int cpu_level; int cpu_compatible; int address_space_24; + int picasso96_nocustom; uae_u32 z3fastmem_size; uae_u32 z3fastmem_start; diff --git a/inputevents.def b/inputevents.def index f6df1d64..9ba3606b 100755 --- a/inputevents.def +++ b/inputevents.def @@ -12,15 +12,15 @@ DEFEVENT(MOUSE1_LAST, "", AM_DUMMY, 0,0,0) DEFEVENT(MOUSE1_UP,"Mouse1 Up",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_UP) DEFEVENT(MOUSE1_DOWN,"Mouse1 Down",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_DOWN) -DEFEVENT(MOUSE1_LEFT,"Mouse1 Left",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_LEFT) -DEFEVENT(MOUSE1_RIGHT,"Mouse1 Right",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_RIGHT) +DEFEVENT(MOUSE1_LEFT,"Mouse1 Left",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_LEFT) +DEFEVENT(MOUSE1_RIGHT,"Mouse1 Right",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_RIGHT) DEFEVENT(MOUSE1_WHEEL,"Mouse1 Wheel",AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,2) 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,64,1,0) -DEFEVENT(JOY1_VERT_POT,"Joy1 Vertical (Analog)",AM_JOY_AXIS,64,1,1) +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_LEFT,"Joy1 Left",AM_K,16,1,DIR_LEFT) DEFEVENT(JOY1_RIGHT,"Joy1 Right",AM_K,16,1,DIR_RIGHT) @@ -55,13 +55,13 @@ DEFEVENT(MOUSE2_LAST, "", AM_DUMMY, 0,0,0) DEFEVENT(MOUSE2_UP,"Mouse2 Up",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,2,DIR_UP) DEFEVENT(MOUSE2_DOWN,"Mouse2 Down",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,2,DIR_DOWN) -DEFEVENT(MOUSE2_LEFT,"Mouse2 Left",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,2,DIR_LEFT) -DEFEVENT(MOUSE2_RIGHT,"Mouse2 Right",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,2,DIR_RIGHT) +DEFEVENT(MOUSE2_LEFT,"Mouse2 Left",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,2,DIR_LEFT) +DEFEVENT(MOUSE2_RIGHT,"Mouse2 Right",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,2,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,64,2,0) -DEFEVENT(JOY2_VERT_POT,"Joy2 Vertical (Analog)",AM_JOY_AXIS,64,2,1) +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_LEFT,"Joy2 Left",AM_K,16,2,DIR_LEFT) DEFEVENT(JOY2_RIGHT,"Joy2 Right",AM_K,16,2,DIR_RIGHT) diff --git a/memory.c b/memory.c index 98c94ba3..b6b26e99 100755 --- a/memory.c +++ b/memory.c @@ -2349,6 +2349,7 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr) count = 0; for (;;) { mem_type = count; + mem_size = 0; switch (count) { case 0: /* Kickstart ROM */ mem_start = 0xf80000; @@ -2374,7 +2375,7 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr) mem_real_start = extendedkickmemory; mem_size = extendedkickmem_size; path = currprefs.romextfile; - sprintf (tmpname, "CD32 Extended"); + sprintf (tmpname, "Extended"); break; default: return 0; diff --git a/od-win32/avioutput.c b/od-win32/avioutput.c index eef5d8ed..a2179368 100755 --- a/od-win32/avioutput.c +++ b/od-win32/avioutput.c @@ -200,7 +200,7 @@ static int AVIOutput_AllocateAudio(void) // set the source format wfxSrc.wFormatTag = WAVE_FORMAT_PCM; - wfxSrc.nChannels = currprefs.sound_stereo == 3 ? 4 : (currprefs.sound_stereo ? 2 : 1); + wfxSrc.nChannels = (currprefs.sound_stereo == 3 || currprefs.sound_stereo == 2) ? 4 : (currprefs.sound_stereo ? 2 : 1); wfxSrc.nSamplesPerSec = workprefs.sound_freq; wfxSrc.nBlockAlign = wfxSrc.nChannels * (workprefs.sound_bits / 8); wfxSrc.nAvgBytesPerSec = wfxSrc.nBlockAlign * wfxSrc.nSamplesPerSec; @@ -829,7 +829,7 @@ static void writewavheader (uae_u32 size) uae_u16 tw; uae_u32 tl; int bits = 16; - int channels = currprefs.sound_stereo == 3 ? 4 : (currprefs.sound_stereo ? 2 : 1); + int channels = (currprefs.sound_stereo == 3 || currprefs.sound_stereo == 2) ? 4 : (currprefs.sound_stereo ? 2 : 1); fseek (wavfile, 0, SEEK_SET); fwrite ("RIFF", 1, 4, wavfile); diff --git a/od-win32/dxwrap.c b/od-win32/dxwrap.c index 7c6b60a8..eef19134 100755 --- a/od-win32/dxwrap.c +++ b/od-win32/dxwrap.c @@ -982,42 +982,34 @@ HRESULT DirectDraw_CreateOverlaySurface(int width, int height, int bits, int typ DWORD dwDDSColor; DWORD flags = DDPF_RGB; - ZeroMemory( &ddpfOverlayFormat, sizeof(ddpfOverlayFormat) ); + ZeroMemory(&ddpfOverlayFormat, sizeof(ddpfOverlayFormat)); ddpfOverlayFormat.dwSize = sizeof(ddpfOverlayFormat); - ZeroMemory( &ddsd, sizeof(ddsd) ); + ZeroMemory(&ddsd, sizeof(ddsd)); - if( bOverlayAvailable ) - { + if (bOverlayAvailable) { write_log( "CreateOverlaySurface being called with %d-bits!\n", bits ); - if( bits == 16 ) - { + if(bits == 16) { // Set the overlay format to 16 bit RGB 5:6:5 ddpfOverlayFormat.dwFlags = flags; ddpfOverlayFormat.dwRGBBitCount = 16; ddpfOverlayFormat.dwRBitMask = 0xF800; ddpfOverlayFormat.dwGBitMask = 0x07E0; ddpfOverlayFormat.dwBBitMask = 0x001F; - } - else if( bits == 32 ) - { + } else if(bits == 32) { // Set the overlay format to 32 bit ARGB 8:8:8:8 ddpfOverlayFormat.dwFlags = flags; ddpfOverlayFormat.dwRGBBitCount = 32; ddpfOverlayFormat.dwRBitMask = 0x00FF0000; ddpfOverlayFormat.dwGBitMask = 0x0000FF00; ddpfOverlayFormat.dwBBitMask = 0x000000FF; - } - else if( bits == 8 ) - { + } else if(bits == 8) { // Set the overlay format to 8 bit palette ddpfOverlayFormat.dwFlags = flags | DDPF_PALETTEINDEXED8; ddpfOverlayFormat.dwRGBBitCount = 8; ddpfOverlayFormat.dwRBitMask = 0x00000000; ddpfOverlayFormat.dwGBitMask = 0x00000000; ddpfOverlayFormat.dwBBitMask = 0x00000000; - } - else - { + } else { // We don't handle this case... return DDERR_INVALIDPIXELFORMAT; } @@ -1030,7 +1022,7 @@ HRESULT DirectDraw_CreateOverlaySurface(int width, int height, int bits, int typ ddsd.dwHeight = height; ddsd.ddpfPixelFormat = ddpfOverlayFormat; - ZeroMemory(&overlayfx,sizeof(overlayfx)); + ZeroMemory(&overlayfx, sizeof(overlayfx)); overlayfx.dwSize = sizeof(overlayfx); overlayflags = DDOVER_SHOW | DDOVER_DDFX | DDOVER_KEYDESTOVERRIDE; @@ -1040,17 +1032,12 @@ HRESULT DirectDraw_CreateOverlaySurface(int width, int height, int bits, int typ // Attempt to create the surface with theses settings ddrval = IDirectDraw7_CreateSurface (DirectDrawState.directdraw.dd, &ddsd, &DirectDrawState.overlay.surface, NULL); - if(SUCCEEDED(ddrval)) - { + if(SUCCEEDED(ddrval)) { DirectDrawState.isoverlay = 1; - } - else - { + } else { DirectDrawState.isoverlay = 0; } - } - else - { + } else { write_log( "CreateOverlaySurface being called, but no overlay support with this card...!\n" ); } return ddrval; @@ -1105,7 +1092,7 @@ HRESULT DirectDraw_CreateSurface( int width, int height ) clearsurface (primary_surface); } else { // We're not full-screen, so you cannot create a flipping pair... - ZeroMemory( &DirectDrawState.primary.desc, sizeof(DDSURFACEDESC2)); + ZeroMemory(&DirectDrawState.primary.desc, sizeof(DDSURFACEDESC2)); DirectDrawState.primary.desc.dwSize = sizeof(DDSURFACEDESC2); DirectDrawState.primary.desc.dwFlags = DDSD_CAPS; DirectDrawState.primary.desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; @@ -1115,11 +1102,9 @@ HRESULT DirectDraw_CreateSurface( int width, int height ) NULL); } - if(FAILED(ddrval)) - { + if(FAILED(ddrval)) { goto out; - } - else + } else { write_log( "DDRAW: Primary %ssurface created in video-memory\n", DirectDrawState.flipping != single_buffer ? "flipping " : "" ); } @@ -1484,7 +1469,7 @@ RGBFTYPE DirectDraw_GetSurfacePixelFormat( LPDDSURFACEDESC2 surface ) surf_flags = surface->dwFlags; pfp = &surface->ddpfPixelFormat; - if( ( surf_flags & DDSD_PIXELFORMAT ) == 0x0 ) + if((surf_flags & DDSD_PIXELFORMAT) == 0x0) return RGBFB_NONE; if ((pfp->dwFlags & DDPF_RGB) == 0) diff --git a/od-win32/hardfile_win32.c b/od-win32/hardfile_win32.c index 81de7dd8..2ca1132d 100755 --- a/od-win32/hardfile_win32.c +++ b/od-win32/hardfile_win32.c @@ -823,6 +823,7 @@ Return Value: struct uae_driveinfo *udi2 = udi; int nonzeropart = 0; int gotpart = 0; + int safepart = 0; write_log ("%d MBR partitions found\n", dli->PartitionCount); for (i = 0; i < dli->PartitionCount && (*index2) < MAX_FILESYSTEM_UNITS; i++) { PARTITION_INFORMATION *pi = &dli->PartitionEntry[i]; @@ -847,6 +848,7 @@ Return Value: sprintf (udi->device_name, "HD_P#%d_%s", pi->PartitionNumber, orgname); udi++; (*index2)++; + safepart = 1; } gotpart = 1; } @@ -854,9 +856,8 @@ Return Value: write_log ("empty MBR partition table detected, checking for RDB\n"); } else if (!gotpart) { write_log ("non-empty MBR partition table detected, doing RDB check anyway\n"); - } else if (harddrive_dangerous != 0x1234dead) { - ret = 1; - goto end; + } else if (safepart) { + goto amipartfound; /* ugly but bleh.. */ } } else { write_log ("no MBR partition table detected, checking for RDB\n"); @@ -867,8 +868,7 @@ Return Value: ret = 1; goto end; } - - write_log ("device accepted, start=%I64d, size=%I64d, block=%d\n", udi->offset, udi->size, udi->bytespersector); +amipartfound: if (i > 1) sprintf (udi->device_name, "HD_*_%s", orgname); else diff --git a/od-win32/win32.h b/od-win32/win32.h index 561ee344..36d51b09 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -22,7 +22,7 @@ extern int manual_palette_refresh_needed; extern int mouseactive, focus; extern int ignore_messages_all; #define WINUAEBETA 1 -#define WINUAEBETASTR " Beta 1" +#define WINUAEBETASTR " Beta 2" extern char start_path_exe[MAX_DPATH]; extern char start_path_data[MAX_DPATH]; -- 2.47.3