From: Toni Wilen Date: Sat, 1 Nov 2014 13:09:41 +0000 (+0200) Subject: 2900b23 X-Git-Tag: 3000~14 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=a305f3d4909e5abb44490847faf65dee410f4834;p=francis%2Fwinuae.git 2900b23 --- diff --git a/akiko.cpp b/akiko.cpp index 703be73f..49e17f91 100644 --- a/akiko.cpp +++ b/akiko.cpp @@ -838,7 +838,7 @@ static int cdrom_command_multi (void) #endif cdrom_data_offset = seekpos; cdrom_seek_delay = abs (cdrom_current_sector - cdrom_data_offset); - if (cdrom_seek_delay < 100) { + if (cdrom_seek_delay < 100 || currprefs.cd_speed == 0) { cdrom_seek_delay = 1; } else { cdrom_seek_delay /= 1000; @@ -1175,6 +1175,8 @@ void AKIKO_hsync_handler (void) cdrom_seek_delay--; } framecounter += (float)maxvpos * vblank_hz / (75.0 * cdrom_speed); + if (currprefs.cd_speed == 0) + framecounter = 1; framesync = true; } diff --git a/cdtv.cpp b/cdtv.cpp index bdd462db..52a28030 100644 --- a/cdtv.cpp +++ b/cdtv.cpp @@ -508,7 +508,8 @@ static void cdrom_command_thread (uae_u8 b) if (cdrom_command_cnt_in == 7) { cdrom_command_accepted (0, s, &cdrom_command_cnt_in); cd_finished = 1; - sleep_millis (500); + if (currprefs.cd_speed) + sleep_millis (500); activate_stch = 1; } break; @@ -639,6 +640,8 @@ static void dma_do_thread (void) cdrom_offset / cdtv_sectorsize, dmac_acr, cnt, cdrom_length / 2); #endif dma_wait += cnt * (uae_u64)312 * 50 / 75 + 1; + if (currprefs.cd_speed == 0) + dma_wait = 1; while (cnt > 0 && dmac_dma) { uae_u8 buffer[2352]; if (!didread || readsector != (cdrom_offset / cdtv_sectorsize)) { diff --git a/cdtvcr.cpp b/cdtvcr.cpp index 3ede0085..6f9a3d2a 100644 --- a/cdtvcr.cpp +++ b/cdtvcr.cpp @@ -74,6 +74,7 @@ static int datatrack; static int cdtvcr_media; static int subqcnt; static int cd_audio_status; +static int cdtvcr_wait_sectors; static void cdtvcr_battram_reset (void) { @@ -370,7 +371,8 @@ static void cdtvcr_read_data(uae_u32 start, uae_u32 addr, uae_u32 len) { uae_u8 buffer[2048]; int didread; - + + cdtvcr_wait_sectors = 0; while (len) { didread = sys_command_cd_read (unitnum, buffer, start, 1); if (!didread) @@ -381,8 +383,8 @@ static void cdtvcr_read_data(uae_u32 start, uae_u32 addr, uae_u32 len) } addr += 2048; start++; + cdtvcr_wait_sectors++; } - cdtvcr_cmd_done(); } static void cdtvcr_do_cmd(void) @@ -715,19 +717,33 @@ static void *dev_thread (void *p) void CDTVCR_hsync_handler (void) { - static int subqcnt; + static int subqcnt, readcnt; if (!currprefs.cs_cdtvcr) return; + if (cdtvcr_wait_sectors > 0 && currprefs.cd_speed == 0) { + cdtvcr_wait_sectors = 0; + cdtvcr_cmd_done(); + } + readcnt--; + if (readcnt <= 0) { + int cdspeed = cdtvcr_4510_ram[CDTVCR_CD_SPEED] ? 150 : 75; + readcnt = (int)(maxvpos * vblank_hz / cdspeed); + if (cdtvcr_wait_sectors > 0) { + cdtvcr_wait_sectors--; + if (cdtvcr_wait_sectors == 0) + cdtvcr_cmd_done(); + } + } subqcnt--; - if (subqcnt < 0) { + if (subqcnt <= 0) { write_comm_pipe_u32 (&requests, 0x0101, 1); - subqcnt = 75; + subqcnt = (int)(maxvpos * vblank_hz / 75); // want subcodes but not playing? if (cdtvcr_4510_ram[CDTVCR_CD_SUBCODES] && !cdtvcr_4510_ram[CDTVCR_CD_PLAYING]) { // just return fake stuff, for some reason cdtv-cr driver requires something - // that looks validg, even when not playing or it gets in infinite loop + // that looks valid, even when not playing or it gets in infinite loop uae_u8 dst[SUB_CHANNEL_SIZE]; // regenerate Q-subchannel uae_u8 *s = dst + 12; @@ -744,6 +760,7 @@ void CDTVCR_hsync_handler (void) setsubchannel(dst); } } + } static void open_unit (void) diff --git a/cfgfile.cpp b/cfgfile.cpp index 3ccf9dad..9dbc477d 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -258,6 +258,12 @@ static const TCHAR *hdcontrollers[] = { _T("scsi%d_a3000"), _T("scsi%d_a4000t"), _T("scsi%d_cdtv"), _T("scsi%d_cpuboard"), _T("scsram"), _T("scide") }; +static const TCHAR *z3mapping[] = { + _T("auto"), + _T("uae"), + _T("real"), + NULL +}; static const TCHAR *obsolete[] = { _T("accuracy"), _T("gfx_opengl"), _T("gfx_32bit_blits"), _T("32bit_blits"), _T("gfx_immediate_blits"), _T("gfx_ntsc"), _T("win32"), _T("gfx_filter_bits"), @@ -267,6 +273,7 @@ static const TCHAR *obsolete[] = { _T("serial_hardware_dtrdsr"), _T("gfx_filter_upscale"), _T("gfx_correct_aspect"), _T("gfx_autoscale"), _T("parallel_sampler"), _T("parallel_ascii_emulation"), _T("avoid_vid"), _T("avoid_dga"), _T("z3chipmem_size"), _T("state_replay_buffer"), _T("state_replay"), + _T("z3realmapping"), _T("force_0x10000000_z3"), _T("gfx_filter_vert_zoom"),_T("gfx_filter_horiz_zoom"), _T("gfx_filter_vert_zoom_mult"), _T("gfx_filter_horiz_zoom_mult"), @@ -1096,6 +1103,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write (f, _T("floppy_speed"), _T("%d"), p->floppy_speed); cfgfile_write (f, _T("floppy_volume"), _T("%d"), p->dfxclickvolume); cfgfile_dwrite (f, _T("floppy_channel_mask"), _T("0x%x"), p->dfxclickchannelmask); + cfgfile_write (f, _T("cd_speed"), _T("%d"), p->cd_speed); cfgfile_write_bool (f, _T("parallel_on_demand"), p->parallel_demand); cfgfile_write_bool (f, _T("serial_on_demand"), p->serial_demand); cfgfile_write_bool (f, _T("serial_hardware_ctsrts"), p->serial_hwctsrts); @@ -1475,8 +1483,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite_bool (f, _T("z3_autoconfig"), p->cs_z3autoconfig); cfgfile_dwrite (f, _T("chipset_hacks"), _T("0x%x"), p->cs_hacks); - cfgfile_dwrite_bool (f, _T("z3realmapping"), p->jit_direct_compatible_memory); - cfgfile_dwrite_bool (f, _T("force_0x10000000_z3"), p->force_0x10000000_z3); + cfgfile_dwrite_str (f, _T("z3mapping"), z3mapping[p->z3_mapping_mode]); cfgfile_dwrite_bool (f, _T("fastmem_autoconfig"), p->fastmem_autoconfig); if (p->fastmem_size < 0x100000 && p->fastmem_size) cfgfile_write (f, _T("fastmem_size_k"), _T("%d"), p->fastmem_size / 1024); @@ -3645,8 +3652,6 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH || cfgfile_yesno (option, value, _T("z3_autoconfig"), &p->cs_z3autoconfig) || cfgfile_yesno (option, value, _T("agnus_bltbusybug"), &p->cs_agnusbltbusybug) || cfgfile_yesno (option, value, _T("fastmem_autoconfig"), &p->fastmem_autoconfig) - || cfgfile_yesno (option, value, _T("z3realmapping"), &p->jit_direct_compatible_memory) - || cfgfile_yesno (option, value, _T("force_0x10000000_z3"), &p->force_0x10000000_z3) || cfgfile_yesno (option, value, _T("gfxcard_hardware_vblank"), &p->rtg_hardwareinterrupt) || cfgfile_yesno (option, value, _T("gfxcard_hardware_sprite"), &p->rtg_hardwaresprite) || cfgfile_yesno (option, value, _T("synchronize_clock"), &p->tod_hack) @@ -3707,6 +3712,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH || cfgfile_strval(option, value, _T("cpuboard_type"), &p->cpuboard_type, cpuboards, 0) || cfgfile_intval(option, value, _T("rtg_modes"), &p->picasso96_modeflags, 1) || cfgfile_intval (option, value, _T("floppy_speed"), &p->floppy_speed, 1) + || cfgfile_intval (option, value, _T("cd_speed"), &p->cd_speed, 1) || cfgfile_intval (option, value, _T("floppy_write_length"), &p->floppy_write_length, 1) || cfgfile_intval (option, value, _T("floppy_random_bits_min"), &p->floppy_random_bits_min, 1) || cfgfile_intval (option, value, _T("floppy_random_bits_max"), &p->floppy_random_bits_max, 1) @@ -3736,6 +3742,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH || cfgfile_strval (option, value, _T("monitoremu"), &p->monitoremu, specialmonitors, 0) || cfgfile_strval (option, value, _T("waiting_blits"), &p->waiting_blits, waitblits, 0) || cfgfile_strval (option, value, _T("floppy_auto_extended_adf"), &p->floppy_auto_ext2, autoext2, 0) + || cfgfile_strval (option, value, _T("z3mapping"), &p->z3_mapping_mode, z3mapping, 0) || cfgfile_strboolval (option, value, _T("comp_flushmode"), &p->comp_hardflush, flushmode, 0)) return 1; @@ -5331,8 +5338,7 @@ void default_prefs (struct uae_prefs *p, int type) p->ghostscript_parameters[0] = 0; p->uae_hide = 0; p->uae_hide_autoconfig = false; - p->jit_direct_compatible_memory = true; - p->force_0x10000000_z3 = false; + p->z3_mapping_mode = Z3MAPPING_AUTO; p->mountitems = 0; for (i = 0; i < MOUNT_CONFIG_SIZE; i++) { @@ -5561,6 +5567,7 @@ void default_prefs (struct uae_prefs *p, int type) p->floppy_random_bits_max = 3; p->dfxclickvolume = 33; p->dfxclickchannelmask = 0xffff; + p->cd_speed = 100; p->statecapturebuffersize = 100; p->statecapturerate = 5 * 50; @@ -5609,6 +5616,8 @@ void default_prefs (struct uae_prefs *p, int type) cr->locked = false; _tcscpy (cr->label, _T("NTSC")); + savestate_state = 0; + target_default_options (p, type); zfile_fclose (default_file); diff --git a/custom.cpp b/custom.cpp index d2f137fc..1d5c39cb 100644 --- a/custom.cpp +++ b/custom.cpp @@ -1682,11 +1682,6 @@ static void update_denise_shifter_planes (int hpos) toscr_1 (diff, fetchmode); thisline_decision.plfright += hpos - thisline_decision.plfright; } - toscr_nr_planes_shifter = np; - if (isocs7planes ()) { - if (toscr_nr_planes_shifter < 6) - toscr_nr_planes_shifter = 6; - } } static void update_denise (int hpos) diff --git a/dlopen.cpp b/dlopen.cpp index 3a34f77c..870f1d1c 100644 --- a/dlopen.cpp +++ b/dlopen.cpp @@ -12,8 +12,7 @@ UAE_DLHANDLE uae_dlopen(const TCHAR *path) { UAE_DLHANDLE result; #ifdef WINUAE - extern HMODULE WIN32_LoadLibrary(const TCHAR *name); - result = WIN32_LoadLibrary(path); + result = uae_dlopen_plugin(path); #elif _WIN32 result = LoadLibrary(path); #else @@ -23,6 +22,8 @@ UAE_DLHANDLE uae_dlopen(const TCHAR *path) write_log("uae_dlopen failed: %s\n", error); } #endif + if (result) + uae_dlopen_patch_common(result); return result; } @@ -51,10 +52,10 @@ void uae_dlclose(UAE_DLHANDLE handle) #include "uae/log.h" -void uae_patch_library_common(UAE_DLHANDLE handle) +void uae_dlopen_patch_common(UAE_DLHANDLE handle) { + write_log(_T("DLOPEN: Patching common functions\n")); void *ptr; - ptr = uae_dlsym(handle, "uae_log"); if (ptr) *((uae_log_function *) ptr) = &uae_log; } diff --git a/expansion.cpp b/expansion.cpp index 2bb56df4..3ada7efb 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -200,7 +200,7 @@ bool expamem_z3hack(struct uae_prefs *p) if (regs.halted && ppc_state) return false; #endif - return p->jit_direct_compatible_memory || cpuboard_memorytype(p) == BOARD_MEMORY_BLIZZARD_12xx; + return p->z3_mapping_mode == Z3MAPPING_AUTO || p->z3_mapping_mode == Z3MAPPING_UAE || cpuboard_memorytype(p) == BOARD_MEMORY_BLIZZARD_12xx; } /* Ugly hack for >2M chip RAM in single pool @@ -357,13 +357,13 @@ static void call_card_init(int index) } else { - if (expamem_z3_sum < 0x10000000) { + if (expamem_z3_sum < Z3BASE_UAE) { expamem_z3_sum = currprefs.z3autoconfig_start; - if (currprefs.mbresmem_high_size >= 128 * 1024 * 1024 && expamem_z3_sum == 0x10000000) + if (currprefs.mbresmem_high_size >= 128 * 1024 * 1024 && expamem_z3_sum == Z3BASE_UAE) expamem_z3_sum += (currprefs.mbresmem_high_size - 128 * 1024 * 1024) + 16 * 1024 * 1024; if (!expamem_z3hack(&currprefs)) - expamem_z3_sum = 0x40000000; - if (expamem_z3_sum == 0x10000000) { + expamem_z3_sum = Z3BASE_REAL; + if (expamem_z3_sum == Z3BASE_UAE) { expamem_z3_sum += currprefs.z3chipmem_size; } } @@ -1412,19 +1412,19 @@ static void allocate_expamem (void) currprefs.rtgmem_type = changed_prefs.rtgmem_type; currprefs.z3chipmem_size = changed_prefs.z3chipmem_size; - z3chipmem_bank.start = 0x10000000; + z3chipmem_bank.start = Z3BASE_UAE; z3fastmem_bank.start = currprefs.z3autoconfig_start; if (currprefs.mbresmem_high_size >= 128 * 1024 * 1024) z3chipmem_bank.start += (currprefs.mbresmem_high_size - 128 * 1024 * 1024) + 16 * 1024 * 1024; if (!expamem_z3hack(&currprefs)) - z3fastmem_bank.start = 0x40000000; - if (z3fastmem_bank.start == 0x40000000) { + z3fastmem_bank.start = Z3BASE_REAL; + if (z3fastmem_bank.start == Z3BASE_REAL) { if (currprefs.cpuboard_type == BOARD_WARPENGINE_A4000) { z3fastmem_bank.start += 0x01000000; z3fastmem_bank.start = expansion_startaddress(z3fastmem_bank.start, currprefs.z3fastmem_size); } } - if (z3fastmem_bank.start == 0x10000000) { + if (z3fastmem_bank.start == Z3BASE_UAE) { if (currprefs.mbresmem_high_size >= 128 * 1024 * 1024) z3fastmem_bank.start += (currprefs.mbresmem_high_size - 128 * 1024 * 1024) + 16 * 1024 * 1024; z3fastmem_bank.start += currprefs.z3chipmem_size; diff --git a/filesys.cpp b/filesys.cpp index 7cb012b4..6b44de9f 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -971,10 +971,10 @@ static void initialize_mountinfo (void) break; } } else if (type == HD_CONTROLLER_TYPE_PCMCIA_SRAM) { - gayle_add_pcmcia_sram_unit (uci->rootdir, uci->readonly); + gayle_add_pcmcia_sram_unit (uci); added = true; } else if (type == HD_CONTROLLER_TYPE_PCMCIA_IDE) { - gayle_add_pcmcia_ide_unit (uci->rootdir, uci); + gayle_add_pcmcia_ide_unit (uci); added = true; } if (added) @@ -1965,6 +1965,16 @@ int filesys_media_change (const TCHAR *rootdir, int inserted, struct uaedev_conf return 0; } +int hardfile_added (struct uaedev_config_info *ci) +{ + if (ci->controller_type == HD_CONTROLLER_TYPE_PCMCIA_IDE) { + return gayle_add_pcmcia_ide_unit(ci); + } else if (ci->controller_type == HD_CONTROLLER_TYPE_PCMCIA_SRAM) { + return gayle_add_pcmcia_sram_unit(ci); + } + return 0; +} + int hardfile_media_change (struct hardfiledata *hfd, struct uaedev_config_info *ci, bool inserted, bool timer) { if (!hfd) diff --git a/gayle.cpp b/gayle.cpp index 9d23e27b..35304fb7 100644 --- a/gayle.cpp +++ b/gayle.cpp @@ -1954,6 +1954,18 @@ static void alloc_ide_mem (struct ide_hdf **ide, int max) } } +static void remode_ide_unit(int ch) +{ + struct ide_hdf *ide; + + ide = idedrive[ch]; + if (!ide) + return; + hdf_hd_close(&ide->hdhfd); + scsi_free(ide->scsi); + ide->scsi = NULL; +} + static struct ide_hdf *add_ide_unit (int ch, struct uaedev_config_info *ci) { struct ide_hdf *ide; @@ -2349,6 +2361,7 @@ static int freepcmcia (int reset) pcmcia_sram->hfd.drive_empty = 1; } } + remode_ide_unit(PCMCIA_IDE_ID * 2); if (pcmcia_card) gayle_cs_change (GAYLE_CS_CCDET, 0); @@ -2709,28 +2722,28 @@ int gayle_add_ide_unit (int ch, struct uaedev_config_info *ci) return 1; } -int gayle_add_pcmcia_sram_unit (const TCHAR *path, int readonly) +int gayle_add_pcmcia_sram_unit (struct uaedev_config_info *uci) { - return initpcmcia (path, readonly, PCMCIA_SRAM, 1, NULL); + return initpcmcia (uci->rootdir, uci->readonly, PCMCIA_SRAM, 1, NULL); } -int gayle_add_pcmcia_ide_unit (const TCHAR *path, struct uaedev_config_info *uci) +int gayle_add_pcmcia_ide_unit (struct uaedev_config_info *uci) { - return initpcmcia (path, 0, PCMCIA_IDE, 1, uci); + return initpcmcia (uci->rootdir, 0, PCMCIA_IDE, 1, uci); } -int gayle_modify_pcmcia_sram_unit (const TCHAR *path, int readonly, int insert) +int gayle_modify_pcmcia_sram_unit (struct uaedev_config_info *uci, int insert) { if (insert) - return initpcmcia (path, readonly, PCMCIA_SRAM, pcmcia_sram ? 0 : 1, NULL); + return initpcmcia (uci->rootdir, uci->readonly, PCMCIA_SRAM, pcmcia_sram ? 0 : 1, NULL); else return freepcmcia (0); } -int gayle_modify_pcmcia_ide_unit (const TCHAR *path, struct uaedev_config_info *uci, int insert) +int gayle_modify_pcmcia_ide_unit (struct uaedev_config_info *uci, int insert) { if (insert) - return initpcmcia (path, 0, PCMCIA_IDE, pcmcia_sram ? 0 : 1, uci); + return initpcmcia (uci->rootdir, 0, PCMCIA_IDE, pcmcia_sram ? 0 : 1, uci); else return freepcmcia (0); } diff --git a/hardfile.cpp b/hardfile.cpp index 9234045f..a8561cf3 100644 --- a/hardfile.cpp +++ b/hardfile.cpp @@ -1683,10 +1683,10 @@ void hardfile_do_disk_change (struct uaedev_config_data *uci, bool insert) struct hardfiledata *hfd; if (uci->ci.controller_type == HD_CONTROLLER_TYPE_PCMCIA_SRAM) { - gayle_modify_pcmcia_sram_unit (uci->ci.rootdir, uci->ci.readonly, insert); + gayle_modify_pcmcia_sram_unit (&uci->ci, insert); return; } else if (uci->ci.controller_type == HD_CONTROLLER_TYPE_PCMCIA_IDE) { - gayle_modify_pcmcia_ide_unit (uci->ci.rootdir, &uci->ci, insert); + gayle_modify_pcmcia_ide_unit (&uci->ci, insert); return; } hfd = get_hardfile_data (fsid); diff --git a/include/filesys.h b/include/filesys.h index f0773249..1128bfb9 100644 --- a/include/filesys.h +++ b/include/filesys.h @@ -139,6 +139,7 @@ extern int get_native_path(uae_u32 lock, TCHAR *out); extern void hardfile_do_disk_change (struct uaedev_config_data *uci, bool insert); extern void hardfile_send_disk_change (struct hardfiledata *hfd, bool insert); extern int hardfile_media_change (struct hardfiledata *hfd, struct uaedev_config_info *ci, bool inserted, bool timer); +extern int hardfile_added (struct uaedev_config_info *ci); void hdf_hd_close(struct hd_hardfiledata *hfd); int hdf_hd_open(struct hd_hardfiledata *hfd); diff --git a/include/gayle.h b/include/gayle.h index d94b26a0..06b17d5a 100644 --- a/include/gayle.h +++ b/include/gayle.h @@ -3,10 +3,10 @@ extern void gayle_reset (int); extern void gayle_hsync (void); extern void gayle_free (void); extern int gayle_add_ide_unit (int ch, struct uaedev_config_info *ci); -extern int gayle_modify_pcmcia_sram_unit (const TCHAR *path, int readonly, int insert); -extern int gayle_modify_pcmcia_ide_unit (const TCHAR *path, struct uaedev_config_info*, int insert); -extern int gayle_add_pcmcia_sram_unit (const TCHAR *path, int readonly); -extern int gayle_add_pcmcia_ide_unit (const TCHAR *path, struct uaedev_config_info*); +extern int gayle_modify_pcmcia_sram_unit (struct uaedev_config_info*, int insert); +extern int gayle_modify_pcmcia_ide_unit (struct uaedev_config_info*, int insert); +extern int gayle_add_pcmcia_sram_unit (struct uaedev_config_info*); +extern int gayle_add_pcmcia_ide_unit (struct uaedev_config_info*); extern void gayle_free_units (void); extern void rethink_gayle (void); extern void gayle_map_pcmcia (void); diff --git a/include/memory.h b/include/memory.h index 6d983f13..eed2c722 100644 --- a/include/memory.h +++ b/include/memory.h @@ -26,6 +26,10 @@ bool init_shm (void); void free_shm (void); bool preinit_shm (void); extern bool canbang; +extern bool jit_direct_compatible_memory; + +#define Z3BASE_UAE 0x10000000 +#define Z3BASE_REAL 0x40000000 #ifdef ADDRESS_SPACE_24BIT #define MEMORY_BANKS 256 diff --git a/include/options.h b/include/options.h index 5ed5384c..d64a573a 100644 --- a/include/options.h +++ b/include/options.h @@ -285,6 +285,9 @@ struct boardromconfig struct romconfig roms[MAX_BOARD_ROMS]; }; +#define Z3MAPPING_AUTO 0 +#define Z3MAPPING_UAE 1 +#define Z3MAPPING_REAL 2 struct uae_prefs { @@ -418,6 +421,7 @@ struct uae_prefs { int floppy_random_bits_min; int floppy_random_bits_max; int floppy_auto_ext2; + int cd_speed; bool tod_hack; uae_u32 maprom; bool rom_readwrite; @@ -545,8 +549,7 @@ struct uae_prefs { bool clipboard_sharing; bool native_code; bool uae_hide_autoconfig; - bool jit_direct_compatible_memory; - bool force_0x10000000_z3; + int z3_mapping_mode; int mountitems; struct uaedev_config_data mountconfig[MOUNT_CONFIG_SIZE]; diff --git a/include/uae/dlopen.h b/include/uae/dlopen.h index 2bc818ed..04719d57 100644 --- a/include/uae/dlopen.h +++ b/include/uae/dlopen.h @@ -21,6 +21,9 @@ UAE_DLHANDLE uae_dlopen(const TCHAR *path); void *uae_dlsym(UAE_DLHANDLE handle, const char *symbol); void uae_dlclose(UAE_DLHANDLE handle); -void uae_patch_library_common(UAE_DLHANDLE handle); +/* UAE plugin support functions */ + +UAE_DLHANDLE uae_dlopen_plugin(const TCHAR *name); +void uae_dlopen_patch_common(UAE_DLHANDLE handle); #endif /* UAE_DLOPEN_H */ diff --git a/include/uae/ppc.h b/include/uae/ppc.h index 3c4a93ef..0042a973 100644 --- a/include/uae/ppc.h +++ b/include/uae/ppc.h @@ -26,6 +26,7 @@ #ifdef UAE +void uae_ppc_get_model(const TCHAR **model, uint32_t *hid1); void uae_ppc_doze(void); void uae_ppc_crash(void); void uae_ppc_cpu_reboot(void); diff --git a/include/uae/qemu.h b/include/uae/qemu.h index 22833702..97feaa43 100644 --- a/include/uae/qemu.h +++ b/include/uae/qemu.h @@ -10,7 +10,7 @@ #define QEMU_UAE_VERSION_MAJOR 3 /* The qemu-uae minor version must be at least this */ -#define QEMU_UAE_VERSION_MINOR 3 +#define QEMU_UAE_VERSION_MINOR 4 UAE_DECLARE_IMPORT_FUNCTION( void, qemu_uae_version, int *major, int *minor, int *revision) diff --git a/main.cpp b/main.cpp index 5ad0e945..e083727d 100644 --- a/main.cpp +++ b/main.cpp @@ -317,13 +317,6 @@ void fixup_cpu (struct uae_prefs *p) p->comptrustlong = 1; p->comptrustnaddr = 1; } - if (!p->jit_direct_compatible_memory && !p->comptrustbyte) { - error_log(_T("JIT direct compatible memory option is disabled, disabling JIT direct.")); - p->comptrustbyte = 1; - p->comptrustlong = 1; - p->comptrustlong = 1; - p->comptrustnaddr = 1; - } } void fixup_prefs (struct uae_prefs *p) diff --git a/memory.cpp b/memory.cpp index a519ac80..964a403b 100644 --- a/memory.cpp +++ b/memory.cpp @@ -61,7 +61,7 @@ static bool canjit (void) } static bool needmman (void) { - if (!currprefs.jit_direct_compatible_memory) + if (!jit_direct_compatible_memory) return false; #ifdef _WIN32 return true; diff --git a/newcpu.cpp b/newcpu.cpp index 1779d50e..eda4db29 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2756,6 +2756,24 @@ void NMI (void) do_interrupt (7); } +static void m68k_reset_sr(void) +{ + SET_XFLG ((regs.sr >> 4) & 1); + SET_NFLG ((regs.sr >> 3) & 1); + SET_ZFLG ((regs.sr >> 2) & 1); + SET_VFLG ((regs.sr >> 1) & 1); + SET_CFLG (regs.sr & 1); + regs.t1 = (regs.sr >> 15) & 1; + regs.t0 = (regs.sr >> 14) & 1; + regs.s = (regs.sr >> 13) & 1; + regs.m = (regs.sr >> 12) & 1; + regs.intmask = (regs.sr >> 8) & 7; + /* set stack pointer */ + if (regs.s) + m68k_areg (regs, 7) = regs.isp; + else + m68k_areg (regs, 7) = regs.usp; +} static void m68k_reset2(bool hardreset) { @@ -2766,22 +2784,8 @@ static void m68k_reset2(bool hardreset) regs.ipl = regs.ipl_pin = 0; #ifdef SAVESTATE if (isrestore ()) { + m68k_reset_sr(); m68k_setpc_normal (regs.pc); - SET_XFLG ((regs.sr >> 4) & 1); - SET_NFLG ((regs.sr >> 3) & 1); - SET_ZFLG ((regs.sr >> 2) & 1); - SET_VFLG ((regs.sr >> 1) & 1); - SET_CFLG (regs.sr & 1); - regs.t1 = (regs.sr >> 15) & 1; - regs.t0 = (regs.sr >> 14) & 1; - regs.s = (regs.sr >> 13) & 1; - regs.m = (regs.sr >> 12) & 1; - regs.intmask = (regs.sr >> 8) & 7; - /* set stack pointer */ - if (regs.s) - m68k_areg (regs, 7) = regs.isp; - else - m68k_areg (regs, 7) = regs.usp; return; } else { m68k_reset_delay = currprefs.reset_delay; @@ -5699,6 +5703,8 @@ uae_u8 *restore_cpu (uae_u8 *src) regs.chipset_latch_write = restore_u32 (); } + m68k_reset_sr(); + write_log (_T("CPU: %d%s%03d, PC=%08X\n"), model / 1000, flags & 1 ? _T("EC") : _T(""), model % 1000, regs.pc); diff --git a/od-win32/mman.cpp b/od-win32/mman.cpp index 909485b6..ede075ce 100644 --- a/od-win32/mman.cpp +++ b/od-win32/mman.cpp @@ -32,6 +32,7 @@ static uae_u32 p96base_offset; static SYSTEM_INFO si; int maxmem; uae_u32 natmem_size; +bool jit_direct_compatible_memory; static uae_u8 *virtualallocwithlock (LPVOID addr, SIZE_T size, DWORD allocationtype, DWORD protect) { @@ -346,34 +347,48 @@ static int doinit_shm (void) set_expamem_z3_hack_override(false); z3offset = 0; - if ((changed_prefs.z3autoconfig_start == 0x10000000 || changed_prefs.z3autoconfig_start == 0x40000000) && !changed_prefs.force_0x10000000_z3 && cpuboard_memorytype(&changed_prefs) != BOARD_MEMORY_BLIZZARD_12xx) { + if (changed_prefs.z3_mapping_mode != Z3MAPPING_UAE && cpuboard_memorytype(&changed_prefs) != BOARD_MEMORY_BLIZZARD_12xx) { if (1 && natmem_size > 0x40000000 && natmem_size - 0x40000000 >= (totalsize - 0x10000000 - ((changed_prefs.z3chipmem_size + align) & ~align)) && changed_prefs.z3chipmem_size <= 512 * 1024 * 1024) { - changed_prefs.z3autoconfig_start = currprefs.z3autoconfig_start = 0x40000000; - z3offset += 0x40000000 - 0x10000000 - ((changed_prefs.z3chipmem_size + align) & ~align); + changed_prefs.z3autoconfig_start = currprefs.z3autoconfig_start = Z3BASE_REAL; + z3offset += Z3BASE_REAL - Z3BASE_UAE - ((changed_prefs.z3chipmem_size + align) & ~align); if (currprefs.cpuboard_type == BOARD_WARPENGINE_A4000) z3offset += 0x01000000; set_expamem_z3_hack_override(true); startbarrier = 0; - write_log(_T("Z3 autoconfig option automatically disabled\n")); + write_log(_T("Z3 REAL mapping. JIT direct compatible.\n")); + jit_direct_compatible_memory = true; + } else if (changed_prefs.z3_mapping_mode == Z3MAPPING_AUTO) { + changed_prefs.z3autoconfig_start = currprefs.z3autoconfig_start = Z3BASE_UAE; + jit_direct_compatible_memory = true; + write_log(_T("Z3 UAE mapping.\n")); } else { - changed_prefs.z3autoconfig_start = currprefs.z3autoconfig_start = 0x10000000; + changed_prefs.z3autoconfig_start = currprefs.z3autoconfig_start = Z3BASE_REAL; + write_log(_T("Z3 REAL mapping. Not JIT direct compatible.\n")); + jit_direct_compatible_memory = false; } + } else { + currprefs.z3autoconfig_start = changed_prefs.z3autoconfig_start = Z3BASE_UAE; + jit_direct_compatible_memory = true; + write_log(_T("Z3 UAE mapping.\n")); } p96mem_offset = NULL; p96mem_size = z3rtgmem_size; p96base_offset = 0; if (changed_prefs.rtgmem_size && gfxboard_is_z3 (changed_prefs.rtgmem_type)) { - p96base_offset = natmemsize + startbarrier + z3offset; + if (changed_prefs.z3autoconfig_start == Z3BASE_UAE) + p96base_offset = natmemsize + startbarrier + z3offset; + else + p96base_offset = expansion_startaddress(natmemsize + startbarrier + z3offset, changed_prefs.rtgmem_size); } else if (changed_prefs.rtgmem_size && !gfxboard_is_z3 (changed_prefs.rtgmem_type)) { p96base_offset = getz2rtgaddr (changed_prefs.rtgmem_size); } if (p96base_offset) { - if (changed_prefs.jit_direct_compatible_memory) { + if (jit_direct_compatible_memory) { p96mem_offset = natmem_offset + p96base_offset; } else { // calculate Z3 alignment (argh, I thought only Z2 needed this..) - uae_u32 addr = 0x40000000; + uae_u32 addr = Z3BASE_REAL; if (currprefs.cpuboard_type == BOARD_WARPENGINE_A4000) { addr = expansion_startaddress(addr, 0x01000000); addr += 0x01000000; @@ -403,7 +418,7 @@ static int doinit_shm (void) write_log (_T("NATMEM: P96 special area: 0x%p-0x%p (%08x %dM)\n"), p96mem_offset, (uae_u8*)p96mem_offset + changed_prefs.rtgmem_size, changed_prefs.rtgmem_size, changed_prefs.rtgmem_size >> 20); - canbang = changed_prefs.jit_direct_compatible_memory ? 1 : 0; + canbang = jit_direct_compatible_memory ? 1 : 0; if (p96mem_size) natmem_offset_end = p96mem_offset + p96mem_size; else diff --git a/od-win32/prowizard/prowizard.vcxproj b/od-win32/prowizard/prowizard.vcxproj index c38622b0..6af03a6b 100644 --- a/od-win32/prowizard/prowizard.vcxproj +++ b/od-win32/prowizard/prowizard.vcxproj @@ -204,7 +204,7 @@ false ..\..\prowizard\include;..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreaded false true diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index a70a54d0..ea80f936 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -614,6 +614,7 @@ #define IDC_NEW_HD 1341 #define IDC_PORT0 1342 #define IDC_NEW_FSARCH 1342 +#define IDC_NEW_FS2 1342 #define IDC_PORT1 1343 #define IDC_NEW_CD 1344 #define IDC_NEW_CD2 1345 @@ -704,7 +705,7 @@ #define IDC_WINDOWEDTEXT 1512 #define IDC_MAPDRIVES_LIMIT 1512 #define IDC_HEIGHTTEXT 1513 -#define IDC_MAPDRIVES_NET2 1513 +#define IDC_CD_SPEED 1513 #define IDC_SETTINGSTEXT 1514 #define IDC_REFRESHTEXT 1515 #define IDC_SETTINGSTEXT2 1515 @@ -1168,7 +1169,6 @@ #define IDC_CD_SELECT 1807 #define IDC_FASTMEMAUTOCONFIG 1808 #define IDC_RTG_DISPLAYSELECT 1809 -#define IDC_Z3REALMAPPING 1809 #define IDC_MISCLIST 1810 #define IDC_STATENAME 1811 #define IDC_SAMPLER_STEREO 1812 @@ -1205,6 +1205,7 @@ #define IDC_DA_SLIDER 1841 #define IDC_CPUBOARD_TYPE 1842 #define IDC_CPUBOARDMEM 1843 +#define IDC_Z3MAPPING 1844 #define ID__FLOPPYDRIVES 40004 #define ID_FLOPPYDRIVES_DF0 40005 #define ID_ST_CONFIGURATION 40010 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index fbb4b545..a6979c29 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -203,13 +203,13 @@ BEGIN EDITTEXT IDC_MBRAM2,326,171,40,12,ES_CENTER | ES_READONLY CONTROL "",IDC_FASTMEM2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,251,193,68,20 EDITTEXT IDC_FASTRAM2,326,196,40,12,ES_CENTER | ES_READONLY - CONTROL "JIT Direct compatible Z3 memory mapping",IDC_Z3REALMAPPING, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,220,186,10 COMBOBOX IDC_CPUBOARD_TYPE,8,257,117,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP RTEXT "Second Z2 Fast RAM board:",IDC_STATIC,129,194,116,15,SS_CENTERIMAGE RTEXT "Accelerator board memory:",IDC_STATIC,138,257,104,15,SS_CENTERIMAGE CONTROL "",IDC_CPUBOARDMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,251,253,68,20 EDITTEXT IDC_CPUBOARDRAM,326,256,40,12,ES_CENTER | ES_READONLY + COMBOBOX IDC_Z3MAPPING,249,220,117,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Z3 mapping mode:",IDC_STATIC,149,220,93,15,SS_CENTERIMAGE END IDD_CPU DIALOGEX 0, 0, 396, 292 @@ -330,32 +330,34 @@ STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD EXSTYLE WS_EX_CONTEXTHELP FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - CONTROL "List1",IDC_VOLUMELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,1,2,393,153 - PUSHBUTTON "Add &Directory or Archive...",IDC_NEW_FS,1,157,128,15 - PUSHBUTTON "Add &Hardfile...",IDC_NEW_HF,135,157,126,15 - PUSHBUTTON "Add Ha&rd Drive...",IDC_NEW_HD,267,157,127,15 - PUSHBUTTON "Add SCSI/IDE CD Drive",IDC_NEW_CD,1,176,128,15 - PUSHBUTTON "Add SCSI Tape Drive",IDC_NEW_TAPE,135,176,126,15 - PUSHBUTTON "&Properties",IDC_EDIT,267,176,60,15 - PUSHBUTTON "Remove",IDC_REMOVE,334,176,60,15 - GROUPBOX "Options",IDC_STATIC,1,193,393,72 - CONTROL "Add PC drives at startup",IDC_MAPDRIVES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,206,201,11 + CONTROL "List1",IDC_VOLUMELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,1,2,393,149 + PUSHBUTTON "Add &Directory or Archive...",IDC_NEW_FS,1,153,128,15 + PUSHBUTTON "Add &Hardfile...",IDC_NEW_HF,135,153,126,15 + PUSHBUTTON "Add Ha&rd Drive...",IDC_NEW_HD,267,153,127,15 + PUSHBUTTON "Add SCSI/IDE CD Drive",IDC_NEW_CD,1,172,128,15 + PUSHBUTTON "Add SCSI Tape Drive",IDC_NEW_TAPE,135,172,126,15 + PUSHBUTTON "&Properties",IDC_EDIT,267,172,60,15 + PUSHBUTTON "Remove",IDC_REMOVE,334,172,60,15 + GROUPBOX "Options",IDC_STATIC,1,189,393,66 + CONTROL "Add PC drives at startup",IDC_MAPDRIVES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,200,201,11 CONTROL "Include removable drives..",IDC_MAPDRIVES_REMOVABLE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,219,201,11 - CONTROL "Include network drives..",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,233,201,11 - CONTROL "CDFS automount CD/DVD drives",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,247,201,11 - CONTROL "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,222,206,167,11 - CONTROL "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,222,219,167,11 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,213,201,11 + CONTROL "Include network drives..",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,227,201,11 + CONTROL "CDFS automount CD/DVD drives",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,241,201,11 + CONTROL "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,222,200,167,11 + CONTROL "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,222,213,167,11 CONTROL "Automount removable drives [] Windows side insert or removal will immediately mount/remove it on Amiga side.",IDC_MAPDRIVES_AUTO, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,222,233,167,11 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,222,227,167,11 CONTROL "Limit size of directory drives to 1G [] Workaround for example old installers that calculate free space incorrectly if drive is large.",IDC_MAPDRIVES_LIMIT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,222,247,167,11 - GROUPBOX "Optical media options",IDC_STATIC,1,269,393,47 - LTEXT "CD drive/image",IDC_STATIC,5,283,70,10,SS_CENTERIMAGE - PUSHBUTTON "Select image file",IDC_CD_SELECT,177,281,98,15 - COMBOBOX IDC_CD_TYPE,282,282,71,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Eject",IDC_CD_EJECT,360,281,30,15 - COMBOBOX IDC_CD_TEXT,5,300,386,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,222,241,167,11 + GROUPBOX "Optical media options",IDC_STATIC,1,256,393,59 + LTEXT "CD drive/image",IDC_STATIC,5,268,70,10,SS_CENTERIMAGE + PUSHBUTTON "Select image file",IDC_CD_SELECT,177,266,98,15 + COMBOBOX IDC_CD_TYPE,282,267,71,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Eject",IDC_CD_EJECT,360,266,30,15 + COMBOBOX IDC_CD_TEXT,5,285,386,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + CONTROL "CDTV/CDTV-CR/CD32 turbo CD read speed",IDC_CD_SPEED, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,301,201,11 END IDD_SOUND DIALOGEX 0, 0, 396, 288 diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 3b4edc31..97a82298 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -6185,6 +6185,16 @@ HMODULE WIN32_LoadLibrary2 (const TCHAR *name) return m; } +HMODULE uae_dlopen_plugin(const TCHAR *name) +{ + HMODULE h; + TCHAR path[MAX_DPATH]; + _tcscpy(path, name); + _tcscat(path, _T(".dll")); + h = WIN32_LoadLibrary(path); + return h; +} + int isdllversion (const TCHAR *name, int version, int revision, int subver, int subrev) { DWORD dwVersionHandle, dwFileVersionInfoSize; diff --git a/od-win32/win32.h b/od-win32/win32.h index 2e19104f..b1e5f7fb 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("22") +#define WINUAEBETA _T("23") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2014, 10, 25) +#define WINUAEDATE MAKEBD(2014, 11, 1) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index f86ae0a8..ac35e424 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -7430,7 +7430,7 @@ static void enable_for_memorydlg (HWND hDlg) ew (hDlg, IDC_FASTMEM2, fast); ew (hDlg, IDC_FASTRAM2, fast); ew (hDlg, IDC_FASTMEMAUTOCONFIG, fast); - ew (hDlg, IDC_Z3REALMAPPING, z3); + ew (hDlg, IDC_Z3MAPPING, z3); ew (hDlg, IDC_FASTTEXT, fast); ew (hDlg, IDC_GFXCARDTEXT, z3); ew (hDlg, IDC_MBRAM1, z3); @@ -8260,7 +8260,11 @@ static INT_PTR CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA SendDlgItemMessage (hDlg, IDC_MBMEM1, TBM_SETRANGE, TRUE, MAKELONG (MIN_MB_MEM, MAX_MBL_MEM)); SendDlgItemMessage (hDlg, IDC_MBMEM2, TBM_SETRANGE, TRUE, MAKELONG (MIN_MB_MEM, MAX_MBH_MEM)); CheckDlgButton(hDlg, IDC_FASTMEMAUTOCONFIG, workprefs.fastmem_autoconfig); - CheckDlgButton(hDlg, IDC_Z3REALMAPPING, workprefs.jit_direct_compatible_memory); + SendDlgItemMessage (hDlg, IDC_Z3MAPPING, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage (hDlg, IDC_Z3MAPPING, CB_ADDSTRING, 0, (LPARAM)_T("Automatic (*)")); + SendDlgItemMessage(hDlg, IDC_Z3MAPPING, CB_ADDSTRING, 0, (LPARAM)_T("UAE")); + SendDlgItemMessage(hDlg, IDC_Z3MAPPING, CB_ADDSTRING, 0, (LPARAM)_T("Real")); + SendDlgItemMessage (hDlg, IDC_Z3MAPPING, CB_SETCURSEL, workprefs.z3_mapping_mode, 0); SendDlgItemMessage (hDlg, IDC_CPUBOARD_TYPE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage (hDlg, IDC_CPUBOARD_TYPE, CB_ADDSTRING, 0, (LPARAM)_T("-")); SendDlgItemMessage(hDlg, IDC_CPUBOARD_TYPE, CB_ADDSTRING, 0, (LPARAM)_T("Blizzard 1230 IV")); @@ -8280,7 +8284,6 @@ static INT_PTR CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA case WM_USER: workprefs.fastmem_autoconfig = ischecked (hDlg, IDC_FASTMEMAUTOCONFIG); - workprefs.jit_direct_compatible_memory = ischecked (hDlg, IDC_Z3REALMAPPING); fix_values_memorydlg (); values_to_memorydlg (hDlg); enable_for_memorydlg (hDlg); @@ -8292,6 +8295,12 @@ static INT_PTR CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA if (HIWORD (wParam) == CBN_SELCHANGE || HIWORD (wParam) == CBN_KILLFOCUS) { switch (LOWORD (wParam)) { + case IDC_Z3MAPPING: + v = SendDlgItemMessage (hDlg, IDC_Z3MAPPING, CB_GETCURSEL, 0, 0L); + if (v != CB_ERR) { + workprefs.z3_mapping_mode = v; + } + break; case IDC_CPUBOARD_TYPE: v = SendDlgItemMessage (hDlg, IDC_CPUBOARD_TYPE, CB_GETCURSEL, 0, 0L); if (v != CB_ERR) { @@ -8309,7 +8318,6 @@ static INT_PTR CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA } } workprefs.fastmem_autoconfig = ischecked (hDlg, IDC_FASTMEMAUTOCONFIG); - workprefs.jit_direct_compatible_memory = ischecked (hDlg, IDC_Z3REALMAPPING); recursive--; break; @@ -11000,7 +11008,10 @@ static void new_hardfile (HWND hDlg, int entry) uci = add_filesys_config (&workprefs, entry, &ci); if (uci) { struct hardfiledata *hfd = get_hardfile_data (uci->configoffset); - hardfile_media_change (hfd, &ci, true, false); + if (hfd) + hardfile_media_change (hfd, &ci, true, false); + else + hardfile_added(&ci); } } @@ -11011,7 +11022,10 @@ static void new_harddrive (HWND hDlg, int entry) uci = add_filesys_config (&workprefs, entry, ¤t_hfdlg.ci); if (uci) { struct hardfiledata *hfd = get_hardfile_data (uci->configoffset); - hardfile_media_change (hfd, ¤t_hfdlg.ci, true, false); + if (hfd) + hardfile_media_change (hfd, ¤t_hfdlg.ci, true, false); + else + hardfile_added(¤t_hfdlg.ci); } } @@ -11218,6 +11232,9 @@ static int harddiskdlg_button (HWND hDlg, WPARAM wParam) workprefs.win32_norecyclebin = ischecked (hDlg, IDC_NORECYCLEBIN); break; + case IDC_CD_SPEED: + workprefs.cd_speed = ischecked (hDlg, IDC_CD_SPEED) ? 0 : 100; + break; } return 0; } @@ -11269,6 +11286,7 @@ static INT_PTR CALLBACK HarddiskDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPA CheckDlgButton (hDlg, IDC_NOUAEFSDB, workprefs.filesys_no_uaefsdb); CheckDlgButton (hDlg, IDC_NORECYCLEBIN, workprefs.win32_norecyclebin); CheckDlgButton (hDlg, IDC_MAPDRIVES_LIMIT, workprefs.filesys_limit != 0); + CheckDlgButton (hDlg, IDC_CD_SPEED, workprefs.cd_speed == 0); InitializeListView (hDlg); setautocomplete (hDlg, IDC_CD_TEXT); addhistorymenu (hDlg, workprefs.cdslots[0].name, IDC_CD_TEXT, HISTORY_CD, true); diff --git a/od-win32/winuae_msvc11/winuae_msvc.vcxproj b/od-win32/winuae_msvc11/winuae_msvc.vcxproj index b17339e3..17aacf3c 100644 --- a/od-win32/winuae_msvc11/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc11/winuae_msvc.vcxproj @@ -480,7 +480,7 @@ true Sync Default - MultiThreadedDLL + MultiThreaded false true NotSet @@ -505,12 +505,12 @@ 0x0409 - ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng15.lib;lglcd.lib;wtsapi32.lib;enet_x64.lib;prowizard_x64.lib;lzmalib.lib;libFLAC_static.lib;avrt.lib;hid.lib;Iphlpapi.lib;luastatic.lib;libmpeg2_ff.lib;softfloat_x64.lib;%(AdditionalDependencies) + ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng15.lib;lglcd.lib;wtsapi32.lib;enet_x64.lib;prowizard_x64.lib;lzmalib.lib;libFLAC_static.lib;avrt.lib;hid.lib;Iphlpapi.lib;luastatic.lib;libmpeg2_ff.lib;softfloat.lib;%(AdditionalDependencies) NotSet $(OutDir)$(TargetName)$(TargetExt) true %(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\ - LIBCMT;%(IgnoreSpecificDefaultLibraries) + MSVCRT.lib;%(IgnoreSpecificDefaultLibraries) wpcap.dll;packet.dll;d3dx9_43.dll;openal32.dll;portaudio_x64.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll;Dwmapi.dll;Iphlpapi.dll;%(DelayLoadDLLs) true $(Platform)\$(Configuration)\winuae.pdb @@ -552,7 +552,7 @@ true Sync Default - MultiThreadedDebugDLL + MultiThreaded false false NotSet @@ -577,12 +577,12 @@ 0x0409 - ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng15.lib;lglcd.lib;wtsapi32.lib;enet_x64.lib;prowizard_x64.lib;lzmalib.lib;libFLAC_static.lib;avrt.lib;hid.lib;Iphlpapi.lib;luastatic.lib;libmpeg2_ff.lib;softfloat_x64.lib;%(AdditionalDependencies) + ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng15.lib;lglcd.lib;wtsapi32.lib;enet_x64.lib;prowizard_x64.lib;lzmalib.lib;libFLAC_static.lib;avrt.lib;hid.lib;Iphlpapi.lib;luastatic.lib;libmpeg2_ff.lib;softfloat.lib;%(AdditionalDependencies) NotSet $(OutDir)$(TargetName)$(TargetExt) true %(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\ - LIBCMT;%(IgnoreSpecificDefaultLibraries) + %(IgnoreSpecificDefaultLibraries) wpcap.dll;packet.dll;d3dx9_43.dll;openal32.dll;portaudio_x64.dll;ws2_32.dll;msacm32.dll;wtsapi32.dll;dsound.dll;avrt.dll;Dwmapi.lib;%(DelayLoadDLLs) true $(Platform)\$(Configuration)\winuae.pdb @@ -821,6 +821,7 @@ + diff --git a/od-win32/winuae_msvc11/winuae_msvc.vcxproj.filters b/od-win32/winuae_msvc11/winuae_msvc.vcxproj.filters index 70db4f03..cee2a4fe 100644 --- a/od-win32/winuae_msvc11/winuae_msvc.vcxproj.filters +++ b/od-win32/winuae_msvc11/winuae_msvc.vcxproj.filters @@ -709,6 +709,9 @@ common + + qemu + diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 312730da..45e99641 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -18,6 +18,26 @@ Things that may happen in 2015: - restore only single input target to default. +Beta 23: + +- Dragging vhd file to harddrives panel now adds it as a HDF, not a directory if it does not contain any known + filesystem or RDB identifiers. +- PCMCIA IDE was always mounted without drive since drive attribute update long time ago. +- PCMCIA IDE and SRAM can be added (card inserted) after emulation has been started. +- Replaced "JIT direct compatible" option in memory panel with more useful Z3 mapping option: + Auto = Use OS mapping if possible, fall back to UAE hack if JIT direct enabled and not enough adddress space. + UAE = Always use UAE hack mapping (0x10000000). NOTE: not compatible with non-m68k operating systems. This mode + was always forced until 282b1. + Real = Always use OS mapping (0x40000000 with alignment support), disable JIT direct if not enough address space. +- Fixed missing graphics in Disposable Hero title screen in non-cycle exact modes. +- Load config with statefile set, load another config without statefile, GUI shows no statefile selected but + when starting emulation statefile was still loaded. +- CDTV-CR CD read speed is now limited to 1x/2x. +- Added CD turbo data read speed mode, affects CDTV/CDTV-CR/CD32 emulation only. SCSI CD is always in turbo mode. + Checkbox in CD/Harddrives panel. +- QEMU PPC module update, now all extra dependencies are statically linked. External dlls are not + needed anymore (whole plugins\qemu can be deleted). Must be located at \plugins\qemu-uae.dll + Beta 22: - CDTV-CR CD unit was initialized even when CDTV-CR emulation was not enabled. Broke CD access on configurations diff --git a/ppc/ppc.cpp b/ppc/ppc.cpp index 8f8b7681..1b60bec0 100644 --- a/ppc/ppc.cpp +++ b/ppc/ppc.cpp @@ -29,16 +29,6 @@ #define TRACE(format, ...) write_log(_T("PPC: ") format, ## __VA_ARGS__) -#ifdef WINUAE -#ifdef WIN64 -#define QEMU_LIBRARY_PATH _T("qemu\\x64\\qemu-uae.dll") -#else -#define QEMU_LIBRARY_PATH _T("qemu\\qemu-uae.dll") -#endif -#else -#define QEMU_LIBRARY_PATH _T("qemu-uae.dll") -#endif - #if SPINLOCK_DEBUG static volatile int spinlock_cnt; #endif @@ -110,7 +100,6 @@ int ppc_cycle_count; static volatile bool ppc_access; static volatile int ppc_cpu_lock_state; static bool ppc_init_done; -static bool ppc_cpu_init_done; static int ppc_implementation; static bool ppc_paused; @@ -133,20 +122,12 @@ static void PPCCALL dummy_ppc_cpu_run_single(int count) { } //static uint64_t PPCCALL dummy_ppc_cpu_get_dec(void) { return 0; } //static void PPCCALL dummy_ppc_cpu_do_dec(int value) { } -static void PPCCALL dummy_ppc_cpu_version(int *major, int *minor, int *revision) -{ - *major = QEMU_UAE_VERSION_MAJOR; - *minor = QEMU_UAE_VERSION_MINOR; - *revision = 0; -} - static void PPCCALL dummy_ppc_cpu_pause(int pause) { } /* Functions typedefs for PPC implementation */ -typedef void (PPCCALL *ppc_cpu_version_function)(int *major, int *minor, int *revision); typedef bool (PPCCALL *ppc_cpu_init_function)(const char *model, uint32_t hid1); typedef bool (PPCCALL *ppc_cpu_init_pvr_function)(uint32_t pvr); typedef void (PPCCALL *ppc_cpu_close_function)(void); @@ -170,9 +151,9 @@ static struct impl { /* Common */ ppc_cpu_atomic_raise_ext_exception_function atomic_raise_ext_exception; ppc_cpu_atomic_cancel_ext_exception_function atomic_cancel_ext_exception; - ppc_cpu_run_continuous_function run_continuous; /* PearPC */ + ppc_cpu_run_continuous_function run_continuous; ppc_cpu_init_pvr_function init_pvr; ppc_cpu_pause_function pause; ppc_cpu_close_function close; @@ -183,7 +164,6 @@ static struct impl { ppc_cpu_do_dec_function do_dec; /* QEMU */ - ppc_cpu_version_function version; ppc_cpu_init_function init; ppc_cpu_map_memory_function map_memory; ppc_cpu_check_state_function check_state; @@ -237,7 +217,7 @@ static bool load_qemu_implementation(void) write_log(_T("PPC: Loading QEmu implementation\n")); memset(&impl, 0, sizeof(impl)); - UAE_DLHANDLE handle = uae_dlopen(QEMU_LIBRARY_PATH); + UAE_DLHANDLE handle = uae_qemu_uae_init(); if (!handle) { gui_message(_T("PPC: Error loading qemu-uae library\n")); return false; @@ -246,49 +226,23 @@ static bool load_qemu_implementation(void) /* Retrieve function pointers from library */ - impl.version = (ppc_cpu_version_function) uae_dlsym(handle, "ppc_cpu_version"); - //impl.init = (ppc_cpu_init_function) uae_dlsym(handle, "ppc_cpu_init"); impl.init = (ppc_cpu_init_function) uae_dlsym(handle, "ppc_cpu_init"); //impl.free = (ppc_cpu_free_function) uae_dlsym(handle, "ppc_cpu_free"); //impl.stop = (ppc_cpu_stop_function) uae_dlsym(handle, "ppc_cpu_stop"); impl.external_interrupt = (qemu_uae_ppc_external_interrupt_function) uae_dlsym(handle, "qemu_uae_ppc_external_interrupt"); impl.map_memory = (ppc_cpu_map_memory_function) uae_dlsym(handle, "ppc_cpu_map_memory"); - //impl.set_pc = (ppc_cpu_set_pc_function) uae_dlsym(handle, "ppc_cpu_set_pc"); impl.run_continuous = (ppc_cpu_run_continuous_function) uae_dlsym(handle, "ppc_cpu_run_continuous"); - //impl.run_single = (ppc_cpu_run_single_function) uae_dlsym(handle, "ppc_cpu_run_single"); - //impl.get_dec = (ppc_cpu_get_dec_function) uae_dlsym(handle, "ppc_cpu_get_dec"); - //impl.do_dec = (ppc_cpu_do_dec_function) uae_dlsym(handle, "ppc_cpu_do_dec"); - //impl.pause = (ppc_cpu_pause_function) uae_dlsym(handle, "ppc_cpu_pause"); impl.check_state = (ppc_cpu_check_state_function) uae_dlsym(handle, "ppc_cpu_check_state"); impl.set_state = (ppc_cpu_set_state_function) uae_dlsym(handle, "ppc_cpu_set_state"); impl.reset = (ppc_cpu_reset_function) uae_dlsym(handle, "ppc_cpu_reset"); impl.in_cpu_thread = (qemu_uae_ppc_in_cpu_thread_function) uae_dlsym(handle, "qemu_uae_ppc_in_cpu_thread"); impl.lock = (qemu_uae_lock_function) uae_dlsym(handle, "qemu_uae_lock"); - /* Check major version (=) and minor version (>=) */ + // FIXME: not needed, handled internally by uae_dlopen_plugin + // uae_dlopen_patch_common(handle); - int major = 0, minor = 0, revision = 0; - if (impl.version) { - impl.version(&major, &minor, &revision); - } - if (major != QEMU_UAE_VERSION_MAJOR) { - gui_message(_T("PPC: Wanted qemu-uae version %d.x (got %d.x)\n"), - QEMU_UAE_VERSION_MAJOR, major); - return false; - } - if (minor < QEMU_UAE_VERSION_MINOR) { - gui_message(_T("PPC: Wanted qemu-uae version >= %d.%d (got %d.%d)\n"), - QEMU_UAE_VERSION_MAJOR, QEMU_UAE_VERSION_MINOR, - major, minor); - return false; - } - - // FIXME: not needed, handled internally by uae_dlopen_plugin - // uae_dlopen_patch_common(handle); - - uae_patch_library_common(handle); - uae_patch_library_ppc(handle); - return true; + uae_patch_library_ppc(handle); + return true; #else return false; #endif @@ -511,52 +465,53 @@ void ppc_map_banks(uae_u32 start, uae_u32 size, const TCHAR *name, void *addr, b free((void*)r.name); } -static void cpu_init(void) +void uae_ppc_get_model(const TCHAR **model, uint32_t *hid1) { - const TCHAR *model; - uint32_t hid1; - if (currprefs.ppc_model[0]) { /* Override PPC CPU model. See qemu/target-ppc/cpu-models.c for * a list of valid CPU model identifiers */ - model = currprefs.ppc_model; + *model = currprefs.ppc_model; } else { /* Set default CPU model based on accelerator board */ if (currprefs.cpuboard_type == BOARD_BLIZZARDPPC) { - model = _T("603ev"); + *model = _T("603ev"); } else { - model = _T("604e"); + *model = _T("604e"); } } if (currprefs.cpuboard_type == BOARD_BLIZZARDPPC) { - hid1 = 0xc0000000; // 4x + *hid1 = 0xc0000000; // 4x } else { - hid1 = 0xa0000000; // 4x + *hid1 = 0xa0000000; // 4x } +} - if (impl.init) { - char *models = ua(model); - impl.init(models, hid1); - free(models); - } else if (impl.init_pvr) { +static void cpu_init(void) +{ + if (using_pearpc()) { + const TCHAR *model; + uint32_t hid1; + uae_ppc_get_model(&model, &hid1); uint32_t pvr = 0; if (_tcsicmp(model, _T("603ev")) == 0) { pvr = BLIZZPPC_PVR; - } - else if (_tcsicmp(model, _T("604e")) == 0) { + } else if (_tcsicmp(model, _T("604e")) == 0) { pvr = CSPPC_PVR; - } - else { + } else { pvr = CSPPC_PVR; write_log(_T("PPC: Unrecognized model \"%s\", using PVR 0x%08x\n"), model, pvr); } write_log(_T("PPC: Calling ppc_cpu_init with PVR 0x%08x\n"), pvr); impl.init_pvr(pvr); + return; } + /* QEMU: CPU has already been initialized by qemu_uae_init */ } static void uae_ppc_cpu_reset(void) { + static bool ppc_cpu_init_done; + TRACE(_T("uae_ppc_cpu_reset\n")); initialize(); @@ -584,10 +539,12 @@ static void uae_ppc_cpu_reset(void) static void *ppc_thread(void *v) { - uae_ppc_cpu_reset(); - impl.run_continuous(); + if (using_qemu()) { + write_log(_T("PPC: Warning - ppc_thread started with QEMU impl\n")); + } else { + uae_ppc_cpu_reset(); + impl.run_continuous(); - if (using_pearpc()) { if (ppc_state == PPC_STATE_ACTIVE || ppc_state == PPC_STATE_SLEEP) ppc_state = PPC_STATE_STOP; write_log(_T("ppc_cpu_run() exited.\n")); @@ -797,7 +754,14 @@ void uae_ppc_cpu_reboot(void) if (!ppc_thread_running) { write_log(_T("Starting PPC thread.\n")); ppc_thread_running = true; - uae_start_thread(NULL, ppc_thread, NULL, NULL); + if (using_qemu()) { + uae_ppc_cpu_reset(); + //qemu_uae_ppc_start(); + impl.set_state(PPC_CPU_STATE_RUNNING); + //set_and_wait_for_state(PPC_CPU_STATE_RUNNING, 0); + } else { + uae_start_thread(NULL, ppc_thread, NULL, NULL); + } } else if (using_qemu()) { write_log(_T("PPC: Thread already running, resetting\n")); uae_ppc_cpu_reset(); diff --git a/qemuvga/qemu.cpp b/qemuvga/qemu.cpp new file mode 100644 index 00000000..6045bc2a --- /dev/null +++ b/qemuvga/qemu.cpp @@ -0,0 +1,115 @@ +#include "sysconfig.h" +#include "sysdeps.h" + +#include "uae/dlopen.h" +#include "uae/ppc.h" +#include "uae/qemu.h" + +UAE_DEFINE_IMPORT_FUNCTION(qemu_uae_version) +UAE_DEFINE_IMPORT_FUNCTION(qemu_uae_init) +UAE_DEFINE_IMPORT_FUNCTION(qemu_uae_start) + +UAE_DEFINE_IMPORT_FUNCTION(qemu_uae_slirp_init) +UAE_DEFINE_IMPORT_FUNCTION(qemu_uae_slirp_input) + +UAE_DEFINE_IMPORT_FUNCTION(qemu_uae_ppc_init) +UAE_DEFINE_IMPORT_FUNCTION(qemu_uae_ppc_in_cpu_thread) + +static void init_ppc(UAE_DLHANDLE handle) +{ + UAE_IMPORT_FUNCTION(handle, qemu_uae_ppc_init); + UAE_IMPORT_FUNCTION(handle, qemu_uae_ppc_in_cpu_thread); + + if (qemu_uae_ppc_init) { + const TCHAR *model; + uint32_t hid1; + uae_ppc_get_model(&model, &hid1); + char *model_s = ua(model); + qemu_uae_ppc_init(model_s, hid1); + free(model_s); + } +} + +#ifndef WINUAE +static void init_slirp(UAE_DLHANDLE handle) +{ + UAE_IMPORT_FUNCTION(handle, qemu_uae_slirp_init); + UAE_IMPORT_FUNCTION(handle, qemu_uae_slirp_input); + UAE_EXPORT_FUNCTION(handle, uae_slirp_output); + + if (qemu_uae_slirp_init) { + qemu_uae_slirp_init(); + } +} +#endif + +UAE_DLHANDLE uae_qemu_uae_init(void) +{ + static bool initialized; + static UAE_DLHANDLE handle; + if (initialized) { + return handle; + } + initialized = true; + + handle = uae_dlopen(_T("qemu-uae")); + if (!handle) { + gui_message(_T("Error loading qemu-uae plugin\n")); + return handle; + } + write_log(_T("Loaded qemu-uae library at %p\n"), handle); + + /* Check major version (=) and minor version (>=) */ + + qemu_uae_version = (qemu_uae_version_function) uae_dlsym( + handle, "qemu_uae_version"); + + int major = 0, minor = 0, revision = 0; + if (qemu_uae_version) { + qemu_uae_version(&major, &minor, &revision); + } + if (major != QEMU_UAE_VERSION_MAJOR) { + gui_message( + _T("PPC: Wanted qemu-uae version %d.x (got %d.x)\n"), + QEMU_UAE_VERSION_MAJOR, major); + handle = NULL; + return handle; + } + if (minor < QEMU_UAE_VERSION_MINOR) { + gui_message( + _T("PPC: Wanted qemu-uae version >= %d.%d (got %d.%d)\n"), + QEMU_UAE_VERSION_MAJOR, QEMU_UAE_VERSION_MINOR, + major, minor); + handle = NULL; + return handle; + } + + /* Retrieve function pointers from library */ + + UAE_IMPORT_FUNCTION(handle, qemu_uae_init); + UAE_IMPORT_FUNCTION(handle, qemu_uae_start); + + if (qemu_uae_init) { + qemu_uae_init(); + } else { + gui_message(_T("qemu_uae_init not found")); + handle = NULL; + return handle; + } + + init_ppc(handle); + +#ifndef WINUAE + init_slirp(handle); +#endif + + if (qemu_uae_start) { + qemu_uae_start(); + } else { + gui_message(_T("qemu_uae_start not found")); + handle = NULL; + return handle; + } + + return handle; +} diff --git a/zfile.cpp b/zfile.cpp index 02f1e73c..34407a86 100644 --- a/zfile.cpp +++ b/zfile.cpp @@ -319,6 +319,8 @@ int zfile_gettype (struct zfile *z) return ZFILE_HDF; if (strcasecmp (ext, _T("hdz")) == 0) return ZFILE_HDF; + if (strcasecmp (ext, _T("vhd")) == 0) + return ZFILE_HDF; } return ZFILE_UNKNOWN; }