From: Toni Wilen Date: Tue, 31 Aug 2010 15:26:27 +0000 (+0300) Subject: 2300b14 X-Git-Tag: 2300~7 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=de5c9b5646a901b0c51ed4f3aa2e471f3086e659;p=francis%2Fwinuae.git 2300b14 --- diff --git a/blkdev.cpp b/blkdev.cpp index 38573421..8c549f59 100644 --- a/blkdev.cpp +++ b/blkdev.cpp @@ -336,13 +336,16 @@ static int get_standard_cd_unit2 (cd_standard_unit csu) int unitnum = 0; int isaudio = 0; if (currprefs.cdslots[unitnum].name[0] || currprefs.cdslots[unitnum].inuse) { - device_func_init (SCSI_UNIT_IOCTL); - if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu)) { - device_func_init (SCSI_UNIT_IMAGE); - if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu)) - goto fallback; + if (currprefs.cdslots[unitnum].name[0]) { + device_func_init (SCSI_UNIT_IOCTL); + if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu)) { + device_func_init (SCSI_UNIT_IMAGE); + if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu)) + goto fallback; + } + } else { + goto fallback; } - getunitinfo (unitnum, 0, csu, &isaudio); return unitnum; } device_func_init (SCSI_UNIT_IOCTL); diff --git a/disk.cpp b/disk.cpp index 1c7c0343..e80be580 100644 --- a/disk.cpp +++ b/disk.cpp @@ -633,7 +633,7 @@ static void reset_drive (int num) static void update_drive_gui (int num) { drive *drv = floppy + num; - bool writ = dskdmaen == 3 && drv->state && !(selected & (1 << num)); + bool writ = dskdmaen == 3 && drv->state && !((selected | disabled) & (1 << num)); if (drv->state == gui_data.drive_motor[num] && drv->cyl == gui_data.drive_track[num] @@ -1151,7 +1151,7 @@ static int drive_empty (drive * drv) return drv->diskfile == 0; } -static void drive_step (drive * drv) +static void drive_step (drive * drv, int step_direction) { #ifdef CATWEASEL if (drv->catweasel) { @@ -1164,6 +1164,8 @@ static void drive_step (drive * drv) return; } #endif + if (!drive_empty (drv)) + drv->dskchange = 0; if (drv->steplimit && get_cycles() - drv->steplimitcycle < MIN_STEPLIMIT_CYCLE) { if (disk_debug_logging > 1) write_log (L" step ignored drive %d, %d", @@ -1175,9 +1177,7 @@ static void drive_step (drive * drv) * (stupid trackloaders with CPU delay loops) */ set_steplimit (drv); - if (!drive_empty (drv)) - drv->dskchange = 0; - if (direction) { + if (step_direction) { if (drv->cyl) { drv->cyl--; #ifdef DRIVESOUND @@ -2376,11 +2376,12 @@ static TCHAR *tobin (uae_u8 v) void DISK_select (uae_u8 data) { - int step_pulse, lastselected, dr; - static uae_u8 prevdata; - static int step; + int step_pulse, prev_selected, dr; + static uae_u8 prev_data; + static int prev_step; + + prev_selected = selected; - lastselected = selected; selected = (data >> 3) & 15; side = 1 - ((data >> 2) & 1); direction = (data >> 1) & 1; @@ -2391,10 +2392,10 @@ void DISK_select (uae_u8 data) #ifdef AMAX if (currprefs.amaxromfile[0]) - amax_disk_select (data, prevdata); + amax_disk_select (data, prev_data); #endif - if ((prevdata & 0x80) != (data & 0x80)) { + if ((prev_data & 0x80) != (data & 0x80)) { for (dr = 0; dr < 4; dr++) { if (floppy[dr].indexhackmode > 1 && !(selected & (1 << dr))) { floppy[dr].indexhack = 1; @@ -2406,42 +2407,44 @@ void DISK_select (uae_u8 data) if (disk_debug_logging > 1) { write_log (L" %d%d%d%d% ", (selected & 1) ? 0 : 1, (selected & 2) ? 0 : 1, (selected & 4) ? 0 : 1, (selected & 8) ? 0 : 1); - if ((prevdata & 0x80) != (data & 0x80)) + if ((prev_data & 0x80) != (data & 0x80)) write_log (L" dskmotor %d ", (data & 0x80) ? 1 : 0); - if ((prevdata & 0x02) != (data & 0x02)) + if ((prev_data & 0x02) != (data & 0x02)) write_log (L" direct %d ", (data & 0x02) ? 1 : 0); - if ((prevdata & 0x04) != (data & 0x04)) + if ((prev_data & 0x04) != (data & 0x04)) write_log (L" side %d ", (data & 0x04) ? 1 : 0); } - if (step != step_pulse) { + // step goes high and drive was selected when step pulse changes: step + if (prev_step != step_pulse) { if (disk_debug_logging > 1) write_log (L" dskstep %d ", step_pulse); - step = step_pulse; - if (step && !savestate_state) { + prev_step = step_pulse; + if (prev_step && !savestate_state) { for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { - if (!((selected | disabled) & (1 << dr))) { - drive_step (floppy + dr); + if (!((prev_selected | disabled) & (1 << dr))) { + drive_step (floppy + dr, direction); if (floppy[dr].indexhackmode > 1 && (data & 0x80)) floppy[dr].indexhack = 1; } } } } + if (!savestate_state) { for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { drive *drv = floppy + dr; /* motor on/off workings tested with small assembler code on real Amiga 1200. */ /* motor/id flipflop is set only when drive select goes from high to low */ - if (!(selected & (1 << dr)) && (lastselected & (1 << dr)) ) { + if (!(selected & (1 << dr)) && (prev_selected & (1 << dr)) ) { drv->drive_id_scnt++; drv->drive_id_scnt &= 31; drv->idbit = (drv->drive_id & (1L << (31 - drv->drive_id_scnt))) ? 1 : 0; if (!(disabled & (1 << dr))) { - if ((prevdata & 0x80) == 0 || (data & 0x80) == 0) { + if ((prev_data & 0x80) == 0 || (data & 0x80) == 0) { /* motor off: if motor bit = 0 in prevdata or data -> turn motor on */ drive_motor (drv, 0); - } else if (prevdata & 0x80) { + } else if (prev_data & 0x80) { /* motor on: if motor bit = 1 in prevdata only (motor flag state in data has no effect) -> turn motor off */ drive_motor (drv, 1); @@ -2461,7 +2464,7 @@ void DISK_select (uae_u8 data) floppy[dr].state = (!(selected & (1 << dr))) | !floppy[dr].motoroff; update_drive_gui (dr); } - prevdata = data; + prev_data = data; if (disk_debug_logging > 1) write_log (L"\n"); } diff --git a/epsonprinter.cpp b/epsonprinter.cpp index a390bec4..c75fd8fd 100644 --- a/epsonprinter.cpp +++ b/epsonprinter.cpp @@ -36,7 +36,7 @@ #include -//#define DEBUGPRINT L"c:\\d\\data_epsonq_raw_fixed_superscript_subscript_multi-strike.bin" +//#define DEBUGPRINT L"C:\\Users\\twilen\\Desktop\\pages_1+2_raw.bin" int pngprint = 0; #ifdef C_LIBPNG @@ -893,6 +893,9 @@ static void outputPage(void) printerDC = NULL; page = NULL; cpage = NULL; + if (curFont) + DeleteObject (curFont); + curFont = NULL; } } diff --git a/gencpu.cpp b/gencpu.cpp index a15a5655..55502e44 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -2321,7 +2321,8 @@ static void gen_opcode (unsigned long int opcode) fill_prefetch_full (); break; case i_Bcc: - // bcc.s and bcc.w cycles confirmed + // bcc.b branch: idle cycle, prefetch, prefetch + // bcc.b not branch: 2 idle cycles, prefetch if (curi->size == sz_long) { if (cpu_level < 2) { addcycles000 (2); diff --git a/hardfile.cpp b/hardfile.cpp index 86c8585d..1d38ce3d 100644 --- a/hardfile.cpp +++ b/hardfile.cpp @@ -982,6 +982,7 @@ int scsi_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u case 0x00: /* TEST UNIT READY */ if (nodisk (hfd)) goto nodisk; + scsi_len = 0; break; case 0x08: /* READ (6) */ if (nodisk (hfd)) @@ -1209,6 +1210,7 @@ int scsi_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u case 0x35: /* SYNCRONIZE CACHE (10) */ if (nodisk (hfd)) goto nodisk; + scsi_len = 0; break; case 0xa8: /* READ (12) */ if (nodisk (hfd)) diff --git a/include/cpu_prefetch.h b/include/cpu_prefetch.h index d3596ebc..db273c79 100644 --- a/include/cpu_prefetch.h +++ b/include/cpu_prefetch.h @@ -225,25 +225,7 @@ STATIC_INLINE void put_byte_ce020 (uaecptr addr, uae_u32 v) mem_access_delay_byte_write_ce020 (addr, v); } -extern void fill_icache020 (uae_u32); - -STATIC_INLINE uae_u32 get_word_ce020_prefetch (int o) -{ - uae_u32 pc = m68k_getpc () + o; - - for (;;) { - if (pc == regs.prefetch020addr) { - uae_u32 v = regs.prefetch020data >> 16; - return v; - } - if (pc == regs.prefetch020addr + 2) { - uae_u32 v = regs.prefetch020data & 0xffff; - fill_icache020 (pc + 2); - return v; - } - fill_icache020 (pc); - } -} +extern uae_u32 get_word_ce020_prefetch (int); STATIC_INLINE uae_u32 get_long_ce020_prefetch (int o) { @@ -281,7 +263,7 @@ STATIC_INLINE void m68k_do_rts_ce020 (void) #ifdef CPUEMU_21 -extern void fill_icache030 (uae_u32 addr); +extern uae_u32 get_word_ce030_prefetch (int); extern void write_dcache030 (uaecptr, uae_u32, int); extern uae_u32 read_dcache030 (uaecptr, int); @@ -313,24 +295,6 @@ STATIC_INLINE uae_u32 get_byte_ce030 (uaecptr addr) return read_dcache030 (addr, 0); } -STATIC_INLINE uae_u32 get_word_ce030_prefetch (int o) -{ - uae_u32 pc = m68k_getpc () + o; - - for (;;) { - if (pc == regs.prefetch020addr) { - uae_u32 v = regs.prefetch020data >> 16; - return v; - } - if (pc == regs.prefetch020addr + 2) { - uae_u32 v = regs.prefetch020data & 0xffff; - fill_icache030 (pc + 2); - return v; - } - fill_icache030 (pc); - } -} - STATIC_INLINE uae_u32 get_long_ce030_prefetch (int o) { uae_u32 v; diff --git a/include/newcpu.h b/include/newcpu.h index 011f76b5..a81f8a1b 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -84,6 +84,7 @@ typedef double fptype; #endif #endif +#define CPU_PIPELINE_MAX 2 #define CPU000_MEM_CYCLE 4 #define CPU000_CLOCK_MULT 2 #define CPU020_MEM_CYCLE 3 @@ -114,6 +115,7 @@ struct cache040 uae_u32 tag[CACHELINES040]; }; + struct regstruct { uae_u32 regs[16]; @@ -164,8 +166,8 @@ struct regstruct uae_u8 panic; uae_u32 panic_pc, panic_addr; - uae_u32 prefetch020data; - uae_u32 prefetch020addr; + uae_u32 prefetch020data[CPU_PIPELINE_MAX]; + uae_u32 prefetch020addr[CPU_PIPELINE_MAX]; int ce020memcycles; }; diff --git a/include/options.h b/include/options.h index 6585241e..64a42a31 100644 --- a/include/options.h +++ b/include/options.h @@ -353,6 +353,7 @@ struct uae_prefs { bool win32_alwaysontop; bool win32_powersavedisabled; bool win32_minimize_inactive; + int win32_statusbar; int win32_active_priority; int win32_inactive_priority; diff --git a/newcpu.cpp b/newcpu.cpp index 1917686c..8cffb837 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -208,6 +208,9 @@ static void set_cpu_caches (void) { int i; + for (i = 0; i < CPU_PIPELINE_MAX; i++) + regs.prefetch020addr[i] = 0xffffffff; + #ifdef JIT if (currprefs.cachesize) { if (currprefs.cpu_model < 68040) { @@ -224,7 +227,6 @@ static void set_cpu_caches (void) if (regs.cacr & 0x08) { // clear instr cache for (i = 0; i < CACHELINES020; i++) caches020[i].valid = 0; - regs.prefetch020addr = 0xff000000; } if (regs.cacr & 0x04) { // clear entry in instr cache caches020[(regs.caar >> 2) & (CACHELINES020 - 1)].valid = 0; @@ -239,7 +241,6 @@ static void set_cpu_caches (void) icaches030[i].valid[2] = 0; icaches030[i].valid[3] = 0; } - regs.prefetch020addr = 0xff000000; } if (regs.cacr & 0x04) { // clear entry in instr cache icaches030[(regs.caar >> 4) & (CACHELINES030 - 1)].valid[(regs.caar >> 2) & 3] = 0; @@ -266,7 +267,6 @@ static void set_cpu_caches (void) caches040[i].valid[2] = 0; caches040[i].valid[3] = 0; } - regs.prefetch020addr = 0xff000000; } } } @@ -4268,8 +4268,8 @@ STATIC_INLINE void fill_cache040 (uae_u32 addr) for (i = 0; i < CACHELINES040; i++) { if (c->valid[i] && c->tag[i] == tag) { // cache hit - regs.prefetch020addr = addr; - regs.prefetch020data = c->data[i][lws]; + regs.prefetch020addr[0] = addr; + regs.prefetch020data[0] = c->data[i][lws]; return; } } @@ -4284,12 +4284,12 @@ STATIC_INLINE void fill_cache040 (uae_u32 addr) c->data[i][0] = data; } } - regs.prefetch020addr = addr; - regs.prefetch020data = data; + regs.prefetch020addr[0] = addr; + regs.prefetch020data[0] = data; } // this one is really simple and easy -void fill_icache020 (uae_u32 addr) +STATIC_INLINE void fill_icache020 (uae_u32 addr, int idx) { int index; uae_u32 tag; @@ -4302,8 +4302,8 @@ void fill_icache020 (uae_u32 addr) c = &caches020[index]; if (c->valid && c->tag == tag) { // cache hit - regs.prefetch020addr = addr; - regs.prefetch020data = c->data; + regs.prefetch020addr[idx] = addr; + regs.prefetch020data[idx] = c->data; return; } // cache miss @@ -4313,8 +4313,39 @@ void fill_icache020 (uae_u32 addr) c->valid = !!(regs.cacr & 1); c->data = data; } - regs.prefetch020addr = addr; - regs.prefetch020data = data; + regs.prefetch020addr[idx] = addr; + regs.prefetch020data[idx] = data; +} + +uae_u32 get_word_ce020_prefetch (int o) +{ + uae_u32 pc = m68k_getpc () + o; + + for (;;) { + for (int i = 0; i < 2; i++) { + if (pc == regs.prefetch020addr[0]) { + uae_u32 v = regs.prefetch020data[0] >> 16; + fill_icache020 (regs.prefetch020addr[0] + 4, 1); + return v; + } + if (pc == regs.prefetch020addr[0] + 2) { + uae_u32 v = regs.prefetch020data[0] & 0xffff; + if (regs.prefetch020addr[1] == regs.prefetch020addr[0] + 4) { + regs.prefetch020addr[0] = regs.prefetch020addr[1]; + regs.prefetch020data[0] = regs.prefetch020data[1]; + fill_icache020 (regs.prefetch020addr[0] + 4, 1); + } else { + fill_icache020 (pc + 4, 0); + fill_icache020 (regs.prefetch020addr[0] + 4, 1); + } + return v; + } + regs.prefetch020addr[0] = regs.prefetch020addr[1]; + regs.prefetch020data[0] = regs.prefetch020data[1]; + } + fill_icache020 (pc + 0, 0); + fill_icache020 (pc + 4, 1); + } } // 68030 caches aren't so simple as 68020 cache.. @@ -4343,7 +4374,7 @@ STATIC_INLINE void update_cache030 (struct cache030 *c, uae_u32 val, uae_u32 tag c->data[lws] = val; } -void fill_icache030 (uae_u32 addr) +STATIC_INLINE void fill_icache030 (uae_u32 addr, int idx) { int lws; uae_u32 tag; @@ -4354,8 +4385,8 @@ void fill_icache030 (uae_u32 addr) c = getcache030 (icaches030, addr, &tag, &lws); if (c->valid[lws] && c->tag == tag) { // cache hit - regs.prefetch020addr = addr; - regs.prefetch020data = c->data[lws]; + regs.prefetch020addr[idx] = addr; + regs.prefetch020data[idx] = c->data[lws]; return; } // cache miss @@ -4372,8 +4403,8 @@ void fill_icache030 (uae_u32 addr) } #endif } - regs.prefetch020addr = addr; - regs.prefetch020data = data; + regs.prefetch020addr[idx] = addr; + regs.prefetch020data[idx] = data; } STATIC_INLINE bool cancache030 (uaecptr addr) @@ -4521,6 +4552,38 @@ uae_u32 read_dcache030 (uaecptr addr, int size) return 0; } +uae_u32 get_word_ce030_prefetch (int o) +{ + uae_u32 pc = m68k_getpc () + o; + + for (;;) { + for (int i = 0; i < 2; i++) { + if (pc == regs.prefetch020addr[0]) { + uae_u32 v = regs.prefetch020data[0] >> 16; + fill_icache030 (regs.prefetch020addr[0] + 4, 1); + return v; + } + if (pc == regs.prefetch020addr[0] + 2) { + uae_u32 v = regs.prefetch020data[0] & 0xffff; + if (regs.prefetch020addr[1] == regs.prefetch020addr[0] + 4) { + regs.prefetch020addr[0] = regs.prefetch020addr[1]; + regs.prefetch020data[0] = regs.prefetch020data[1]; + fill_icache030 (regs.prefetch020addr[0] + 4, 1); + } else { + fill_icache030 (pc + 4, 0); + fill_icache030 (regs.prefetch020addr[0] + 4, 1); + } + return v; + } + regs.prefetch020addr[0] = regs.prefetch020addr[1]; + regs.prefetch020data[0] = regs.prefetch020data[1]; + } + fill_icache030 (pc + 0, 0); + fill_icache030 (pc + 4, 1); + } +} + + void flush_dcache (uaecptr addr, int size) { if (!currprefs.cpu_cycle_exact) diff --git a/od-win32/lib/prowizard.lib b/od-win32/lib/prowizard.lib index c2ddc869..2881840e 100644 Binary files a/od-win32/lib/prowizard.lib and b/od-win32/lib/prowizard.lib differ diff --git a/od-win32/resources/resource b/od-win32/resources/resource index ce6eb8d9..d1613508 100644 --- a/od-win32/resources/resource +++ b/od-win32/resources/resource @@ -1034,6 +1034,8 @@ #define IDC_DXMODE 1792 #define IDC_RTG_VBLANKRATE 1793 #define IDC_DF0WPTEXTQ 1793 +#define IDC_DXMODE2 1793 +#define IDC_WINDOWEDMODE 1793 #define IDC_DF1WPTEXTQ 1794 #define IDC_INPUTMAPLIST 1797 #define IDC_PORT1_REMAP 1798 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 4cd76b47..fa65fddc 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -481,7 +481,7 @@ BEGIN GROUPBOX "Miscellaneous Options",IDC_STATIC,8,2,290,136 CONTROL "Untrap = middle button",IDC_JULIAN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,19,110,10 CONTROL "Show GUI on startup",IDC_SHOWGUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,43,109,10 - CONTROL "Native On-screen LEDs",IDC_SHOWLEDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,80,109,10 + CONTROL "Native OSD",IDC_SHOWLEDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,95,76,10 CONTROL "Don't show taskbar button",IDC_NOTASKBARBUTTON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,67,109,10 CONTROL "Use CTRL-F11 to quit",IDC_CTRLF11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,55,110,10 GROUPBOX "Keyboard LEDs",IDC_STATIC,7,140,85,94 @@ -501,20 +501,22 @@ BEGIN COMBOBOX IDC_STATE_BUFFERSIZE,248,217,38,65,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP CONTROL "Always on top",IDC_ALWAYSONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,79,110,10 CONTROL "USB mode",IDC_KBLED_USB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,216,64,10 - COMBOBOX IDC_SCSIMODE,213,30,80,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SCSIMODE,213,26,80,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_LANGUAGE,153,117,122,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP GROUPBOX "Language",IDC_STATIC,138,107,154,27 CONTROL "Disable screensaver",IDC_POWERSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,91,109,10 - COMBOBOX IDC_DD_SURFACETYPE,213,63,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - RTEXT "DirectDraw display buffer:",IDC_STATIC,195,50,92,10,SS_CENTERIMAGE + COMBOBOX IDC_DD_SURFACETYPE,213,78,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + RTEXT "DirectDraw display buffer:",IDC_STATIC,112,79,97,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,103,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,115,100,10 - CONTROL "RTG On-screen LEDs",IDC_SHOWLEDSRTG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,93,109,10 - LTEXT "Graphics API:",IDC_STATIC,136,49,62,10,SS_CENTERIMAGE - COMBOBOX IDC_DXMODE,138,62,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,19,115,111,10 + CONTROL "RTG OSD",IDC_SHOWLEDSRTG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,227,95,63,10 + RTEXT "Graphics API:",IDC_STATIC,130,62,79,10,SS_CENTERIMAGE + COMBOBOX IDC_DXMODE,213,60,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Minimize when focus is lost",IDC_FOCUSMINIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,31,110,10 + RTEXT "Windowed style:",IDC_STATIC,128,45,81,10,SS_CENTERIMAGE + COMBOBOX IDC_WINDOWEDMODE,213,43,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP END IDD_HARDFILE DIALOGEX 0, 0, 299, 249 diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 6a1df589..3cac039d 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -846,6 +846,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, int mx, my; int istablet = (GetMessageExtraInfo () & 0xFFFFFF00) == 0xFF515700; static int mm, minimized, recursive, ignoremousemove; + static bool ignorelbutton; #if MSGDEBUG > 1 write_log (L"AWP: %x %x\n", hWnd, message); @@ -868,6 +869,10 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, } dx_check (); break; + case WM_MOUSEACTIVATE: + if (isfocus () == 0) + ignorelbutton = true; + break; case WM_ACTIVATEAPP: if (!wParam && isfullscreen () <= 0 && currprefs.win32_minimize_inactive) minimizewindow (); @@ -890,6 +895,16 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: if (!mouseactive && !gui_active && (!mousehack_alive () || currprefs.input_tablet != TABLET_MOUSEHACK || (currprefs.input_tablet == TABLET_MOUSEHACK && !currprefs.input_magic_mouse) || isfullscreen () > 0)) { + // borderless = do not capture with single-click + if (ignorelbutton) { + ignorelbutton = 0; + return 0; + } + if (message == WM_LBUTTONDOWN && isfullscreen () == 0 && currprefs.win32_borderless && !rp_isactive ()) { + // full-window drag + SendMessage (hAmigaWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0); + return 0; + } setmouseactive ((message == WM_LBUTTONDBLCLK || isfullscreen() > 0) ? 2 : 1); } else if (dinput_winmouse () >= 0 && isfocus ()) { setmousebuttonstate (dinput_winmouse (), 0, 1); @@ -1544,7 +1559,12 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, int port = lpDIS->itemID - 1; int x = (lpDIS->rcItem.right - lpDIS->rcItem.left + 1) / 2 + lpDIS->rcItem.left - 1; int y = (lpDIS->rcItem.bottom - lpDIS->rcItem.top + 1) / 2 + lpDIS->rcItem.top - 1; - FillRect (lpDIS->hDC, &lpDIS->rcItem, (HBRUSH)(COLOR_3DFACE + 1)); + RECT r = lpDIS->rcItem; + r.left++; + r.right--; + r.top++; + r.bottom--; + FillRect (lpDIS->hDC, &r, (HBRUSH)(COLOR_3DFACE + 1)); for (int i = 0; i < 2; i++) { int buttons = guijoybutton[port + i * 2]; int m = i == 0 ? 1 : 2; @@ -1729,7 +1749,7 @@ void handle_events (void) int was_paused = 0; static int cnt; - if (guijoychange && window_led_joy_start > 0) { + if (hStatusWnd && guijoychange && window_led_joy_start > 0) { guijoychange = false; for (int i = 0; i < window_led_joy_start; i++) PostMessage (hStatusWnd, SB_SETTEXT, (WPARAM)((i + 1) | SBT_OWNERDRAW), (LPARAM)L""); @@ -2694,6 +2714,7 @@ void target_default_options (struct uae_prefs *p, int type) p->win32_rtgvblankrate = 0; p->win32_commandpathstart[0] = 0; p->win32_commandpathend[0] = 0; + p->win32_statusbar = 1; } if (type == 1 || type == 0) { p->win32_uaescsimode = UAESCSI_CDEMU; @@ -2708,7 +2729,8 @@ void target_default_options (struct uae_prefs *p, int type) } } -static const TCHAR *scsimode[] = { L"SCSIEMU", L"SPTI", L"SPTI+SCSISCAN", L"AdaptecASPI", L"NeroASPI", L"FrogASPI", 0 }; +static const TCHAR *scsimode[] = { L"SCSIEMU", L"SPTI", L"SPTI+SCSISCAN", L"AdaptecASPI", L"NeroASPI", L"FrogASPI", NULL }; +static const TCHAR *statusbarmode[] = { L"none", L"normal", L"extended", NULL }; void target_save_options (struct zfile *f, struct uae_prefs *p) { @@ -2748,6 +2770,7 @@ void target_save_options (struct zfile *f, struct uae_prefs *p) cfgfile_target_dwrite (f, L"rtg_vblank", L"%d", p->win32_rtgvblankrate); cfgfile_target_dwrite_bool (f, L"borderless", p->win32_borderless); cfgfile_target_dwrite_str (f, L"uaescsimode", scsimode[p->win32_uaescsimode]); + cfgfile_target_dwrite_str (f, L"statusbar", statusbarmode[p->win32_statusbar]); cfgfile_target_dwrite (f, L"soundcard", L"%d", p->win32_soundcard); if (sound_devices[p->win32_soundcard].cfgname) cfgfile_target_dwrite_str (f, L"soundcardname", sound_devices[p->win32_soundcard].cfgname); @@ -2942,6 +2965,9 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * return 1; } + if (cfgfile_strval (option, value, L"statusbar", &p->win32_statusbar, statusbarmode, 0)) + return 1; + if (cfgfile_intval (option, value, L"active_priority", &v, 1)) { p->win32_active_priority = fetchpri (v, 1); return 1; diff --git a/od-win32/win32.h b/od-win32/win32.h index 24ed8879..12184f17 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -18,8 +18,8 @@ #define WINUAEPUBLICBETA 1 #define LANG_DLL 1 -#define WINUAEBETA L"13" -#define WINUAEDATE MAKEBD(2010, 8, 27) +#define WINUAEBETA L"14" +#define WINUAEDATE MAKEBD(2010, 8, 31) #define WINUAEEXTRA L"" #define WINUAEREV L"" diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 9aefbd8b..138746c7 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1308,6 +1308,7 @@ int check_prefs_changed_gfx (void) c |= currprefs.win32_alwaysontop != changed_prefs.win32_alwaysontop ? 32 : 0; c |= currprefs.win32_notaskbarbutton != changed_prefs.win32_notaskbarbutton ? 32 : 0; c |= currprefs.win32_borderless != changed_prefs.win32_borderless ? 32 : 0; + c |= currprefs.win32_statusbar != changed_prefs.win32_statusbar ? 32 : 0; c |= currprefs.win32_rtgmatchdepth != changed_prefs.win32_rtgmatchdepth ? 2 : 0; c |= currprefs.win32_rtgscaleifsmall != changed_prefs.win32_rtgscaleifsmall ? (2 | 8 | 64) : 0; c |= currprefs.win32_rtgallowscaling != changed_prefs.win32_rtgallowscaling ? (2 | 8 | 64) : 0; @@ -1371,6 +1372,7 @@ int check_prefs_changed_gfx (void) currprefs.win32_alwaysontop = changed_prefs.win32_alwaysontop; currprefs.win32_notaskbarbutton = changed_prefs.win32_notaskbarbutton; currprefs.win32_borderless = changed_prefs.win32_borderless; + currprefs.win32_statusbar = changed_prefs.win32_statusbar; currprefs.win32_rtgmatchdepth = changed_prefs.win32_rtgmatchdepth; currprefs.win32_rtgscaleifsmall = changed_prefs.win32_rtgscaleifsmall; currprefs.win32_rtgallowscaling = changed_prefs.win32_rtgallowscaling; @@ -1959,7 +1961,7 @@ static void createstatuswindow (void) HLOCAL hloc; LPINT lpParts; int drive_width, hd_width, cd_width, power_width, fps_width, idle_width, snd_width, joy_width; - int joys = 0; + int joys = currprefs.win32_statusbar > 1 ? 2 : 0; int num_parts = 11 + joys; double scaleX, scaleY; WINDOWINFO wi; @@ -1969,6 +1971,8 @@ static void createstatuswindow (void) ShowWindow (hStatusWnd, SW_HIDE); DestroyWindow (hStatusWnd); } + if (currprefs.win32_statusbar == 0) + return; hStatusWnd = CreateWindowEx ( 0, STATUSCLASSNAME, (LPCTSTR) NULL, SBARS_TOOLTIPS | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hMainWnd, (HMENU) 1, hInst, NULL); @@ -2141,7 +2145,7 @@ static int create_windows_2 (void) DWORD flags = 0; int borderless = currprefs.win32_borderless; DWORD style = NORMAL_WINDOW_STYLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; - int cymenu = GetSystemMetrics (SM_CYMENU); + int cymenu = currprefs.win32_statusbar == 0 ? 0 : GetSystemMetrics (SM_CYMENU); int cyborder = GetSystemMetrics (SM_CYBORDER); int cxborder = GetSystemMetrics (SM_CXBORDER); int gap = 3; diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index b85ac956..626e0756 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -7342,6 +7342,15 @@ static void values_to_miscdlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_DXMODE, CB_ADDSTRING, 0, (LPARAM)L"Direct3D"); SendDlgItemMessage (hDlg, IDC_DXMODE, CB_SETCURSEL, workprefs.gfx_api, 0); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)L"Borderless"); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)L"Minimal"); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)L"Standard"); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)L"Extended"); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_SETCURSEL, + workprefs.win32_borderless ? 0 : (workprefs.win32_statusbar + 1), + 0); + SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)L"NonLocalVRAM"); SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)L"DefaultRAM *"); @@ -7454,6 +7463,17 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) enable_for_miscdlg (hDlg); } break; + case IDC_WINDOWEDMODE: + v = SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_GETCURSEL, 0, 0L); + if (v != CB_ERR) { + workprefs.win32_borderless = 0; + workprefs.win32_statusbar = 0; + if (v == 0) + workprefs.win32_borderless = 1; + if (v > 0) + workprefs.win32_statusbar = v - 1; + } + break; case IDC_DD_SURFACETYPE: v = SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_GETCURSEL, 0, 0L); if (v != CB_ERR) { @@ -13549,17 +13569,19 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) drvdrag = 0; if (currentpage < 0) { GetClientRect (hMainWnd, &r2); - GetClientRect (hStatusWnd, &r); - if (pt.y >= r2.bottom && pt.y < r2.bottom + r.bottom) { - if (pt.x >= window_led_drives && pt.x < window_led_drives_end && window_led_drives > 0) { - drv = pt.x - window_led_drives; - drv /= (window_led_drives_end - window_led_drives) / 4; - drvdrag = 1; - if (drv < 0 || drv > 3) - drv = 0; - } - if (pt.x >= window_led_hd && pt.x < window_led_hd_end && window_led_hd > 0) { - harddrive = 1; + if (hStatusWnd) { + GetClientRect (hStatusWnd, &r); + if (pt.y >= r2.bottom && pt.y < r2.bottom + r.bottom) { + if (pt.x >= window_led_drives && pt.x < window_led_drives_end && window_led_drives > 0) { + drv = pt.x - window_led_drives; + drv /= (window_led_drives_end - window_led_drives) / 4; + drvdrag = 1; + if (drv < 0 || drv > 3) + drv = 0; + } + if (pt.x >= window_led_hd && pt.x < window_led_hd_end && window_led_hd > 0) { + harddrive = 1; + } } } } else if (currentpage == FLOPPY_ID || currentpage == QUICKSTART_ID) { diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 2dbcf6d0..43a758f2 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,23 @@ +Beta 14: + +- DSKSTEP and DSKSELx going inactive at the same time steps the rw-head normally + Fixes Euro Soccer stupid disk change detection. +- uaehf.device HD_SCSICMD TEST UNIT READY returned an error (HDInstTools works again) +- added 68020 CE-mode very approximate 2-stage CPU prefetch pipeline emulation (not that 68020 + don't really have 2-stage prefetch but it still will be more compatible without major changes) + Fixes ATR and (partially) Last Ninja 3 CD32 graphics glitches, (missing blitter waits..) + also more compatible with self-modifying code +- CD32/CDTV empty "image mode" tried to select physical drive +- added windowed mode configuration GUI setting (borderless, minimal, normal, extended) + Extended is WIP and something you (and me?) should ignore +- do not capture mouse if left mouse was clicked and WinUAE window had no focus + (now available via GUI = can't be totally useless anymore..) +- borderless mode can be dragged by clicking mouse button once, only double click captures mouse +- fixed epson printing emulation blank page when printing multiple text pages and later pages + didn't have any font or font style changes +- more prowizard ripper updates + Beta 13: - addaq.x #x,Ax and subaq.x #x,Ax had too long cycle count (this was really stupid bug) @@ -21,9 +40,6 @@ Beta 13: - directories selected via "favorite menu" also sets default path - prowizard updates -- added ugly joystick/mouse direction status bar pointers (design stolen from Vice and - future AF player skin) Not sure if this was good idea.. - Beta 12: - : without '\' in harddrive paths was detected as a relative path, diff --git a/prowizard/rippers/EurekaPacker.c b/prowizard/rippers/EurekaPacker.c index 2893ab9d..7475414e 100644 --- a/prowizard/rippers/EurekaPacker.c +++ b/prowizard/rippers/EurekaPacker.c @@ -1,8 +1,3 @@ -/* (27 dec 2001) - * added some checks to prevent readings outside of input file (in test 1) - * (May 2002) - * added test_smps() -*/ /* testEUREKA() */ /* Rip_EUREKA() */ /* Depack_EUREKA() */ @@ -12,6 +7,13 @@ #include "extern.h" +/* (27 dec 2001) + * added some checks to prevent readings outside of input file (in test 1) + * (May 2002) + * added test_smps() + * (30/08/10) + * changed #4.3 as the "remaining" patternlist isn't always 0x00 +*/ short testEUREKA ( void ) { /* test 1 */ @@ -84,9 +86,9 @@ short testEUREKA ( void ) PW_k += 2; /* to be sure .. */ while ( PW_k != 128 ) { - if ( in_data[PW_Start_Address+952+PW_k] != 0 ) + if ( in_data[PW_Start_Address+952+PW_k] > 0x64 ) { -/*printf ( "#4,3 (Start:%ld)\n" , PW_Start_Address );*/ +/*printf ( "#4,3 (Start:%ld)(PW_k:%ld)\n" , PW_Start_Address,PW_k );*/ return BAD; } PW_k += 1; diff --git a/prowizard/rippers/KefrensSoundMachine.c b/prowizard/rippers/KefrensSoundMachine.c index 3161c4c4..f1e3827a 100644 --- a/prowizard/rippers/KefrensSoundMachine.c +++ b/prowizard/rippers/KefrensSoundMachine.c @@ -71,7 +71,7 @@ void Rip_KSM ( void ) Save_Rip ( "Kefrens Sound Machine module", KSM ); if ( Save_Status == GOOD ) - PW_i += (OutputSize - 2); /* -1 should do but call it "just to be sure" :) */ + PW_i += 2; /* -1 should do but call it "just to be sure" :) */ } @@ -89,6 +89,9 @@ void Rip_KSM ( void ) * - added transciption for sample names * Another Update : 26 nov 2003 * - used htonl() so that use of addy is now portable on 68k archs + * update 30/08/10 + * - patternlist with only one pattern fixed + * - conversion to STK instead of PTK */ #define ON 1 @@ -196,14 +199,13 @@ void Depack_KSM ( void ) } else { - Whatever[1] = 0x01; - fwrite ( Whatever , 2 , 1 , out ); + c1 = 0x00; + c2 = 0x01; + fwrite ( &c1 , 1 , 1 , out ); + fwrite ( &c2 , 1 , 1 , out ); } Where += 32; } - Whatever[129] = 0x01; - for ( i=0 ; i<16 ; i++ ) - fwrite ( &Whatever[100] , 30 , 1 , out ); /*printf ( "ok\n" );*/ /* pattern list */ @@ -308,11 +310,11 @@ void Depack_KSM ( void ) /* write ID */ - Whatever[0] = 'M'; + /*Whatever[0] = 'M'; Whatever[1] = '.'; Whatever[2] = 'K'; - Whatever[3] = '.'; - fwrite ( Whatever , 4 , 1 , out ); + Whatever[3] = '.';*/ + /*fwrite ( Whatever , 4 , 1 , out );*/ /* pattern data */ /*printf ( "Converting pattern datas " );*/ @@ -371,7 +373,7 @@ void Depack_KSM ( void ) /* crap */ - Crap ( "Kefrens SndMachine" , BAD , BAD , out ); + /*Crap ( "Kefrens SndMachine" , BAD , BAD , out );*/ fflush ( out ); fclose ( out ); diff --git a/prowizard/rippers/NoisePacker1.c b/prowizard/rippers/NoisePacker1.c index 7c72c8a9..5a3396b8 100644 --- a/prowizard/rippers/NoisePacker1.c +++ b/prowizard/rippers/NoisePacker1.c @@ -152,7 +152,7 @@ void Rip_Noisepacker1 ( void ) Save_Rip ( "NoisePacker v1 module", Noisepacker1 ); if ( Save_Status == GOOD ) - PW_i += (OutputSize - 16); /* 15 should do but call it "just to be sure" :) */ + PW_i += 16; /* 15 should do but call it "just to be sure" :) */ } @@ -165,6 +165,8 @@ void Rip_Noisepacker1 ( void ) * Speed-up and Binary smaller. * Update:30/11/99 * - removed fopen() and attached funcs. + * update: 30/08/10 + * - Whatever wasn't cleaned up and was harmful when patternlist size was 1 */ void Depack_Noisepacker1 ( void ) { @@ -262,6 +264,7 @@ void Depack_Noisepacker1 ( void ) /* write noisetracker byte */ Whatever[0] = 0x7f; fwrite ( Whatever , 1 , 1 , out ); + BZERO ( Whatever , 1024 ); /* bypass 2 bytes ... seems always the same as in $02 */ /* & bypass 2 other bytes which meaning is beside me */