From b2eacde850705e8c6dcbe685a8ffa6559f3fe326 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 27 Sep 2009 19:13:43 +0300 Subject: [PATCH] imported winuaesrc2000b16.zip --- blitter.c | 3 +-- custom.c | 16 ++++++++++----- drawing.c | 15 +++++++++----- hardfile.c | 4 ++++ include/drawing.h | 2 +- od-win32/dinput.c | 2 +- od-win32/resources/winuae.rc | 6 +++--- od-win32/win32.c | 2 +- od-win32/win32.h | 4 ++-- od-win32/win32gui.c | 38 ++++++++++++++++-------------------- od-win32/winuaechangelog.txt | 12 ++++++++++++ scsiemul.c | 5 +++++ 12 files changed, 68 insertions(+), 41 deletions(-) diff --git a/blitter.c b/blitter.c index c15ef9c1..9e912649 100644 --- a/blitter.c +++ b/blitter.c @@ -646,10 +646,9 @@ static void decide_blitter_line (int hsync, int hpos) for (;;) { int v = canblit (last_blitter_hpos); - blitter_nasty++; - if (!v) { blit_misscyclecounter++; + blitter_nasty++; break; } diff --git a/custom.c b/custom.c index b6051426..859ef530 100644 --- a/custom.c +++ b/custom.c @@ -234,7 +234,7 @@ int bpl_off[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; static struct color_entry current_colors; static unsigned int bplcon0, bplcon1, bplcon2, bplcon3, bplcon4; -static unsigned int bplcon0d, bplcon0_res, bplcon0_planes, bplcon0_planes_limit; +static unsigned int bplcon0d, bplcon0dd, bplcon0_res, bplcon0_planes, bplcon0_planes_limit; static unsigned int diwstrt, diwstop, diwhigh; static int diwhigh_written; static unsigned int ddfstrt, ddfstop, ddfstrt_old_hpos, ddfstrt_old_vpos; @@ -826,7 +826,9 @@ STATIC_INLINE void compute_delay_offset (void) static void record_color_change2 (int hpos, int regno, unsigned long value) { - curr_color_changes[next_color_change].linepos = hpos; + curr_color_changes[next_color_change].linepos = hpos * 2; + // hpos >= 0xe0, add 2 lores pixels (PAL 0.5 extra cycle, should be in copper emul..) + curr_color_changes[next_color_change].linepos += (hpos >= maxhpos - 3) ? 2 : 0; curr_color_changes[next_color_change].regno = regno; curr_color_changes[next_color_change++].value = value; curr_color_changes[next_color_change].regno = -1; @@ -873,7 +875,10 @@ STATIC_INLINE int is_bitplane_dma_inline (int hpos) static void update_denise (int hpos) { toscr_res = GET_RES_DENISE (bplcon0d); - record_color_change2 (hpos, 0x100 + 0x1000, bplcon0d); + if (bplcon0dd != bplcon0d) { + record_color_change2 (hpos, 0x100 + 0x1000, bplcon0d); + bplcon0dd = bplcon0d; + } toscr_nr_planes = GET_PLANES (bplcon0d); if (isocs7planes ()) { if (toscr_nr_planes2 < 6) @@ -1885,7 +1890,7 @@ static void record_color_change (int hpos, int regno, unsigned long value) return; } #endif - if (regno < 0x1000 && hpos < HBLANK_OFFSET && !(beamcon0 & 0x80) && prev_lineno >= 0) { + if (regno < 0x1000 && hpos < HBLANK_OFFSET && !(beamcon0 & 0x80) && prev_lineno >= 0) { struct draw_info *pdip = curr_drawinfo + prev_lineno; int idx = pdip->last_color_change; /* Move color changes in horizontal cycles 0 to HBLANK_OFFSET to end of previous line. @@ -1893,7 +1898,7 @@ static void record_color_change (int hpos, int regno, unsigned long value) */ pdip->last_color_change++; pdip->nr_color_changes++; - curr_color_changes[idx].linepos = hpos + maxhpos + 1; + curr_color_changes[idx].linepos = (hpos + maxhpos) * 2; curr_color_changes[idx].regno = regno; curr_color_changes[idx].value = value; curr_color_changes[idx + 1].regno = -1; @@ -3297,6 +3302,7 @@ static void BPLCON0_Denise (int hpos, uae_u16 v) if (bplcon0d == v) return; + bplcon0dd = -1; // fake unused 0x0080 bit as an EHB bit (see below) if (isehb (bplcon0d, bplcon2)) v |= 0x80; diff --git a/drawing.c b/drawing.c index 4f5dbae2..8965c11e 100644 --- a/drawing.c +++ b/drawing.c @@ -543,6 +543,8 @@ void record_diw_line (int plfstrt, int first, int last) PLAYFIELD_START and PLAYFIELD_END are in window coordinates. */ static int playfield_start, playfield_end; static int real_playfield_start, real_playfield_end; +static int linetoscr_diw_start, linetoscr_diw_end; +static int native_ddf_left, native_ddf_right; static int pixels_offset; static int src_pixel, ham_src_pixel; @@ -558,12 +560,13 @@ static void pfield_init_linetoscr (void) /* First, get data fetch start/stop in DIW coordinates. */ int ddf_left = dp_for_drawing->plfleft * 2 + DIW_DDF_OFFSET; int ddf_right = dp_for_drawing->plfright * 2 + DIW_DDF_OFFSET; + /* Compute datafetch start/stop in pixels; native display coordinates. */ - int native_ddf_left = coord_hw_to_window_x (ddf_left); - int native_ddf_right = coord_hw_to_window_x (ddf_right); + native_ddf_left = coord_hw_to_window_x (ddf_left); + native_ddf_right = coord_hw_to_window_x (ddf_right); - int linetoscr_diw_start = dp_for_drawing->diwfirstword; - int linetoscr_diw_end = dp_for_drawing->diwlastword; + linetoscr_diw_start = dp_for_drawing->diwfirstword; + linetoscr_diw_end = dp_for_drawing->diwlastword; res_shift = lores_shift - bplres; @@ -1930,15 +1933,17 @@ STATIC_INLINE void do_color_changes (line_draw_func worker_border, line_draw_fun int i; int lastpos = visible_left_border; int endpos = visible_left_border + gfxvidinfo.width; + int diff = 1 << lores_shift; for (i = dip_for_drawing->first_color_change; i <= dip_for_drawing->last_color_change; i++) { int regno = curr_color_changes[i].regno; unsigned int value = curr_color_changes[i].value; int nextpos, nextpos_in_range; + if (i == dip_for_drawing->last_color_change) nextpos = endpos; else - nextpos = coord_hw_to_window_x (curr_color_changes[i].linepos * 2); + nextpos = coord_hw_to_window_x (curr_color_changes[i].linepos); nextpos_in_range = nextpos; if (nextpos > endpos) diff --git a/hardfile.c b/hardfile.c index d50b80ec..d2d9b92a 100644 --- a/hardfile.c +++ b/hardfile.c @@ -60,6 +60,7 @@ struct hardfileprivdata { uae_sem_t sync_sem; uaecptr base; int changenum; + uaecptr changeint; }; #define VHD_DYNAMIC 3 @@ -1341,6 +1342,8 @@ void hardfile_do_disk_change (struct uaedev_config_info *uci, int insert) } j++; } + if (hardfpd[fsid].changeint) + uae_Cause (hardfpd[fsid].changeint); uae_sem_post (&change_sem); } @@ -1680,6 +1683,7 @@ static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata break; case CMD_REMOVE: + hfpd->changeint = get_long (request + 40); break; case CMD_CHANGENUM: diff --git a/include/drawing.h b/include/drawing.h index 55f44947..a701894a 100644 --- a/include/drawing.h +++ b/include/drawing.h @@ -27,7 +27,7 @@ #else /* According to the HRM, pixel data spends a couple of cycles somewhere in the chips before it appears on-screen. (TW: display emulation now does this automatically) */ -#define DIW_DDF_OFFSET 0 +#define DIW_DDF_OFFSET 1 /* this many cycles starting from hpos=0 are visible on right border */ #define HBLANK_OFFSET 9 /* We ignore that many lores pixels at the start of the display. These are diff --git a/od-win32/dinput.c b/od-win32/dinput.c index 24c84df9..38530acd 100644 --- a/od-win32/dinput.c +++ b/od-win32/dinput.c @@ -2087,7 +2087,7 @@ static int refresh_kb (LPDIRECTINPUTDEVICE8 lpdi, int num) else kc[i] = 0; if (kc[i] != di_keycodes[num][i]) { - write_log (L"%02X -> %d\n", i, kc[i]); + write_log (L"%d: %02X -> %d\n", num, i, kc[i]); di_keycodes[num][i] = kc[i]; my_kbd_handler (num, i, kc[i]); } diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 1d780f6b..775fe286 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -174,7 +174,7 @@ BEGIN RTEXT "Motherboard Fast RAM:",-1,40,100,129,10,SS_CENTERIMAGE CONTROL "",IDC_MBMEM1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,181,96,59,20 EDITTEXT IDC_MBRAM1,244,99,34,12,ES_CENTER | ES_READONLY - RTEXT "Prosessor Slot Fast RAM:",-1,40,123,129,10,SS_CENTERIMAGE + RTEXT "Processor Slot Fast RAM:",-1,40,123,129,10,SS_CENTERIMAGE CONTROL "",IDC_MBMEM2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,181,119,59,20 EDITTEXT IDC_MBRAM2,244,122,34,12,ES_CENTER | ES_READONLY END @@ -486,6 +486,8 @@ BEGIN RTEXT "DirectDraw display buffer:",IDC_STATIC,195,50,92,10,SS_CENTERIMAGE RTEXT "SCSI and CD/DVD access method:",IDC_STATIC,151,12,126,10,SS_CENTERIMAGE CONTROL "Synchronize clock",IDC_CLOCKSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,109,111,10 + CONTROL "Faster RTG [] Enables less accurate custom chipset emulation mode when Picasso96 is enabled.",IDC_FASTERRTG, + "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,19,122,100,10 END IDD_HARDFILE DIALOGEX 0, 0, 299, 249 @@ -603,8 +605,6 @@ BEGIN CONTROL "Emulated, 100% accurate",IDC_CS_SOUND2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,205,95,10 CONTROL "Genlock connected [] Allow boot sequence to detect genlock. Genlock is not emulated.",IDC_GENLOCK, "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,59,100,10 - CONTROL "Faster RTG [] Enables less accurate custom chipset emulation mode when Picasso96 is enabled.",IDC_FASTERRTG, - "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,72,100,10 COMBOBOX IDC_CS_EXT,100,80,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP RTEXT "Chipset Extra",IDC_STATIC,25,79,52,15,SS_CENTERIMAGE END diff --git a/od-win32/win32.c b/od-win32/win32.c index e74b982c..7e1a0ef0 100644 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -2076,7 +2076,7 @@ uae_u8 *target_load_keyfile (struct uae_prefs *p, TCHAR *path, int *sizep, TCHAR *sizep = size; //write_log (L"size: %d\n", size); if (size > 0) { - int gotsize, i; + int gotsize; keybuf = xmalloc (size); gotsize = pfnGetKey (keybuf, size); //write_log (L"gotsize: %d\n", gotsize); diff --git a/od-win32/win32.h b/od-win32/win32.h index 59a947b4..f2cd03ce 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -17,8 +17,8 @@ #define WINUAEPUBLICBETA 1 -#define WINUAEBETA L"15" -#define WINUAEDATE MAKEBD(2009, 9, 25) +#define WINUAEBETA L"16" +#define WINUAEDATE MAKEBD(2009, 9, 27) #define WINUAEEXTRA L"" #define WINUAEREV L"" diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index 4ee7e68b..71e98f4a 100644 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -5182,7 +5182,6 @@ static void values_to_chipsetdlg (HWND hDlg) CheckDlgButton (hDlg, IDC_NTSC, workprefs.ntscmode); CheckDlgButton (hDlg, IDC_GENLOCK, workprefs.genlock); CheckDlgButton (hDlg, IDC_BLITIMM, workprefs.immediate_blits); - CheckDlgButton (hDlg, IDC_FASTERRTG, workprefs.picasso96_nocustom); CheckRadioButton (hDlg, IDC_COLLISION0, IDC_COLLISION3, IDC_COLLISION0 + workprefs.collision_level); CheckDlgButton (hDlg, IDC_CYCLEEXACT, workprefs.cpu_cycle_exact); switch (workprefs.produce_sound) { @@ -5216,7 +5215,6 @@ static void values_from_chipsetdlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l workprefs.genlock = IsDlgButtonChecked (hDlg, IDC_GENLOCK); workprefs.immediate_blits = IsDlgButtonChecked (hDlg, IDC_BLITIMM); - workprefs.picasso96_nocustom = IsDlgButtonChecked (hDlg, IDC_FASTERRTG); n = IsDlgButtonChecked (hDlg, IDC_CYCLEEXACT) ? 1 : 0; if (workprefs.cpu_cycle_exact != n) { workprefs.cpu_cycle_exact = workprefs.blitter_cycle_exact = n; @@ -5836,24 +5834,18 @@ static void expansion_net (HWND hDlg) static void enable_for_expansiondlg (HWND hDlg) { - int cw; + int cw, en; + en = !!full_property_sheet; cw = catweasel_detect (); - ew (hDlg, IDC_CATWEASEL, cw); - if (!full_property_sheet) { - ew (hDlg, IDC_SOCKETS, FALSE); - ew (hDlg, IDC_SCSIDEVICE, FALSE); - ew (hDlg, IDC_CATWEASEL, FALSE); - ew (hDlg, IDC_NETDEVICE, FALSE); - } else { -#if !defined (BSDSOCKET) - ew (hDlg, IDC_SOCKETS, FALSE); -#endif -#if !defined (SCSIEMU) - ew (hDlg, IDC_SCSIDEVICE, FALSE); -#endif - ew (hDlg, IDC_NETDEVICE, workprefs.a2065name[0]); - } + ew (hDlg, IDC_CATWEASEL, cw && en); + ew (hDlg, IDC_SOCKETS, en); + ew (hDlg, IDC_SCSIDEVICE, en); + ew (hDlg, IDC_CATWEASEL, en); + ew (hDlg, IDC_NETDEVICE, en); + ew (hDlg, IDC_SANA2, en); + ew (hDlg, IDC_A2065, en); + ew (hDlg, IDC_NETDEVICE, en && workprefs.a2065name[0]); } static void values_to_expansiondlg (HWND hDlg) @@ -5971,6 +5963,9 @@ static INT_PTR CALLBACK ExpansionDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP // workprefs.leds_on_screen |= STATUSLINE_RTG; // break; + case IDC_SOCKETS: + workprefs.socket_emu = IsDlgButtonChecked (hDlg, IDC_SOCKETS); + break; case IDC_SCSIDEVICE: workprefs.scsi = IsDlgButtonChecked (hDlg, IDC_SCSIDEVICE) ? 1 : 0; enable_for_expansiondlg (hDlg); @@ -6553,6 +6548,7 @@ static void values_to_miscdlg (HWND hDlg) CheckDlgButton (hDlg, IDC_CLOCKSYNC, workprefs.tod_hack); CheckDlgButton (hDlg, IDC_POWERSAVE, workprefs.win32_powersavedisabled); CheckDlgButton (hDlg, IDC_STATE_CAPTURE, workprefs.statecapture); + CheckDlgButton (hDlg, IDC_FASTERRTG, workprefs.picasso96_nocustom); misc_kbled (hDlg, IDC_KBLED1, workprefs.keyboard_leds[0]); misc_kbled (hDlg, IDC_KBLED2, workprefs.keyboard_leds[1]); @@ -6726,9 +6722,6 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) workprefs.statecapture = IsDlgButtonChecked (hDlg, IDC_STATE_CAPTURE); enable_for_miscdlg (hDlg); break; - case IDC_SOCKETS: - workprefs.socket_emu = IsDlgButtonChecked (hDlg, IDC_SOCKETS); - break; case IDC_ILLEGAL: workprefs.illegal_mem = IsDlgButtonChecked (hDlg, IDC_ILLEGAL); break; @@ -6783,6 +6776,9 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) case IDC_KBLED_USB: workprefs.win32_kbledmode = IsDlgButtonChecked (hDlg, IDC_KBLED_USB) ? 1 : 0; break; + case IDC_FASTERRTG: + workprefs.picasso96_nocustom = IsDlgButtonChecked (hDlg, IDC_FASTERRTG); + break; } recursive--; return TRUE; diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 6746c2c2..0d52eff8 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,16 @@ +Beta 16: + +- Faster RTG moved to misc panel +- TD_REMOVE implemented in uaescsi.device (BabelCDRomFS media changes + work under KS 1.3) and in uaehf.device +- bsdsocket GUI checkbox didn't work +- delay copper writes by 2 lores pixels if hpos >= 0xe0 (I am not sure + 100% why but I guess extra 0.5 cycle in PAL 227.5 color clock + horizontal timing causes this) Fixes Leander "border", can fix other + similar border problems. Previous fix in b15 was wrong. +- CE linemode blitter non-nasty broke in b14 + Beta 15: - automatically enable ini-mode if registry initialization fails diff --git a/scsiemul.c b/scsiemul.c index ee3d7cce..a604954b 100644 --- a/scsiemul.c +++ b/scsiemul.c @@ -54,6 +54,7 @@ struct devstruct { volatile int d_request_type[MAX_ASYNC_REQUESTS]; volatile uae_u32 d_request_data[MAX_ASYNC_REQUESTS]; struct device_info di; + uaecptr changeint; smp_comm_pipe requests; int thread_running; @@ -283,6 +284,8 @@ void scsi_do_disk_change (int device_id, int insert) } j++; } + if (dev->changeint) + uae_Cause (dev->changeint); } } uae_sem_post (&change_sem); @@ -371,6 +374,7 @@ static int command_read (int mode, struct devstruct *dev, uaecptr data, uae_u64 } return 0; } + static int command_write (int mode, struct devstruct *dev, uaecptr data, uae_u64 offset, uae_u32 length, uae_u32 *io_actual) { uae_u32 blocksize = dev->di.bytespersector; @@ -537,6 +541,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request) io_actual = 0; break; case CMD_REMOVE: + dev->changeint = io_data; io_actual = 0; break; case CMD_CHANGENUM: -- 2.47.3