From: Toni Wilen Date: Thu, 28 Dec 2006 16:36:04 +0000 (+0200) Subject: imported winuaesrc1340b8.zip X-Git-Tag: 2100~256 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=72c76cef3c236539745a2dfabcdbf8782e401efc;p=francis%2Fwinuae.git imported winuaesrc1340b8.zip --- diff --git a/audio.c b/audio.c index 9cb46207..9e64f734 100755 --- a/audio.c +++ b/audio.c @@ -937,6 +937,27 @@ void sample16si_rh_handler (void) static int audio_work_to_do; +static void zerostate(struct audio_channel_data *cdp) +{ + cdp->state = 0; + cdp->evtime = MAX_EV; + cdp->request_word = 0; +} + +static void audio_event_reset(void) +{ + int i; + + last_cycles = get_cycles () - 1; + next_sample_evtime = scaled_sample_evtime; + for (i = 0; i < 4; i++) { + struct audio_channel_data *cdp = audio_channel + i; + zerostate(cdp); + } + schedule_audio (); + events_schedule (); +} + static void audio_deactivate(void) { if (!currprefs.sound_auto) @@ -944,14 +965,17 @@ static void audio_deactivate(void) gui_data.sndbuf_status = 3; gui_data.sndbuf = 0; clear_sound_buffers(); + audio_event_reset(); } int audio_activate(void) { int ret = 0; + if (!audio_work_to_do) { restart_sound_buffer(); ret = 1; + audio_event_reset(); } audio_work_to_do = 4 * maxvpos * 50; return ret; @@ -1029,13 +1053,6 @@ static void state23 (struct audio_channel_data *cdp) } } -static void zerostate(struct audio_channel_data *cdp) -{ - cdp->state = 0; - cdp->evtime = MAX_EV; - cdp->request_word = 0; -} - static void audio_handler (int nr, int timed) { struct audio_channel_data *cdp = audio_channel + nr; @@ -1292,7 +1309,6 @@ void set_audio(void) } } } - last_cycles = get_cycles () - 1; next_sample_evtime = scaled_sample_evtime; compute_vsynctime (); @@ -1351,6 +1367,8 @@ void set_audio(void) sample_prehandler = anti_prehandler; } + audio_event_reset(); + if (currprefs.produce_sound == 0) { eventtab[ev_audio].active = 0; events_schedule (); diff --git a/debug.c b/debug.c index ac861a1e..d4821430 100755 --- a/debug.c +++ b/debug.c @@ -1373,15 +1373,26 @@ static void writeintomem (char **c) uae_u32 addr = 0; uae_u32 val = 0; char cc; + int len = 1; ignore_ws(c); addr = readhex (c); ignore_ws(c); val = readhex (c); - if (val > 0xffff) { + if (val > 0xffff) + len = 4; + else if (val > 0xff) + len = 2; + else + len = 1; + if (more_params(c)) { + ignore_ws(c); + len = readint (c); + } + if (len == 4) { put_long (addr, val); cc = 'L'; - } else if (val > 0xff) { + } else if (len == 2) { put_word (addr, val); cc = 'W'; } else { diff --git a/drawing.c b/drawing.c index 9ccc03f4..e57837d1 100755 --- a/drawing.c +++ b/drawing.c @@ -193,7 +193,7 @@ static int bplehb, bplham, bpldualpf, bpldualpfpri, bpldualpf2of, bplplanecnt, b static int plf1pri, plf2pri; static uae_u32 plf_sprite_mask; static int sbasecol[2] = { 16, 16 }; -static int brdsprt, brdblank; +static int brdsprt, brdblank, brdblank_changed; int picasso_requested_on; int picasso_on; @@ -1252,6 +1252,8 @@ static void adjust_drawing_colors (int ctable, int need_full) * form. */ static void pfield_expand_dp_bplcon (void) { + int brdblank_2; + bplres = dp_for_drawing->bplres; bplplanecnt = dp_for_drawing->nr_planes; bplham = dp_for_drawing->ham_seen; @@ -1273,16 +1275,15 @@ static void pfield_expand_dp_bplcon (void) plf_sprite_mask |= (0xFFFF << (4 * plf1pri)) & 0xFFFF; bpldualpf = (dp_for_drawing->bplcon0 & 0x400) == 0x400; bpldualpfpri = (dp_for_drawing->bplcon2 & 0x40) == 0x40; + brdblank_2 = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x20); + if (brdblank_2 != brdblank) + brdblank_changed = 1; + brdblank = brdblank_2; #ifdef AGA bpldualpf2of = (dp_for_drawing->bplcon3 >> 10) & 7; sbasecol[0] = ((dp_for_drawing->bplcon4 >> 4) & 15) << 4; sbasecol[1] = ((dp_for_drawing->bplcon4 >> 0) & 15) << 4; - - brdsprt = (currprefs.chipset_mask & CSMASK_AGA) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x02); - /* FIXME: we must update top and bottom borders when BRDBLANK changes */ - brdblank = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x20); - if (brdblank) - brdsprt = 0; + 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) @@ -1922,9 +1923,9 @@ static void draw_status_line (int line) } on_rgb = 0x000; if (on < 0) - on_rgb = 0xc00; // underflow + on_rgb = 0xcc0; // underflow else if (on == 2) - on_rgb = 0xcc0; // really big overflow + on_rgb = 0xc00; // really big overflow else if (on == 1) on_rgb = 0x00c; // "normal" overflow off_rgb = 0x000; @@ -2076,11 +2077,15 @@ void finish_drawing_frame (void) /* clear possible old garbage at the bottom if emulated area become smaller */ while (last_max_ypos < gfxvidinfo.height) { + xcolnr tmp = colors_for_drawing.acolors[0]; + colors_for_drawing.acolors[0] = getxcolor (0); xlinebuffer = gfxvidinfo.linemem; if (xlinebuffer == 0) xlinebuffer = row_map[last_max_ypos]; - memset (xlinebuffer, brdblank ? 0 : colors_for_drawing.acolors[0], gfxvidinfo.width * gfxvidinfo.pixbytes); + xlinebuffer -= linetoscr_x_adjust_bytes; + fill_line (); do_flush_line (last_max_ypos); + colors_for_drawing.acolors[0] = tmp; last_max_ypos++; } @@ -2096,6 +2101,13 @@ void finish_drawing_frame (void) lightpen_update (); do_flush_screen (first_drawn_line, last_drawn_line); + + if (brdblank_changed) { + last_max_ypos = max_ypos_thisframe; + last_redraw_point = 10; + notice_screen_contents_lost(); + brdblank_changed = 0; + } } void hardware_line_completed (int lineno) diff --git a/od-win32/mman.c b/od-win32/mman.c index ce5fcf29..59b3e153 100755 --- a/od-win32/mman.c +++ b/od-win32/mman.c @@ -151,7 +151,7 @@ void mapped_free(uae_u8 *mem) if (shmctl(x->id, IPC_STAT, &blah) == 0) { shmctl(x->id, IPC_RMID, &blah); } else { - VirtualFree((LPVOID)mem, 0, os_winnt ? MEM_RESET : (MEM_DECOMMIT | MEM_RELEASE)); + VirtualFree((LPVOID)mem, 0, os_winnt ? MEM_DECOMMIT : MEM_RELEASE); } } x = x->next; @@ -273,7 +273,7 @@ void *shmat(int shmid, void *shmaddr, int shmflg) got = FALSE; if (got == FALSE) { if (shmaddr) - VirtualFree(shmaddr, 0, os_winnt ? MEM_RESET : MEM_RELEASE); + VirtualFree(shmaddr, os_winnt ? size : 0, os_winnt ? MEM_DECOMMIT : MEM_RELEASE); result = VirtualAlloc(shmaddr, size, os_winnt ? MEM_COMMIT : (MEM_RESERVE | MEM_COMMIT), PAGE_EXECUTE_READWRITE); if (result == NULL) { diff --git a/od-win32/resources/winuae.exe.manifest b/od-win32/resources/winuae.exe.manifest index 636d42c6..f9701443 100755 --- a/od-win32/resources/winuae.exe.manifest +++ b/od-win32/resources/winuae.exe.manifest @@ -1,5 +1,5 @@ - + + - \ No newline at end of file + + + + + + + + diff --git a/od-win32/sounddep/sound.c b/od-win32/sounddep/sound.c index 4d045434..437249a4 100755 --- a/od-win32/sounddep/sound.c +++ b/od-win32/sounddep/sound.c @@ -258,8 +258,8 @@ static int open_audio_ds (int size) snd_writeoffset = max_sndbufsize * 5 / 8; snd_maxoffset = max_sndbufsize; - snd_totalmaxoffset_of = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 1 / 3; - snd_totalmaxoffset_uf = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 2 / 3; + snd_totalmaxoffset_of = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 3 / 9; + snd_totalmaxoffset_uf = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 7 / 9; memset (&wavfmt, 0, sizeof (WAVEFORMATEXTENSIBLE)); wavfmt.Format.nChannels = (currprefs.sound_stereo == 3 || currprefs.sound_stereo == 2) ? 4 : (currprefs.sound_stereo ? 2 : 1); @@ -608,7 +608,7 @@ static void finish_sound_buffer_ds (void) diff = dsoundbuf - playpos + writepos; if (diff < safedist || diff > snd_totalmaxoffset_uf) { - hr = IDirectSoundBuffer_Lock (lpDSBsecondary, writepos, safedist, &b1, &s1, &b2, &s2, 0); + hr = IDirectSoundBuffer_Lock (lpDSBsecondary, writepos, sndbufsize, &b1, &s1, &b2, &s2, 0); if (SUCCEEDED(hr)) { memset (b1, 0, s1); if (b2) @@ -617,9 +617,9 @@ static void finish_sound_buffer_ds (void) } gui_data.sndbuf_status = -1; statuscnt = SND_STATUSCNT; - writepos += safedist; + writepos += sndbufsize; cf(writepos); - break; + continue; } if (diff > snd_totalmaxoffset_of) { @@ -627,6 +627,7 @@ static void finish_sound_buffer_ds (void) statuscnt = SND_STATUSCNT; restart_sound_buffer(); diff = snd_writeoffset; + write_log("SOUND: overflow (%d %d)\n", diff, snd_totalmaxoffset_of); break; } diff --git a/od-win32/win32.c b/od-win32/win32.c index f923e816..8e6cd132 100755 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -2861,7 +2861,7 @@ static LONG WINAPI ExceptionFilter( struct _EXCEPTION_POINTERS * pExceptionPoint if (ec == EXCEPTION_ACCESS_VIOLATION && !er->ExceptionFlags && er->NumberParameters >= 2 && !er->ExceptionInformation[0] && regs.pc_p) { void *p = (void*)er->ExceptionInformation[1]; - write_log ("%p %p %p\n", p, regs.pc_p, prevpc); + write_log ("ExceptionFilter Trap: %p %p %p\n", p, regs.pc_p, prevpc); if ((p >= (void*)regs.pc_p && p < (void*)(regs.pc_p + 32)) || (p >= (void*)prevpc && p < (void*)(prevpc + 32))) { int got = 0; diff --git a/od-win32/win32.h b/od-win32/win32.h index 22559f55..2a0fd924 100755 --- 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 7 +#define WINUAEBETA 8 #define WINUAEPUBLICBETA 1 -#define WINUAEDATE MAKEBD(2006, 12, 25) +#define WINUAEDATE MAKEBD(2006, 12, 28) #define IHF_WINDOWHIDDEN 6 #define NORMAL_WINDOW_STYLE (WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU) diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 63bda408..f1c63fd6 100755 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,11 @@ +Beta 8: (RC3, really final?) + +- random sound automatic restart delay fixed +- sound underflow handling improved +- JIT NATMEM VirtalFree() incorrect parameters fixed (MS Application + Verifier report) + Beta 7: (RC2) - AGA sprites outside display window emulated when sprite is above or @@ -12,8 +19,10 @@ Beta 7: (RC2) (according to MSDN WAVEFORMATEXTENSIBLE is required if >2 channels but for some reason "incorrect" way also worked previously..) - mask unused DIWHIGH bits, could have caused narrow image appearing on - screen when loading statefile with diwhigh having highest bit set and + screen when loading statefile with DIWHIGH having highest bit set and ECS Agnus or AGA enabled. +- border blanking feature (ECS/AGA BPLCON3 BRDRBLNK-bit) now also + updates top and bottom borders Beta 6: (RC)