From: Toni Wilen Date: Sat, 23 Nov 2013 18:21:23 +0000 (+0200) Subject: 2700b15 X-Git-Tag: 2700~2 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=b7c748cc4fa2fc7662409579f4f554e393ff74c1;p=francis%2Fwinuae.git 2700b15 --- diff --git a/custom.cpp b/custom.cpp index 4ee14c2e..01d767c6 100644 --- a/custom.cpp +++ b/custom.cpp @@ -65,7 +65,7 @@ #define CUSTOM_DEBUG 0 #define SPRITE_DEBUG 0 #define SPRITE_DEBUG_MINY 0x0 -#define SPRITE_DEBUG_MAXY 0x100 +#define SPRITE_DEBUG_MAXY 0x300 #define SPR0_HPOS 0x15 #define MAX_SPRITES 8 #define SPRITE_COLLISIONS @@ -980,7 +980,7 @@ STATIC_INLINE int is_bitplane_dma_inline (int hpos) return curr_diagram[(hpos - cycle_diagram_shift) & fetchstart_mask]; } -static void update_denise (int hpos) +STATIC_INLINE void update_denise (int hpos) { toscr_res = GET_RES_DENISE (bplcon0d); if (bplcon0dd != bplcon0d) { @@ -1490,7 +1490,8 @@ STATIC_INLINE void beginning_of_plane_block (int hpos, int fm) #endif update_denise (hpos); - update_toscr_planes (fm); + if (toscr_nr_planes_agnus > thisline_decision.nr_planes) + update_toscr_planes (fm); maybe_first_bpl1dat (hpos); bplcon1t2 = bplcon1t; @@ -3273,11 +3274,11 @@ void compute_framesync (void) if (vres2 > VRES_QUAD) vres2 = VRES_QUAD; - int start = hbstrt; - int stop = hbstop; + int start = hsyncstartpos; //hbstrt; + int stop = hsyncendpos; //hbstop; - gfxvidinfo.drawbuffer.inwidth = (((start > stop ? (maxhpos - (maxhpos - start + stop)) : (maxhpos - (stop - start) + 2)) * 2) << res2); - gfxvidinfo.drawbuffer.inxoffset = ((stop + 1) & ~1) * 2; + gfxvidinfo.drawbuffer.inwidth = ((maxhpos - (maxhpos - start + stop) + 1) * 2) << res2; + gfxvidinfo.drawbuffer.inxoffset = stop * 2; gfxvidinfo.drawbuffer.extrawidth = 0; gfxvidinfo.drawbuffer.inwidth2 = gfxvidinfo.drawbuffer.inwidth; @@ -3451,13 +3452,15 @@ void init_hz (bool fullinit) maxhpos_short = maxhpos; if (beamcon0 & 0x80) { if (hbstrt > maxhpos) - hsyncstartpos = hbstrt; + hsyncstartpos = hbstrt + 1; else - hsyncstartpos = maxhpos + hbstrt; + hsyncstartpos = maxhpos + hbstrt + 1; if (hbstop > maxhpos) - hsyncendpos = maxhpos - hbstop; + hsyncendpos = maxhpos - hbstop - 1; else - hsyncendpos = hbstop; + hsyncendpos = hbstop - 1; + if (hsyncendpos < 2) + hsyncendpos = 2; } else { hsyncstartpos = maxhpos_short + 13; hsyncendpos = 24; @@ -3950,6 +3953,15 @@ static void DMACON (int hpos, uae_u16 v) int newbn = (dmacon & DMA_BLITPRI); #endif +#if SPRITE_DEBUG > 0 + { + int olds = (oldcon & DMA_SPRITE) && (oldcon & DMA_MASTER); + int news = (dmacon & DMA_SPRITE) && (dmacon & DMA_MASTER); + if (olds != news) + write_log (_T("SPRITE DMA: %d -> %d\n"), olds, news); + } +#endif + if ((dmacon & DMA_BLITPRI) > (oldcon & DMA_BLITPRI) && bltstate != BLT_done) set_special (SPCFLAG_BLTNASTY); @@ -4594,6 +4606,10 @@ static void BLTSIZH (int hpos, uae_u16 v) STATIC_INLINE void spr_arm (int num, int state) { +#if SPRITE_DEBUG > 0 + if (spr[num].armed != state) + write_log (_T("SPR%d ARM=%d\n"), num, state); +#endif switch (state) { case 0: nr_armed -= spr[num].armed; @@ -4608,6 +4624,8 @@ STATIC_INLINE void spr_arm (int num, int state) STATIC_INLINE void sprstartstop (struct sprite *s) { + if (vpos < sprite_vblank_endline) + return; if (vpos == s->vstart) s->dmastate = 1; if (vpos == s->vstop) @@ -4947,7 +4965,7 @@ STATIC_INLINE int copper_cant_read2 (int hpos, int alloc) static int copper_cant_read (int hpos, int alloc) { int cant = copper_cant_read2 (hpos, alloc); - if (cant && debug_dma) + if (cant && debug_dma && alloc) record_dma_event (DMA_EVENT_COPPERWANTED, hpos, vpos); return cant; } @@ -5211,7 +5229,7 @@ static void update_copper (int until_hpos) } #ifdef DEBUGGER if (debug_copper && !cop_state.ignore_next) - record_copper (debugip - 4, old_hpos, vpos); + record_copper (debugip - 4, cop_state.saved_i1, cop_state.saved_i2, old_hpos, vpos); #endif cop_state.ignore_next = 0; } @@ -5283,16 +5301,15 @@ static void update_copper (int until_hpos) copper_enabled_thisline = 0; unset_special (SPCFLAG_COPPER); goto out; - } else { - if (debug_dma) - record_dma_event (DMA_EVENT_COPPERWAKE, old_hpos, vp); } } + if (debug_dma) + record_dma_event (DMA_EVENT_COPPERWAKE, old_hpos, vp); - #ifdef DEBUGGER +#ifdef DEBUGGER if (debug_copper) - record_copper (cop_state.ip - 4, old_hpos, vpos); - #endif + record_copper (cop_state.ip - 4, cop_state.saved_i1, cop_state.saved_i2, old_hpos, vpos); +#endif cop_state.state = COP_read1; } @@ -5320,7 +5337,7 @@ static void update_copper (int until_hpos) #ifdef DEBUGGER if (debug_copper) - record_copper (cop_state.ip - 4, old_hpos, vpos); + record_copper (cop_state.ip - 4, cop_state.saved_i1, cop_state.saved_i2, old_hpos, vpos); #endif break; @@ -5391,8 +5408,13 @@ void blitter_done_notify (int hpos) cop_state.hpos = hpos; cop_state.vpos = vp; cop_state.state = COP_read1; + +#ifdef DEBUGGER if (debug_dma) record_dma_event (DMA_EVENT_COPPERWAKE, hpos, vp); + if (debug_copper) + record_copper_blitwait (cop_state.ip - 4, hpos, vp); +#endif if (dmaen (DMA_COPPER) && vp == vpos) { copper_enabled_thisline = 1; @@ -7058,6 +7080,8 @@ void custom_reset (bool hardreset, bool keyboardreset) lightpen_active = -1; lightpen_triggered = 0; lightpen_cx = lightpen_cy = -1; + nr_armed = 0; + if (!savestate_state) { extra_cycle = 0; hsync_counter = 0; @@ -7082,7 +7106,6 @@ void custom_reset (bool hardreset, bool keyboardreset) /* Clear the armed flags of all sprites. */ memset (spr, 0, sizeof spr); - nr_armed = 0; dmacon = 0; intreq_internal = 0; @@ -7109,6 +7132,7 @@ void custom_reset (bool hardreset, bool keyboardreset) blit_interrupt = 1; lof_store = lof_current = 0; lof_lace = false; + init_sprites (); } gayle_reset (hardreset); @@ -7166,8 +7190,6 @@ void custom_reset (bool hardreset, bool keyboardreset) audio_update_adkmasks (); } - init_sprites (); - init_hardware_frame (); drawing_init (); @@ -7211,6 +7233,14 @@ void custom_reset (bool hardreset, bool keyboardreset) CLXCON (clxcon); CLXCON2 (clxcon2); calcdiw (); + for (i = 0; i < 8; i++) { + SPRxCTLPOS (i); + nr_armed += spr[i].armed != 0; + } + if (! currprefs.produce_sound) { + eventtab[ev_audio].active = 0; + events_schedule (); + } write_log (_T("CPU=%d Chipset=%s %s\n"), currprefs.cpu_model, (currprefs.chipset_mask & CSMASK_AGA) ? _T("AGA") : @@ -7219,12 +7249,6 @@ void custom_reset (bool hardreset, bool keyboardreset) (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? _T("ECS") : _T("OCS"), currprefs.ntscmode ? _T("NTSC") : _T("PAL")); write_log (_T("State restored\n")); - for (i = 0; i < 8; i++) - nr_armed += spr[i].armed != 0; - if (! currprefs.produce_sound) { - eventtab[ev_audio].active = 0; - events_schedule (); - } } sprres = expand_sprres (bplcon0, bplcon3); sprite_width = GET_SPRITEWIDTH (fmode); @@ -8173,7 +8197,7 @@ uae_u8 *restore_custom_sprite (int num, uae_u8 *src) sprdatb[num][2] = RW; sprdata[num][3] = RW; sprdatb[num][3] = RW; - spr[num].armed = RB; + spr[num].armed = RB & 1; return src; } @@ -8661,9 +8685,6 @@ void wait_cpu_cycle_write_ce020 (uaecptr addr, int mode, uae_u32 v) void do_cycles_ce (unsigned long cycles) { - unsigned long c; - - c = cycles + extra_cycle; while (cycles >= CYCLE_UNIT) { int hpos = current_hpos () + 1; decide_line (hpos); @@ -8674,7 +8695,6 @@ void do_cycles_ce (unsigned long cycles) do_cycles (1 * CYCLE_UNIT); cycles -= CYCLE_UNIT; } - extra_cycle = c; } void do_cycles_ce020 (unsigned long cycles) diff --git a/debug.cpp b/debug.cpp index 4cff87dd..f896c939 100644 --- a/debug.cpp +++ b/debug.cpp @@ -948,7 +948,7 @@ static void disassemble_wait (FILE *file, unsigned long insn) console_out (_T(", ignore horizontal")); } - console_out_f (_T("\n \t; VP %02x, VE %02x; HP %02x, HE %02x; BFD %d\n"), + console_out_f (_T("\n \t; VP %02x, VE %02x; HP %02x, HE %02x; BFD %d\n"), vp, ve, hp, he, bfd); } @@ -956,7 +956,9 @@ static void disassemble_wait (FILE *file, unsigned long insn) /* Record copper activity for the debugger. */ struct cop_rec { + uae_u16 w1, w2; int hpos, vpos; + int bhpos, bvpos; uaecptr addr; }; static struct cop_rec *cop_record[2]; @@ -1258,7 +1260,14 @@ void log_dma_record (void) decode_dma_record (0, 0, 0, true); } -void record_copper (uaecptr addr, int hpos, int vpos) +void record_copper_blitwait (uaecptr addr, int hpos, int vpos) +{ + int t = nr_cop_records[curr_cop_set] - 1; + cop_record[curr_cop_set][t].bhpos = hpos; + cop_record[curr_cop_set][t].bvpos = vpos; +} + +void record_copper (uaecptr addr, uae_u16 word1, uae_u16 word2, int hpos, int vpos) { int t = nr_cop_records[curr_cop_set]; if (!cop_record[0]) { @@ -1267,8 +1276,11 @@ void record_copper (uaecptr addr, int hpos, int vpos) } if (t < NR_COPPER_RECORDS) { cop_record[curr_cop_set][t].addr = addr; + cop_record[curr_cop_set][t].w1 = word1; + cop_record[curr_cop_set][t].w2 = word2; cop_record[curr_cop_set][t].hpos = hpos; cop_record[curr_cop_set][t].vpos = vpos; + cop_record[curr_cop_set][t].bvpos = -1; nr_cop_records[curr_cop_set] = t + 1; } if (debug_copper & 2) { /* trace */ @@ -1294,21 +1306,26 @@ static struct cop_rec *find_copper_records (uaecptr addr) } /* simple decode copper by Mark Cox */ -static void decode_copper_insn (FILE* file, unsigned long insn, unsigned long addr) +static void decode_copper_insn (FILE* file, uae_u16 mword1, uae_u16 mword2, unsigned long addr) { struct cop_rec *cr = NULL; - uae_u32 insn_type = insn & 0x00010001; + uae_u32 insn_type, insn; TCHAR here = ' '; TCHAR record[] = _T(" "); if ((cr = find_copper_records (addr))) { _stprintf (record, _T(" [%03x %03x]"), cr->vpos, cr->hpos); + insn = (cr->w1 << 16) | cr->w2; + } else { + insn = (mword1 << 16) | mword2; } + insn_type = insn & 0x00010001; + if (get_copper_address (-1) >= addr && get_copper_address(-1) <= addr + 3) here = '*'; - console_out_f (_T("%c%08lx: %04lx %04lx%s\t; "), here, addr, insn >> 16, insn & 0xFFFF, record); + console_out_f (_T("%c%08lx: %04lx %04lx%s\t;%c "), here, addr, insn >> 16, insn & 0xFFFF, record, insn != ((mword1 << 16) | mword2) ? '!' : ' '); switch (insn_type) { case 0x00010000: /* WAIT insn */ @@ -1316,7 +1333,7 @@ static void decode_copper_insn (FILE* file, unsigned long insn, unsigned long ad disassemble_wait (file, insn); if (insn == 0xfffffffe) - console_out (_T(" \t; End of Copperlist\n")); + console_out (_T(" \t; End of Copperlist\n")); break; @@ -1346,14 +1363,16 @@ static void decode_copper_insn (FILE* file, unsigned long insn, unsigned long ad abort (); } + if (cr && cr->bvpos >= 0) { + console_out_f (_T(" BLT [%03x %03x]\n"), cr->bvpos, cr->bhpos); + } } static uaecptr decode_copperlist (FILE* file, uaecptr address, int nolines) { uae_u32 insn; while (nolines-- > 0) { - insn = (chipmem_wget_indirect (address) << 16) | chipmem_wget_indirect (address + 2); - decode_copper_insn (file, insn, address); + decode_copper_insn (file, chipmem_wget_indirect (address), chipmem_wget_indirect (address + 2), address); address += 4; } return address; diff --git a/drawing.cpp b/drawing.cpp index ae3c8442..2af4acf8 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -3147,7 +3147,7 @@ void hsync_record_line_state (int lineno, enum nln_how how, int changed) case nln_upper_black: if (currprefs.gfx_scanlines >= 4) { *state = LINE_DECIDED; - state[1] = LINE_BLACK; + state[-1] = LINE_BLACK; } else { changed += state[0] != LINE_DONE; *state = changed ? LINE_DECIDED : LINE_DONE; diff --git a/expansion.cpp b/expansion.cpp index 59b1d25c..5df8c53a 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -1070,7 +1070,9 @@ static void allocate_expamem (void) currprefs.z3chipmem_size = changed_prefs.z3chipmem_size; z3chipmem_bank.start = currprefs.z3fastmem_start; - z3fastmem_bank.start = currprefs.z3fastmem_start; + if (currprefs.mbresmem_high_size == 128 * 1024 * 1024) + z3chipmem_bank.start += 16 * 1024 * 1024; + z3fastmem_bank.start = z3chipmem_bank.start; if (currprefs.z3chipmem_size) z3fastmem_bank.start += currprefs.z3chipmem_size + 16 * 1024 * 1024; z3fastmem2_bank.start = z3fastmem_bank.start + currprefs.z3fastmem_size; diff --git a/include/debug.h b/include/debug.h index 98b8307b..6447ec76 100644 --- a/include/debug.h +++ b/include/debug.h @@ -28,7 +28,8 @@ extern void activate_debugger (void); extern void deactivate_debugger (void); extern int notinrom (void); extern const TCHAR *debuginfo (int); -extern void record_copper (uaecptr addr, int hpos, int vpos); +extern void record_copper (uaecptr addr, uae_u16 word1, uae_u16 word2, int hpos, int vpos); +extern void record_copper_blitwait (uaecptr addr, int hpos, int vpos); extern void record_copper_reset (void); extern int mmu_init (int, uaecptr,uaecptr); extern void mmu_do_hit (void); diff --git a/main.cpp b/main.cpp index 99ee5293..4bdff6fc 100644 --- a/main.cpp +++ b/main.cpp @@ -280,6 +280,8 @@ void fixup_cpu (struct uae_prefs *p) error_log (_T("Immediate blitter and waiting blits can't be enabled simultaneously.\n")); p->waiting_blits = 0; } + if (p->cpu_cycle_exact) + p->cpu_compatible = true; } void fixup_prefs (struct uae_prefs *p) diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index a02c2af7..c00076ae 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -737,9 +737,11 @@ static void picasso_handle_vsync2 (void) bool rendered = false; bool uaegfx = currprefs.rtgmem_type < GFXBOARD_HARDWARE; - if (vsync < 0) { - vsync_busywait_end (NULL); - vsync_busywait_do (NULL, false, false); + if (picasso_on) { + if (vsync < 0) { + vsync_busywait_end (NULL); + vsync_busywait_do (NULL, false, false); + } } getvsyncrate (currprefs.chipset_refreshrate, &mult); @@ -752,6 +754,15 @@ static void picasso_handle_vsync2 (void) } framecnt++; + + if (!uaegfx && !picasso_on) { + rtg_render (); + return; + } + + if (!picasso_on) + return; + if (uaegfx) mouseupdate (); diff --git a/od-win32/win32.h b/od-win32/win32.h index fe454f80..53371400 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -19,11 +19,11 @@ #define LANG_DLL 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("14") +#define WINUAEBETA _T("15") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2013, 11, 20) +#define WINUAEDATE MAKEBD(2013, 11, 23) #define WINUAEEXTRA _T("") //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 88677a78..68387ac9 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -115,7 +115,7 @@ static wstring szNone; static int allow_quit; static int restart_requested; -static int full_property_sheet = 1; +int full_property_sheet = 1; static struct uae_prefs *pguiprefs; struct uae_prefs workprefs; static int currentpage = -1; @@ -10412,7 +10412,7 @@ static void new_filesys (HWND hDlg, int entry) if (uci) { if (uci->ci.rootdir[0]) filesys_media_change (uci->ci.rootdir, 1, uci); - else + else if (uci->configoffset >= 0) filesys_eject (uci->configoffset); } } diff --git a/od-win32/win32gui_extra.cpp b/od-win32/win32gui_extra.cpp index a4c14696..8b810b52 100644 --- a/od-win32/win32gui_extra.cpp +++ b/od-win32/win32gui_extra.cpp @@ -208,6 +208,8 @@ static INT_PTR CALLBACK DummyProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP return FALSE; } +extern int full_property_sheet; + struct newresource *scaleresource (struct newresource *res, HWND parent, int resize) { DLGTEMPLATEEX *d, *s; @@ -244,7 +246,7 @@ struct newresource *scaleresource (struct newresource *res, HWND parent, int res d->style |= DS_MODALFRAME; d->style &= ~WS_THICKFRAME; } - if (isfullscreen () <= 0) + if (full_property_sheet) d->style |= WS_MINIMIZEBOX; d2 = (DLGTEMPLATEEX_END*)ns->resource; diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index a2ca7f29..2bfe786f 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -2,6 +2,23 @@ - restore only single input target to default. +Beta 14: + +- GUI didn't work in fullscreen modes. +- Input panel lost all keyboard events (not even Test button accepted any key presses) in some situations, + already non-working config files can't be fixed. Older bug. +- New frames interlace mode (without blacklines) now only redraws changed lines. +- 68040 without FPU: unimplemented FPU exception used wrong exception vector. +- 68020+ DIVL div-by-zero exception in cycle-exact mode didn't skip prefetch phase. +- Do not set lightpen triggered state when BPLCON0 lightpen bit is set unless lightpen is also configured + in gameports or input panel. +- Fixed crash if disabled keyboard had (old) gameport mappings. +- Autoscale size change comparison used wrong value (width, not height) causing slow down, forced config + change check every frame. +- Added configurable directory filesystem file/directory name length limit, currently config file only, + filesys_max_name_length=x, files and dirs with longer names are not seen in Amiga-side (directory operations only) +- Really fixed sound sync timing issue, partly introduced in b1 and b13. + Beta 13: - Standard partition hardfile OFS filesystem check was broken (2.6.1)