From 0088b1c0855ecaa0eb054e4afda8680bcf52a2da Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 28 Aug 2016 17:05:28 +0300 Subject: [PATCH] 3400b3 --- cfgfile.cpp | 17 ++++++++++------- custom.cpp | 20 +++++++++++--------- ethernet.cpp | 1 + expansion.cpp | 7 ++++++- gfxboard.cpp | 4 ++-- include/autoconf.h | 2 +- main.cpp | 1 + od-win32/picasso96_win.cpp | 32 +++++++++++++++----------------- od-win32/win32.h | 4 ++-- od-win32/win32gui.cpp | 31 +++++++++++++++++++++---------- od-win32/winuaechangelog.txt | 16 ++++++++++++++++ pci.cpp | 6 +++--- qemuvga/es1370.cpp | 2 +- sndboard.cpp | 14 ++++++++++---- statusline.cpp | 26 ++++++++++++++------------ 15 files changed, 114 insertions(+), 69 deletions(-) diff --git a/cfgfile.cpp b/cfgfile.cpp index 930d9db8..1963f7d9 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -1913,12 +1913,15 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) } s[_tcslen (s) - 1] = 0; } - if (i == CHIPSET_REFRESH_PAL) - cfgfile_dwrite (f, _T("displaydata_pal"), tmp); - else if (i == CHIPSET_REFRESH_NTSC) - cfgfile_dwrite (f, _T("displaydata_ntsc"), tmp); - else + if (i == CHIPSET_REFRESH_PAL) { + if (cr->locked) + cfgfile_dwrite (f, _T("displaydata_pal"), tmp); + } else if (i == CHIPSET_REFRESH_NTSC) { + if (cr->locked) + cfgfile_dwrite (f, _T("displaydata_ntsc"), tmp); + } else { cfgfile_dwrite (f, _T("displaydata"), tmp); + } } cfgfile_write_str (f, _T("collision_level"), collmode[p->collision_level]); @@ -3532,12 +3535,12 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) if (_tcscmp (option, _T("displaydata_pal")) == 0) { i = CHIPSET_REFRESH_PAL; cr = &p->cr[i]; - cr->rate = -1; + cr->inuse = false; _tcscpy (label, _T("PAL")); } else if (_tcscmp (option, _T("displaydata_ntsc")) == 0) { i = CHIPSET_REFRESH_NTSC; cr = &p->cr[i]; - cr->rate = -1; + cr->inuse = false; _tcscpy (label, _T("NTSC")); } if (!cr->inuse) { diff --git a/custom.cpp b/custom.cpp index 77feaef9..5122c3b9 100644 --- a/custom.cpp +++ b/custom.cpp @@ -2218,13 +2218,14 @@ static void reset_bpl_vars(void) /* check special case where last fetch wraps to next line * this makes totally corrupted and flickering display on * real hardware due to refresh cycle conflicts + * Exception: AGA + 64 bit fetch: glitch free overrun is possible. */ static void maybe_finish_last_fetch (int pos, int fm) { if (plf_state > plf_passed_stop2 || plf_state < plf_passed_stop || (fetch_state != fetch_started && fetch_state != fetch_started_first) || !dmaen (DMA_BITPLANE)) { finish_last_fetch (pos, fm, true); } else { - bitplane_overrun_fetch_cycle = fetch_cycle; + bitplane_overrun_fetch_cycle = fetch_cycle - 1; int cycle_start = bitplane_overrun_fetch_cycle & fetchstart_mask; int left = fetchunit - cycle_start; if (plf_state == plf_passed_stop_act) { @@ -2299,8 +2300,13 @@ static void do_overrun_fetch(int until, int fm) } break; } + #if 0 if (bpl0) { + bpl1dat_written = true; + bpl1dat_written_at_least_once = true; + if (thisline_decision.plfleft < 0) + reset_bpl_vars(); maybe_first_bpl1dat(pos); beginning_of_plane_block(pos, fm); } @@ -2312,12 +2318,6 @@ static void do_overrun_fetch(int until, int fm) } if (toscr_nbits == 16) flush_display(fm); - if (bpl0) { - bpl1dat_written = true; - bpl1dat_written_at_least_once = true; - reset_bpl_vars(); - beginning_of_plane_block(pos, fetchmode); - } #endif if ((bitplane_overrun_fetch_cycle & fetchunit_mask) == 0) { @@ -7618,6 +7618,8 @@ static void vsync_handler_pre (void) } } } + if (regs.halted < 0) + reset_cpu_idle(); cpu_last_stop_vpos = 0; cpu_stopped_lines = 0; #endif @@ -8341,8 +8343,8 @@ static void hsync_handler_post (bool onvsync) maybe_process_pull_audio(); } } - if (vpos + 1 < maxvpos + lof_store && vpos >= nextwaitvpos && (audio_is_pull() <= 0 || (audio_is_pull() > 0 && audio_pull_buffer()))) { - nextwaitvpos += maxvpos_display * 1 / 4; + if (vpos + 1 < maxvpos + lof_store && vpos >= nextwaitvpos && vpos < maxvpos - (maxvpos / 3) && (audio_is_pull() <= 0 || (audio_is_pull() > 0 && audio_pull_buffer()))) { + nextwaitvpos += maxvpos_display * 1 / 3; vsyncmintime += vsynctimeperline; if (!vsync_isdone () && !currprefs.turbo_emulation) { frame_time_t rpt = read_processor_time (); diff --git a/ethernet.cpp b/ethernet.cpp index 40689f35..e05ee12b 100644 --- a/ethernet.cpp +++ b/ethernet.cpp @@ -197,6 +197,7 @@ bool ethernet_enumerate (struct netdriverdata **nddp, const TCHAR *name) { int j; struct netdriverdata *nd; + gui_flicker_led(LED_NET, 0, 0); if (name) { netmode = 0; *nddp = NULL; diff --git a/expansion.cpp b/expansion.cpp index 3cb7fa24..c7337451 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -2518,6 +2518,8 @@ bool expansion_can_move(struct uae_prefs *p, int index) if (index < 0 || index >= cardno) return false; struct card_data *cd = cards[index]; + if (cd->aci.parent_of_previous) + return false; int order1 = get_order(p, cd); if (order1 < 0 || order1 >= EXPANSION_ORDER_MAX - 1) return false; @@ -2675,7 +2677,7 @@ static void expansion_parse_cards(struct uae_prefs *p, bool log) write_log(_T("END\n")); } -int expansion_autoconfig_move(struct uae_prefs *p, int index, int dir) +int expansion_autoconfig_move(struct uae_prefs *p, int index, int dir, bool test) { if (index < 0 || index >= cardno) return -1; @@ -2700,6 +2702,9 @@ int expansion_autoconfig_move(struct uae_prefs *p, int index, int dir) } dir += dir < 0 ? -1 : 1; } + if (test) { + return 0; + } set_order(p, cd1, order2); set_order(p, cd2, order1); if (p != &currprefs) diff --git a/gfxboard.cpp b/gfxboard.cpp index 86eeb7cf..8042268e 100644 --- a/gfxboard.cpp +++ b/gfxboard.cpp @@ -674,8 +674,8 @@ bool gfxboard_vsync_handler (void) write_log(_T("GFXBOARD %d ACTIVE=%d\n"), i, gb->monswitch_current); if (gb->monswitch_current) { if (!gfxboard_rtg_enable_initial(i)) { - // Nothing visible and RTG on? Re-enable our display. - if (rtg_visible < 0 && picasso_on) { + // Nothing visible? Re-enable our display. + if (rtg_visible < 0) { gfxboard_toggle(i, 0); } } diff --git a/include/autoconf.h b/include/autoconf.h index c7c9e152..a48d97d7 100644 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -152,7 +152,7 @@ extern struct autoconfig_info *expansion_get_autoconfig_info(struct uae_prefs*, extern struct autoconfig_info *expansion_get_autoconfig_data(struct uae_prefs *p, int index); extern struct autoconfig_info *expansion_get_autoconfig_by_address(struct uae_prefs *p, uaecptr addr); extern void expansion_set_autoconfig_sort(struct uae_prefs *p); -extern int expansion_autoconfig_move(struct uae_prefs *p, int index, int direction); +extern int expansion_autoconfig_move(struct uae_prefs *p, int index, int direction, bool test); extern bool expansion_can_move(struct uae_prefs *p, int index); extern bool alloc_expansion_bank(addrbank *bank, struct autoconfig_info *aci); extern void free_expansion_bank(addrbank *bank); diff --git a/main.cpp b/main.cpp index c0b460d1..346e2bb9 100644 --- a/main.cpp +++ b/main.cpp @@ -1076,6 +1076,7 @@ static int real_main2 (int argc, TCHAR **argv) memset (&gui_data, 0, sizeof gui_data); gui_data.cd = -1; gui_data.hd = -1; + gui_data.net = -1; gui_data.md = (currprefs.cs_cd32nvram || currprefs.cs_cdtvram) ? 0 : -1; logging_init (); /* Yes, we call this twice - the first case handles when the user has loaded a config using the cmd-line. This case handles loads through the GUI. */ diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index a3cecf5b..ed91e38b 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -742,7 +742,7 @@ void picasso_trigger_vblank(void) static bool rtg_render (void) { bool flushed = false; - bool uaegfx = currprefs.rtgboards[rtg_index].rtgmem_type < GFXBOARD_HARDWARE; + bool uaegfx = currprefs.rtgboards[0].rtgmem_type < GFXBOARD_HARDWARE && currprefs.rtgboards[0].rtgmem_size; if (doskip () && p96skipmode == 0) { ; @@ -991,7 +991,7 @@ static void picasso_handle_vsync2(void) int vsync = isvsync_rtg(); int mult; bool rendered = false; - bool uaegfx = currprefs.rtgboards[rtg_index].rtgmem_type < GFXBOARD_HARDWARE; + bool uaegfx = currprefs.rtgboards[0].rtgmem_type < GFXBOARD_HARDWARE; int state = picasso_state_change; if (state & PICASSO_STATE_SETDAC) { @@ -1053,7 +1053,7 @@ static void picasso_handle_vsync2(void) if (!picasso_on) return; - if (uaegfx) + if (uaegfx && rtg_index == 0) mouseupdate(); if (thisisvsync) { @@ -1062,7 +1062,7 @@ static void picasso_handle_vsync2(void) } if (uaegfx) { - if (setupcursor_needed) + if (setupcursor_needed && rtg_index == 0) setupcursor(); if (thisisvsync) picasso_trigger_vblank(); @@ -1080,16 +1080,15 @@ static int p96hsync; void picasso_handle_vsync(void) { - if (rtg_index < 0) - return; - - bool uaegfx = currprefs.rtgboards[rtg_index].rtgmem_type < GFXBOARD_HARDWARE; + bool uaegfx = currprefs.rtgboards[0].rtgmem_type < GFXBOARD_HARDWARE; - if (currprefs.rtgboards[rtg_index].rtgmem_size == 0) + if (currprefs.rtgboards[0].rtgmem_size == 0) return; if (!picasso_on && uaegfx) { - createwindowscursor(0, 0, 0, 0, 0, 1); + if (rtg_index == 0) { + createwindowscursor(0, 0, 0, 0, 0, 1); + } picasso_trigger_vblank(); return; } @@ -1105,12 +1104,9 @@ void picasso_handle_vsync(void) void picasso_handle_hsync(void) { - if (rtg_index < 0) - return; - - bool uaegfx = currprefs.rtgboards[rtg_index].rtgmem_type < GFXBOARD_HARDWARE; + bool uaegfx = currprefs.rtgboards[0].rtgmem_type < GFXBOARD_HARDWARE; - if (currprefs.rtgboards[rtg_index].rtgmem_size == 0) + if (currprefs.rtgboards[0].rtgmem_size == 0) return; int vsync = isvsync_rtg(); @@ -1131,7 +1127,9 @@ void picasso_handle_hsync(void) if (p96hsync >= p96syncrate) { if (!picasso_on) { if (uaegfx) { - createwindowscursor(0, 0, 0, 0, 0, 1); + if (rtg_index == 0) { + createwindowscursor(0, 0, 0, 0, 0, 1); + } picasso_trigger_vblank(); } } else { @@ -2640,7 +2638,7 @@ static uae_u32 REGPARAM2 picasso_SetColorArray (TrapContext *ctx) uae_u16 count = trap_get_dreg (ctx, 1); uaecptr boardinfo = trap_get_areg (ctx, 0); uaecptr clut = boardinfo + PSSO_BoardInfo_CLUT; - if (start > 256 || start + count > 256) + if (start > 256 || count > 256 || start + count > 256) return 0; if (updateclut(ctx, clut, start, count)) full_refresh = 1; diff --git a/od-win32/win32.h b/od-win32/win32.h index 0322db97..d5a80194 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -20,12 +20,12 @@ #define LANG_DLL_FULL_VERSION_MATCH 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("2") +#define WINUAEBETA _T("3") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2016, 8, 24) +#define WINUAEDATE MAKEBD(2016, 8, 28) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 93e9a13f..e0b78844 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -9864,6 +9864,22 @@ static LRESULT ProcesssBoardsDlgProcCustomDraw(LPARAM lParam) { } +static void BoardsEnable(HWND hDlg, int selected) +{ + bool move_up = expansion_can_move(&workprefs, selected); + bool move_down = move_up; + if (move_up) { + if (expansion_autoconfig_move(&workprefs, selected, -1, true) < 0) + move_up = false; + } + if (move_down) { + if (expansion_autoconfig_move(&workprefs, selected, 1, true) < 0) + move_down = false; + } + ew(hDlg, IDC_BOARDS_UP, move_up); + ew(hDlg, IDC_BOARDS_DOWN, move_down); +} + static INT_PTR CALLBACK BoardsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static int recursive = 0; @@ -9898,16 +9914,12 @@ static INT_PTR CALLBACK BoardsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM case IDC_BOARDS_UP: case IDC_BOARDS_DOWN: if (selected >= 0) { - int newpos = expansion_autoconfig_move(&workprefs, selected, LOWORD(wParam) == IDC_BOARDS_UP ? -1 : 1); + int newpos = expansion_autoconfig_move(&workprefs, selected, LOWORD(wParam) == IDC_BOARDS_UP ? -1 : 1, false); if (newpos >= 0) { selected = newpos; - - + BoardsEnable(hDlg, selected); InitializeListView(hDlg); - - ListView_SetItemState(cachedlist, selected, LVIS_SELECTED, LVIS_SELECTED); - } } break; @@ -9949,10 +9961,8 @@ static INT_PTR CALLBACK BoardsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM HWND list = nmlistview->hdr.hwndFrom; int entry = listview_entry_from_click(list, &column); if (entry >= 0) { - bool move = expansion_can_move(&workprefs, entry); selected = entry; - ew(hDlg, IDC_BOARDS_UP, move); - ew(hDlg, IDC_BOARDS_DOWN, move); + BoardsEnable(hDlg, selected); } } break; @@ -19740,7 +19750,8 @@ void gui_flicker_led (int led, int unitnum, int status) if (led < 0) { gui_flicker_led2(LED_HD, 0, 0); gui_flicker_led2(LED_CD, 0, 0); - gui_flicker_led2(LED_NET, 0, 0); + if (gui_data.net >= 0) + gui_flicker_led2(LED_NET, 0, 0); if (gui_data.md >= 0) gui_flicker_led2(LED_MD, 0, 0); } else { diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 1268530b..fffa2869 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,20 @@ +Beta 3: + +- PCI ES1370 fixed. +- (Missed from b1 log): CPU Idle logic has been completely changed, now it only has two states, inactive and active. + Active state changes internal CPU speed state to approximate and active equals fastest possible mode. + Old logic was never good enough. CPU usage was never low enough and it didn't prevent audio glitches. +- Another b1 missed log entry: conditional register breakpoints, break when any CPU register matches + (equals, smaller, larger, range). More information in debugger help. +- Do not use new CPU Idle mode in PPC-only configs. +- Low latency vsync really fixed. Can also fix other CPU usage related problems in other modes. +- Hardware info panel up/down button disable logic improved. +- Bitplane DMA overrun 1 cycle adjustment, now it matches real A1200 100%. Possible Disk/Audio/Sprite + DMA slot conflicts are not yet emulated. (Causes graphics glitches on real hardware) +- uaegfx vblank interrupt hang fixed. +- Network OSD led was invisible. + Beta 2: - Needed natmem space also included IO only Z3 boards but only RAM and VRAM boards should count. diff --git a/pci.cpp b/pci.cpp index 791722f8..c5f9c83d 100644 --- a/pci.cpp +++ b/pci.cpp @@ -1243,7 +1243,7 @@ void pci_read_dma(struct pci_board_state *pcibs, uaecptr addr, uae_u8 *p, int si } else { write_log(_T("pci_read_dma invalid address %08x, size %d\n"), addr, size); while (size > 0) { - *p++ = uaerand(); + *p++ = uaerand() >> 4; addr++; size--; } @@ -1473,13 +1473,13 @@ static void add_pci_devices(struct pci_bridge *pcib) pci_board_add(pcib, &ne2000_pci_board, slot++, 0); } - if (is_device_rom(&currprefs, ROMTYPE_FM801, 0) > 0) { + if (is_device_rom(&currprefs, ROMTYPE_FM801, 0) >= 0) { pci_board_add(pcib, &fm801_pci_board, slot, 0); pci_board_add(pcib, &fm801_pci_board_func1, slot, 1); slot++; } - if (is_device_rom(&currprefs, ROMTYPE_ES1370, 0) > 0) { + if (is_device_rom(&currprefs, ROMTYPE_ES1370, 0) >= 0) { pci_board_add(pcib, &es1370_pci_board, slot++, 0); } diff --git a/qemuvga/es1370.cpp b/qemuvga/es1370.cpp index f708d86d..e8806b29 100644 --- a/qemuvga/es1370.cpp +++ b/qemuvga/es1370.cpp @@ -1186,8 +1186,8 @@ static void es1370_free(struct pci_board_state *pcibs) static bool es1370_init(struct pci_board_state *pcibs) { init(pcibs); - es1370_reset(&es1370state); es1370state.irq_callback = pcibs->irq_callback; + es1370_reset(&es1370state); return true; } diff --git a/sndboard.cpp b/sndboard.cpp index c280c125..dee3873f 100644 --- a/sndboard.cpp +++ b/sndboard.cpp @@ -1882,7 +1882,11 @@ void AUD_set_active_out(SWVoiceOut *sw, int on) sw->samplebuf_index = 0; sw->samplebuf_total = 0; calculate_volume_qemu(); - sw->streamid = audio_enable_stream(sw->active, -1, 2); + audio_enable_stream(false, sw->streamid, 2); + sw->streamid = 0; + if (on) { + sw->streamid = audio_enable_stream(true, -1, 2); + } } void AUD_set_active_in(SWVoiceIn *sw, int on) { @@ -1894,9 +1898,11 @@ int AUD_is_active_in(SWVoiceIn *sw) void AUD_close_out(QEMUSoundCard *card, SWVoiceOut *sw) { qemu_voice_out = NULL; - audio_enable_stream(false, sw->streamid, 0); - sw->streamid = 0; - xfree(sw); + if (sw) { + audio_enable_stream(false, sw->streamid, 0); + sw->streamid = 0; + xfree(sw); + } } SWVoiceIn *AUD_open_in( QEMUSoundCard *card, diff --git a/statusline.cpp b/statusline.cpp index 9e96917d..483c5db5 100644 --- a/statusline.cpp +++ b/statusline.cpp @@ -243,19 +243,21 @@ void draw_status_line_single (uae_u8 *buf, int bpp, int y, int totalwidth, uae_u num3 = -1; } else if (led == LED_NET) { pos = 6; - on = gui_data.net; - on_rgb = 0; - if (on & 1) - on_rgb |= 0x00cc00; - if (on & 2) - on_rgb |= 0xcc0000; - off_rgb = 0x000000; - num1 = -1; - num2 = -1; - num3 = 17; - am = 1; + if (gui_data.net >= 0) { + on = gui_data.net; + on_rgb = 0; + if (on & 1) + on_rgb |= 0x00cc00; + if (on & 2) + on_rgb |= 0xcc0000; + off_rgb = 0x000000; + num1 = -1; + num2 = -1; + num3 = 17; + am = 1; + } } else { - return; + continue; } on_rgb |= 0x33000000; off_rgb |= 0x33000000; -- 2.47.3