From d8ab80e3a3e80c903be12974a07299be0083c3bd Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 15 Nov 2014 15:16:54 +0200 Subject: [PATCH] 2900b24 --- a2065.cpp | 4 +- a2091.cpp | 2 +- akiko.cpp | 28 +-- cdtv.cpp | 4 +- cfgfile.cpp | 61 +++++- cpuboard.cpp | 11 +- expansion.cpp | 46 +++-- filesys.cpp | 6 +- flashrom.cpp | 6 +- gencpu.cpp | 25 +-- gfxboard.cpp | 18 +- hardfile.cpp | 6 +- include/gui.h | 2 +- include/memory.h | 3 +- include/newcpu.h | 7 +- include/options.h | 2 + main.cpp | 30 ++- memory.cpp | 24 +++ newcpu.cpp | 97 +++++---- od-win32/ahidsound_dsonly.cpp | 2 +- od-win32/avioutput.cpp | 185 +++++++++++------- od-win32/dinput.cpp | 13 +- od-win32/resources/resource.h | 1 + od-win32/resources/winuae.rc | 5 +- od-win32/sysconfig.h | 6 +- od-win32/win32.cpp | 9 +- od-win32/win32.h | 4 +- od-win32/win32gui.cpp | 11 +- od-win32/winuae_msvc11/winuae_msvc.vcxproj | 1 + .../winuae_msvc11/winuae_msvc.vcxproj.filters | 3 + ppc/ppc.cpp | 7 +- 31 files changed, 402 insertions(+), 227 deletions(-) diff --git a/a2065.cpp b/a2065.cpp index 0439f232..1cde6348 100644 --- a/a2065.cpp +++ b/a2065.cpp @@ -858,7 +858,7 @@ static void REGPARAM2 a2065_bput (uaecptr addr, uae_u32 b) b &= 0xff; addr &= 65535; if (addr == 0x48 && !configured) { - map_banks (&a2065_bank, b, 0x10000 >> 16, 0x10000); + map_banks_z2 (&a2065_bank, b, 0x10000 >> 16); configured = b; expamem_next(&a2065_bank, NULL); return; @@ -935,7 +935,7 @@ static addrbank *a2065_config (void) if (configured) { if (configured != 0xff) - map_banks (&a2065_bank, configured, 0x10000 >> 16, 0x10000); + map_banks_z2 (&a2065_bank, configured, 0x10000 >> 16); } else { /* KS autoconfig handles the rest */ return &a2065_bank; diff --git a/a2091.cpp b/a2091.cpp index 3a7901d6..87bca624 100644 --- a/a2091.cpp +++ b/a2091.cpp @@ -1643,7 +1643,7 @@ static void REGPARAM2 dmac_bput (struct wd_state *wd, uaecptr addr, uae_u32 b) if (wd->autoconfig) { addrbank *ab = wd == &wd_a2091 ? &dmaca2091_bank : &dmaca2091_2_bank; if (addr == 0x48 && !wd->configured) { - map_banks (ab, b, 0x10000 >> 16, 0x10000); + map_banks_z2 (ab, b, 0x10000 >> 16); wd->configured = 1; expamem_next (ab, NULL); return; diff --git a/akiko.cpp b/akiko.cpp index 49e17f91..27d0a51a 100644 --- a/akiko.cpp +++ b/akiko.cpp @@ -57,32 +57,34 @@ static void irq (void) * */ -#define NVRAM_SIZE 1024 -static uae_u8 cd32_nvram[NVRAM_SIZE]; +static uae_u8 *cd32_nvram; static void *cd32_eeprom; static uae_u8 cd32_i2c_direction; static bool cd32_i2c_data_scl, cd32_i2c_data_sda; +static struct zfile *flashfile; static void nvram_read (void) { - struct zfile *f; - + zfile_fclose(flashfile); + flashfile = NULL; eeprom_free(cd32_eeprom); cd32_eeprom = NULL; cd32_i2c_data_scl = cd32_i2c_data_sda = true; cd32_i2c_direction = 0; if (!currprefs.cs_cd32nvram) return; - memset(cd32_nvram, 0, sizeof(cd32_nvram)); - f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL); - if (!f) - f = zfile_fopen (currprefs.flashfile, _T("rb"), ZFD_NORMAL); - if (f) { - int size = zfile_fread(cd32_nvram, 1, NVRAM_SIZE, f); - if (size < NVRAM_SIZE) - zfile_fwrite(cd32_nvram + size, 1, NVRAM_SIZE - size, f); + if (!cd32_nvram) + cd32_nvram = xmalloc(uae_u8, currprefs.cs_cd32nvram_size); + memset(cd32_nvram, 0, currprefs.cs_cd32nvram_size); + flashfile = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL); + if (!flashfile) + flashfile = zfile_fopen (currprefs.flashfile, _T("wb"), 0); + if (flashfile) { + int size = zfile_fread(cd32_nvram, 1, currprefs.cs_cd32nvram_size, flashfile); + if (size < currprefs.cs_cd32nvram_size) + zfile_fwrite(cd32_nvram + size, 1, currprefs.cs_cd32nvram_size - size, flashfile); } - cd32_eeprom = eeprom_new(cd32_nvram, NVRAM_SIZE, f); + cd32_eeprom = eeprom_new(cd32_nvram, currprefs.cs_cd32nvram_size, flashfile); } static void akiko_nvram_write (int offset, uae_u32 v) diff --git a/cdtv.cpp b/cdtv.cpp index 52a28030..e1222cae 100644 --- a/cdtv.cpp +++ b/cdtv.cpp @@ -1484,7 +1484,7 @@ static void REGPARAM2 dmac_bput (uaecptr addr, uae_u32 b) addr &= 65535; b &= 0xff; if (addr == 0x48) { - map_banks (&dmac_bank, b, 0x10000 >> 16, 0x10000); + map_banks_z2 (&dmac_bank, b, 0x10000 >> 16); configured = b; expamem_next(&dmac_bank, NULL); return; @@ -1704,7 +1704,7 @@ addrbank *cdtv_init (void) void cdtv_check_banks (void) { if (configured > 0) - map_banks (&dmac_bank, configured, 0x10000 >> 16, 0x10000); + map_banks_z2 (&dmac_bank, configured, 0x10000 >> 16); } #ifdef SAVESTATE diff --git a/cfgfile.cpp b/cfgfile.cpp index 9dbc477d..1e3dd3fa 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -264,6 +264,12 @@ static const TCHAR *z3mapping[] = { _T("real"), NULL }; +static const TCHAR *uaescsidevmodes[] = { + _T("original"), + _T("rename_scsi"), + 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"), @@ -1461,6 +1467,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite_bool (f, _T("cd32cd"), p->cs_cd32cd); cfgfile_dwrite_bool (f, _T("cd32c2p"), p->cs_cd32c2p); cfgfile_dwrite_bool(f, _T("cd32nvram"), p->cs_cd32nvram); + cfgfile_dwrite (f, _T("cd32nvram_size"), _T("%d"), p->cs_cd32nvram_size / 1024); cfgfile_dwrite_bool(f, _T("cd32fmv"), p->cs_cd32fmv); cfgfile_dwrite_bool(f, _T("cdtvcd"), p->cs_cdtvcd); cfgfile_dwrite_bool(f, _T("cdtv-cr"), p->cs_cdtvcr); @@ -1588,6 +1595,8 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite (f, _T("filesys_max_size"), _T("%d"), p->filesys_limit); cfgfile_dwrite (f, _T("filesys_max_name_length"), _T("%d"), p->filesys_max_name); cfgfile_dwrite (f, _T("filesys_max_file_size"), _T("%d"), p->filesys_max_file_size); + cfgfile_dwrite_str (f, _T("scsidev_mode"), uaescsidevmodes[p->uaescsidevmode]); + #endif write_inputdevice_config (p, f); } @@ -3686,6 +3695,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH return 1; if (cfgfile_intval (option, value, _T("cachesize"), &p->cachesize, 1) + || cfgfile_intval (option, value, _T("cd32nvram_size"), &p->cs_cd32nvram_size, 1024) || cfgfile_intval (option, value, _T("chipset_hacks"), &p->cs_hacks, 1) || cfgfile_intval (option, value, _T("serial_stopbits"), &p->serial_stopbits, 1) || cfgfile_intval (option, value, _T("cpu060_revision"), &p->cpu060_revision, 1) @@ -3743,6 +3753,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH || 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_strval (option, value, _T("scsidev_mode"), &p->uaescsidevmode, uaescsidevmodes, 0) || cfgfile_strboolval (option, value, _T("comp_flushmode"), &p->comp_hardflush, flushmode, 0)) return 1; @@ -5457,6 +5468,7 @@ void default_prefs (struct uae_prefs *p, int type) p->cs_deniserev = -1; p->cs_mbdmac = 0; p->cs_cd32c2p = p->cs_cd32cd = p->cs_cd32nvram = p->cs_cd32fmv = false; + p->cs_cd32nvram_size = 1024; p->cs_cdtvcd = p->cs_cdtvram = false; p->cs_cdtvcard = 0; p->cs_pcmcia = 0; @@ -5694,6 +5706,7 @@ static void buildin_default_prefs (struct uae_prefs *p) p->sound_volume = 0; p->sound_volume_cd = 0; p->clipboard_sharing = false; + p->ppc_mode = 0; p->chipmem_size = 0x00080000; p->bogomem_size = 0x00080000; @@ -5840,9 +5853,19 @@ static int bip_a4000 (struct uae_prefs *p, int config, int compa, int romcheck) p->mbresmem_low_size = 8 * 1024 * 1024; p->cpu_model = 68030; p->fpu_model = 68882; - if (config > 0) { + switch (config) + { + case 1: p->cpu_model = 68040; p->fpu_model = 68040; + break; + case 2: + p->cpu_model = 68060; + p->fpu_model = 68060; + p->ppc_mode = 1; + p->cpuboard_type = BOARD_CSPPC; + p->cpuboardmem1_size = 128 * 1024 * 1024; + break; } p->chipset_mask = CSMASK_AGA | CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE; p->cpu_compatible = p->address_space_24 = 0; @@ -6034,9 +6057,43 @@ static int bip_a1200 (struct uae_prefs *p, int config, int compa, int romcheck) roms[2] = 31; roms[3] = -1; p->cs_rtc = 0; - if (config == 1) { + switch (config) + { + case 1: p->fastmem_size = 0x400000; p->cs_rtc = 1; + break; + case 2: + p->cpuboard_type = BOARD_BLIZZARD_1230_IV; + p->cpuboardmem1_size = 32 * 1024 * 1024; + p->cpu_model = 68030; + p->cs_rtc = 1; + break; + case 3: + p->cpuboard_type = BOARD_BLIZZARD_1260; + p->cpuboardmem1_size = 32 * 1024 * 1024; + p->cpu_model = 68040; + p->fpu_model = 68040; + p->cs_rtc = 1; + break; + case 4: + p->cpuboard_type = BOARD_BLIZZARD_1260; + p->cpuboardmem1_size = 32 * 1024 * 1024; + p->cpu_model = 68060; + p->fpu_model = 68060; + p->cs_rtc = 1; + break; + case 5: + p->cpuboard_type = BOARD_BLIZZARDPPC; + p->cpuboardmem1_size = 256 * 1024 * 1024; + p->cpu_model = 68060; + p->fpu_model = 68060; + p->ppc_mode = 1; + p->cs_rtc = 1; + roms[0] = 15; + roms[1] = 11; + roms[2] = -1; + break; } set_68020_compa (p, compa, 0); p->cs_compatible = CP_A1200; diff --git a/cpuboard.cpp b/cpuboard.cpp index 6e9b662e..9eaa90df 100644 --- a/cpuboard.cpp +++ b/cpuboard.cpp @@ -101,7 +101,7 @@ /* REG_INT 0x28 */ // 0x40 always set // 0x20 -// 0x10 always cleared +// 0x10 always set // 0x08 // 0x04 // MOS sets this bit #define P5_ENABLE_IPL 0x02 @@ -917,8 +917,7 @@ static uae_u32 REGPARAM2 blizzardio_bget(uaecptr addr) } else if (reg == CSIII_REG_IRQ) { v &= 0x3f; } else if (reg == CSIII_REG_INT) { - v |= 0x40; - v &= ~0x10; + v |= 0x40 | 0x10; } else if (reg == CSIII_REG_SHADOW) { v |= 0x08; } else if (reg == CSIII_REG_RESET) { @@ -1751,6 +1750,7 @@ addrbank *cpuboard_autoconfig_init(void) struct zfile *autoconfig_rom = NULL; int roms[3], roms2[3]; bool autoconf = true; + bool autoconf_stop = false; const TCHAR *defaultromname = NULL; const TCHAR *romname = currprefs.acceleratorromfile; bool isflashrom = false; @@ -1758,8 +1758,10 @@ addrbank *cpuboard_autoconfig_init(void) roms[0] = -1; roms[1] = -1; + roms[2] = -1; roms2[0] = -1; roms2[1] = -1; + roms2[2] = -1; cpuboard_non_byte_ea = false; switch (currprefs.cpuboard_type) { @@ -1862,6 +1864,7 @@ addrbank *cpuboard_autoconfig_init(void) f0rom_size = 131072; zfile_fread(blizzardf0_bank.baseaddr, 1, f0rom_size, autoconfig_rom); autoconf = false; + autoconf_stop = true; } else if (is_tekmagic()) { earom_size = 65536; f0rom_size = 131072; @@ -1975,6 +1978,8 @@ addrbank *cpuboard_autoconfig_init(void) map_banks(&blizzardf0_bank, 0xf00000 >> 16, (f0rom_size > 262144 ? 262144 : f0rom_size) >> 16, 0); } } + if (autoconf_stop) + return &expamem_none; if (!autoconf) return &expamem_null; return &blizzarde8_bank; diff --git a/expansion.cpp b/expansion.cpp index 3ada7efb..740e0a25 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -35,6 +35,8 @@ #include "cpuboard.h" #include "uae/ppc.h" +#define EXP_DEBUG 0 + #define MAX_EXPANSION_BOARDS 11 /* ********************************************************** */ @@ -257,7 +259,7 @@ static void addextrachip (uae_u32 sysbase) } } -addrbank expamem_null; +addrbank expamem_null, expamem_none; DECLARE_MEMORY_FUNCTIONS(expamem); addrbank expamem_bank = { @@ -331,6 +333,15 @@ static void call_card_init(int index) expamem_bank.name = card_name[ecard] ? card_name[ecard] : _T("None"); ab = (*card_init[ecard]) (); expamem_z3_size = 0; + if (ab == &expamem_none) { + expamem_init_clear(); + expamem_init_clear_zero(); + map_banks(&expamem_bank, 0xE8, 1, 0); + if (currprefs.address_space_24) + map_banks(&dummy_bank, 0xff000000 >> 16, 1, 0); + expamem_bank_current = NULL; + return; + } if (ab == &expamem_null) { expamem_next(NULL, NULL); return; @@ -346,6 +357,7 @@ static void call_card_init(int index) code = expamem_read(0); if ((code & 0xc0) == 0xc0) { + // Z2 code &= 7; if (code == 0) expamem_z2_size = 8 * 1024 * 1024; @@ -356,7 +368,7 @@ static void call_card_init(int index) expamem_board_pointer = expamem_z2_pointer; } else { - + // Z3 if (expamem_z3_sum < Z3BASE_UAE) { expamem_z3_sum = currprefs.z3autoconfig_start; if (currprefs.mbresmem_high_size >= 128 * 1024 * 1024 && expamem_z3_sum == Z3BASE_UAE) @@ -489,7 +501,7 @@ static uae_u32 REGPARAM2 expamem_bget (uaecptr addr) return expamem_bank_current->bget(addr); addr &= 0xFFFF; b = expamem[addr]; -#ifdef EXP_DEBUG +#if EXP_DEBUG write_log (_T("expamem_bget %x %x\n"), addr, b); #endif return b; @@ -524,7 +536,7 @@ static void REGPARAM2 expamem_lput (uaecptr addr, uae_u32 value) static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) { -#ifdef EXP_DEBUG +#if EXP_DEBUG write_log (_T("expamem_wput %x %x\n"), addr, value); #endif #ifdef JIT @@ -593,7 +605,7 @@ static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) static void REGPARAM2 expamem_bput (uaecptr addr, uae_u32 value) { -#ifdef EXP_DEBUG +#if EXP_DEBUG write_log (_T("expamem_bput %x %x\n"), addr, value); #endif #ifdef JIT @@ -872,7 +884,7 @@ static addrbank catweasel_bank = { static addrbank *expamem_map_catweasel (void) { catweasel_start = expamem_z2_pointer; - map_banks (&catweasel_bank, catweasel_start >> 16, 1, 0); + map_banks_z2 (&catweasel_bank, catweasel_start >> 16, 1); return &catweasel_bank; } @@ -934,7 +946,7 @@ static uae_u32 REGPARAM2 filesys_lget (uaecptr addr) addr -= filesys_start & 65535; addr &= 65535; m = filesys_bank.baseaddr + addr; -#ifdef EXP_DEBUG +#if EXP_DEBUG write_log (_T("filesys_lget %x %x\n"), addr, do_get_mem_long ((uae_u32 *)m)); #endif return do_get_mem_long ((uae_u32 *)m); @@ -949,7 +961,7 @@ static uae_u32 REGPARAM2 filesys_wget (uaecptr addr) addr -= filesys_start & 65535; addr &= 65535; m = filesys_bank.baseaddr + addr; -#ifdef EXP_DEBUG +#if EXP_DEBUG write_log (_T("filesys_wget %x %x\n"), addr, do_get_mem_word ((uae_u16 *)m)); #endif return do_get_mem_word ((uae_u16 *)m); @@ -962,8 +974,8 @@ static uae_u32 REGPARAM2 filesys_bget (uaecptr addr) #endif addr -= filesys_start & 65535; addr &= 65535; -#ifdef EXP_DEBUG - write_log (_T("filesys_bget %x %x\n"), addr, filesysory[addr]); +#if EXP_DEBUG + write_log (_T("filesys_bget %x %x\n"), addr, filesys_bank.baseaddr[addr]); #endif return filesys_bank.baseaddr[addr]; } @@ -989,7 +1001,7 @@ static void REGPARAM2 filesys_bput (uaecptr addr, uae_u32 b) #ifdef JIT special_mem |= S_WRITE; #endif -#ifdef EXP_DEBUG +#if EXP_DEBUG write_log (_T("filesys_bput %x %x\n"), addr, b); #endif } @@ -1033,9 +1045,10 @@ static addrbank *expamem_map_fastcard_2 (int boardnum) { uae_u32 start = ((expamem_hi | (expamem_lo >> 4)) << 16); addrbank *ab = fastbanks[boardnum * 2 + ((start < 0x00A00000) ? 0 : 1)]; + uae_u32 size = ab->allocated; ab->start = start; if (ab->start) { - map_banks (ab, ab->start >> 16, ab->allocated >> 16, 0); + map_banks_z2 (ab, ab->start >> 16, size >> 16); } return ab; } @@ -1067,7 +1080,7 @@ static addrbank *expamem_init_fastcard_2 (int boardnum) else if (allocated == 0x800000) type |= Z2_MEM_8MB; - if (currprefs.cpuboard_type == BOARD_A2630) { + if (currprefs.cpuboard_type == BOARD_A2630 && boardnum != 0) { for (int i = 1; i < 16; i++) expamem_write(i * 4, a2630_autoconfig[i]); type &= 7; @@ -1133,7 +1146,7 @@ static addrbank *expamem_map_filesys (void) uaecptr a; filesys_start = expamem_z2_pointer; - map_banks (&filesys_bank, filesys_start >> 16, 1, 0); + map_banks_z2 (&filesys_bank, filesys_start >> 16, 1); /* 68k code needs to know this. */ a = here (); org (rtarea_base + RTAREA_FSBOARD); @@ -1294,7 +1307,7 @@ static addrbank *expamem_map_gfxcard_z3 (void) static addrbank *expamem_map_gfxcard_z2 (void) { gfxmem_bank.start = expamem_z2_pointer; - map_banks (&gfxmem_bank, gfxmem_bank.start >> 16, gfxmem_bank.allocated >> 16, gfxmem_bank.allocated); + map_banks_z2 (&gfxmem_bank, gfxmem_bank.start >> 16, gfxmem_bank.allocated >> 16); return &gfxmem_bank; } @@ -1860,10 +1873,11 @@ void expamem_reset (void) #endif #ifdef GFXBOARD if (currprefs.rtgmem_type >= GFXBOARD_HARDWARE && gfxboard_is_z3 (currprefs.rtgmem_type)) { - card_flags[cardno] = 4; + card_flags[cardno] = 4 | 1; card_name[cardno] = _T ("Gfxboard VRAM Zorro III"); card_init[cardno] = expamem_init_gfxboard_memory; card_map[cardno++] = NULL; + card_flags[cardno] = 1; card_name[cardno] = _T ("Gfxboard Registers"); card_init[cardno] = expamem_init_gfxboard_registers; card_map[cardno++] = NULL; diff --git a/filesys.cpp b/filesys.cpp index 6b44de9f..3927aa8d 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -6616,7 +6616,7 @@ static uae_u32 REGPARAM2 filesys_diagentry (TrapContext *context) put_word (resaddr + 0x0, 0x4AFC); put_long (resaddr + 0x2, resaddr); put_long (resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ - put_word (resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ + put_word (resaddr + 0xA, 0x8132); /* RTF_AUTOINIT|RTF_COLDSTART; Version 50 */ put_word (resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ put_long (resaddr + 0xE, ROM_hardfile_resname); put_long (resaddr + 0x12, ROM_hardfile_resid); @@ -8209,11 +8209,11 @@ static TCHAR *getfullaname (a_inode *a) TCHAR *p; int first = 1; - p = xcalloc (TCHAR, 2000); + p = xcalloc (TCHAR, MAX_DPATH); while (a) { int len = _tcslen (a->aname); memmove (p + len + 1, p, (_tcslen (p) + 1) * sizeof (TCHAR)); - memcpy (p, a->aname, _tcslen (a->aname) * sizeof (TCHAR)); + memcpy (p, a->aname, len * sizeof (TCHAR)); if (!first) p[len] = '/'; first = 0; diff --git a/flashrom.cpp b/flashrom.cpp index 2f9973c1..918578bd 100644 --- a/flashrom.cpp +++ b/flashrom.cpp @@ -65,6 +65,7 @@ struct bitbang_i2c_interface { int eeprom_addr; int size; int write_offset; + int addressbitmask; uae_u8 *memory; struct zfile *zf; }; @@ -181,11 +182,11 @@ int eeprom_i2c_set(void *fdv, int line, int level) i2c->estate = I2C_DATA; } else { i2c->estate = I2C_WORDADDR; - i2c->eeprom_addr = ((i2c->buffer >> 1) & 3) << 8; + i2c->eeprom_addr = ((i2c->buffer >> 1) & i2c->addressbitmask) << 8; } } else if (i2c->estate == I2C_WORDADDR) { i2c->estate = I2C_DATA; - i2c->eeprom_addr &= 0x300; + i2c->eeprom_addr &= i2c->addressbitmask << 8; i2c->eeprom_addr |= i2c->buffer; #if EEPROM_LOG write_log(_T("EEPROM address %04x\n"), i2c->eeprom_addr); @@ -274,6 +275,7 @@ void *eeprom_new(uae_u8 *memory, int size, struct zfile *zf) s->memory = memory; s->size = size; s->zf = zf; + s->addressbitmask = (size / 256) - 1; return s; } diff --git a/gencpu.cpp b/gencpu.cpp index 3165b655..d56bad59 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -5481,7 +5481,7 @@ static void generate_cpu (int id, int mode) } postfix = id; - if (id == 0 || id == 11 || id == 13 || id == 20 || id == 21 || id == 22 || id == 23 || id == 31 || id == 32 || id == 33 || id == 40) { + if (id == 0 || id == 11 || id == 13 || id == 20 || id == 21 || id == 22 || id == 23 || id == 24 || id == 31 || id == 32 || id == 33 || id == 40) { if (generate_stbl) fprintf (stblfile, "#ifdef CPUEMU_%d%s\n", postfix, extraup); postfix2 = postfix; @@ -5492,6 +5492,8 @@ static void generate_cpu (int id, int mode) generate_includes (stdout, id); } + using_indirect = 0; + using_exception_3 = 1; using_prefetch = 0; using_prefetch_020 = 0; using_ce = 0; @@ -5538,7 +5540,13 @@ static void generate_cpu (int id, int mode) read_counts (); for (rp = 0; rp < nr_cpuop_funcs; rp++) opcode_next_clev[rp] = cpu_level; - } else if (id == 22) { // 68030 "cycle-exact" + } else if (id == 22) { // 68030 prefetch + cpu_level = 3; + using_prefetch_020 = 2; + read_counts (); + for (rp = 0; rp < nr_cpuop_funcs; rp++) + opcode_next_clev[rp] = cpu_level; + } else if (id == 23) { // 68030 "cycle-exact" cpu_level = 3; using_ce020 = 2; using_prefetch_020 = 2; @@ -5546,12 +5554,12 @@ static void generate_cpu (int id, int mode) read_counts (); for (rp = 0; rp < nr_cpuop_funcs; rp++) opcode_next_clev[rp] = cpu_level; - } else if (id == 23 || id == 24) { // 68040/060 "cycle-exact" - cpu_level = id == 23 ? 5 : 4; + } else if (id == 24 || id == 25) { // 68040/060 "cycle-exact" + cpu_level = id == 24 ? 5 : 4; using_ce020 = 3; using_prefetch_020 = 3; memory_cycle_cnt = 0; - if (id == 23) { + if (id == 24) { read_counts(); for (rp = 0; rp < nr_cpuop_funcs; rp++) opcode_next_clev[rp] = cpu_level; @@ -5627,13 +5635,8 @@ int main(int argc, char *argv[]) stblfile = fopen ("cpustbl.cpp", "wb"); generate_includes (stblfile, 0); - using_prefetch = 0; - using_indirect = 0; - using_exception_3 = 1; - using_ce = 0; - for (i = 0; i <= 45; i++) { - if ((i >= 6 && i < 11) || (i > 14 && i < 20) || (i > 24 && i < 31) || (i > 33 && i < 40)) + if ((i >= 6 && i < 11) || (i > 14 && i < 20) || (i > 25 && i < 31) || (i > 33 && i < 40)) continue; generate_stbl = 1; generate_cpu (i, 0); diff --git a/gfxboard.cpp b/gfxboard.cpp index 7312b8b8..d83ae592 100644 --- a/gfxboard.cpp +++ b/gfxboard.cpp @@ -1266,6 +1266,7 @@ static void REGPARAM2 gfxboard_wput_mem_autoconfig (uaecptr addr, uae_u32 b) gfxboard_bank_memory.bget = gfxboard_bget_mem; gfxboard_bank_memory.bput = gfxboard_bput_mem; gfxboard_bank_memory.wput = gfxboard_wput_mem; + init_board (); if (ISP4()) { // main vram map_banks (&gfxboard_bank_memory, (gfxmem_bank.start + PICASSOIV_VRAM1) >> 16, 0x400000 >> 16, currprefs.rtgmem_size); @@ -1279,7 +1280,6 @@ static void REGPARAM2 gfxboard_wput_mem_autoconfig (uaecptr addr, uae_u32 b) picassoiv_bank = 0; picassoiv_flifi = 1; configured_regs = gfxmem_bank.start >> 16; - init_board (); } else { map_banks (&gfxboard_bank_memory, gfxmem_bank.start >> 16, board->banksize >> 16, currprefs.rtgmem_size); } @@ -1307,6 +1307,8 @@ static void REGPARAM2 gfxboard_bput_mem_autoconfig (uaecptr addr, uae_u32 b) addrbank *ab; if (ISP4()) { ab = &gfxboard_bank_nbsmemory; + if (configured_mem == 0) + init_board (); map_banks (ab, b, 0x00200000 >> 16, 0x00200000); if (configured_mem == 0) { configured_mem = b; @@ -1319,6 +1321,7 @@ static void REGPARAM2 gfxboard_bput_mem_autoconfig (uaecptr addr, uae_u32 b) ab = &gfxboard_bank_memory; gfxboard_bank_memory.bget = gfxboard_bget_mem; gfxboard_bank_memory.bput = gfxboard_bput_mem; + init_board (); map_banks (ab, b, board->banksize >> 16, currprefs.rtgmem_size); configured_mem = b; gfxboardmem_start = b << 16; @@ -1525,7 +1528,6 @@ static void REGPARAM2 gfxboard_bput_regs_autoconfig (uaecptr addr, uae_u32 b) map_banks (ab, b, gfxboard_bank_registers.allocated >> 16, gfxboard_bank_registers.allocated); } configured_regs = b; - init_board (); expamem_next (ab, NULL); return; } @@ -1974,26 +1976,26 @@ bool gfxboard_is_z3 (int type) bool gfxboard_need_byteswap (int type) { - if (type < 2) + if (type < GFXBOARD_HARDWARE) return false; - board = &boards[type - 2]; + board = &boards[type - GFXBOARD_HARDWARE]; return board->swap; } int gfxboard_get_vram_min (int type) { - if (type < 2) + if (type < GFXBOARD_HARDWARE) return -1; - board = &boards[type - 2]; + board = &boards[type - GFXBOARD_HARDWARE]; //return board->vrammax; return board->vrammin; } int gfxboard_get_vram_max (int type) { - if (type < 2) + if (type < GFXBOARD_HARDWARE) return -1; - board = &boards[type - 2]; + board = &boards[type - GFXBOARD_HARDWARE]; return board->vrammax; } diff --git a/hardfile.cpp b/hardfile.cpp index a8561cf3..ea4ecc0a 100644 --- a/hardfile.cpp +++ b/hardfile.cpp @@ -2223,8 +2223,8 @@ void hardfile_install (void) uae_sem_init (&change_sem, 0, 1); - ROM_hardfile_resname = ds (_T("uaehf.device")); - ROM_hardfile_resid = ds (_T("UAE hardfile.device 0.3")); + ROM_hardfile_resname = ds (currprefs.uaescsidevmode == 1 ? _T("scsi.device") : _T("uaehf.device")); + ROM_hardfile_resid = ds (_T("UAE hardfile.device 0.4")); nscmd_cmd = here (); dw (NSCMD_DEVICEQUERY); @@ -2305,7 +2305,7 @@ void hardfile_install (void) dw (0x0600); /* LIBF_SUMUSED | LIBF_CHANGED */ dw (0xD000); /* INITWORD */ dw (0x0014); /* LIB_VERSION */ - dw (0x0004); /* 0.4 */ + dw (0x0032); /* 50 */ dw (0xD000); dw (0x0016); /* LIB_REVISION */ dw (0x0000); diff --git a/include/gui.h b/include/gui.h index 12df295f..81d7678e 100644 --- a/include/gui.h +++ b/include/gui.h @@ -80,6 +80,6 @@ typedef enum { NUMSG_KS68EC020, NUMSG_KS68020, NUMSG_KS68030, NUMSG_ROMNEED, NUMSG_EXPROMNEED, NUMSG_NOZLIB, NUMSG_STATEHD, NUMSG_NOCAPS, NUMSG_OLDCAPS, NUMSG_KICKREP, NUMSG_KICKREPNO, - NUMSG_KS68030PLUS + NUMSG_KS68030PLUS, NUMSG_NO_PPC } notify_user_msg; diff --git a/include/memory.h b/include/memory.h index eed2c722..3cd3c56c 100644 --- a/include/memory.h +++ b/include/memory.h @@ -322,7 +322,7 @@ extern addrbank cia_bank; extern addrbank rtarea_bank; extern addrbank filesys_bank; extern addrbank expamem_bank; -extern addrbank expamem_null; +extern addrbank expamem_null, expamem_none; extern addrbank fastmem_bank; extern addrbank fastmem_nojit_bank; extern addrbank fastmem2_bank; @@ -409,6 +409,7 @@ extern uae_u8 *baseaddr[MEMORY_BANKS]; extern void memory_init (void); extern void memory_cleanup (void); extern void map_banks (addrbank *bank, int first, int count, int realsize); +extern void map_banks_z2 (addrbank *bank, int first, int count); extern void map_banks_quick (addrbank *bank, int first, int count, int realsize); extern void map_banks_nojitdirect (addrbank *bank, int first, int count, int realsize); extern void map_banks_cond (addrbank *bank, int first, int count, int realsize); diff --git a/include/newcpu.h b/include/newcpu.h index 778ff2c6..f6169e5a 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -588,17 +588,18 @@ extern void fill_prefetch_030 (void); /* 68060 */ extern const struct cputbl op_smalltbl_0_ff[]; extern const struct cputbl op_smalltbl_40_ff[]; -extern const struct cputbl op_smalltbl_23_ff[]; // CE +extern const struct cputbl op_smalltbl_24_ff[]; // CE extern const struct cputbl op_smalltbl_33_ff[]; // MMU /* 68040 */ extern const struct cputbl op_smalltbl_1_ff[]; extern const struct cputbl op_smalltbl_41_ff[]; -extern const struct cputbl op_smalltbl_24_ff[]; // CE +extern const struct cputbl op_smalltbl_25_ff[]; // CE extern const struct cputbl op_smalltbl_31_ff[]; // MMU /* 68030 */ extern const struct cputbl op_smalltbl_2_ff[]; extern const struct cputbl op_smalltbl_42_ff[]; -extern const struct cputbl op_smalltbl_22_ff[]; // CE +extern const struct cputbl op_smalltbl_22_ff[]; // prefetch +extern const struct cputbl op_smalltbl_23_ff[]; // CE extern const struct cputbl op_smalltbl_32_ff[]; // MMU /* 68020 */ extern const struct cputbl op_smalltbl_3_ff[]; diff --git a/include/options.h b/include/options.h index d64a573a..cbd991a5 100644 --- a/include/options.h +++ b/include/options.h @@ -430,6 +430,7 @@ struct uae_prefs { int filesys_limit; int filesys_max_name; int filesys_max_file_size; + int uaescsidevmode; bool reset_delay; int cs_compatible; @@ -444,6 +445,7 @@ struct uae_prefs { bool cs_cd32c2p; bool cs_cd32nvram; bool cs_cd32fmv; + int cs_cd32nvram_size; bool cs_cdtvcd; bool cs_cdtvram; int cs_cdtvcard; diff --git a/main.cpp b/main.cpp index e083727d..9d3043e7 100644 --- a/main.cpp +++ b/main.cpp @@ -334,7 +334,7 @@ void fixup_prefs (struct uae_prefs *p) if (cpuboard_memorytype(p) == BOARD_MEMORY_HIGHMEM) { p->mbresmem_high_size = p->cpuboardmem1_size; } else if (cpuboard_memorytype(p) == BOARD_MEMORY_Z2) { - p->fastmem_size = p->cpuboardmem1_size; + p->fastmem2_size = p->cpuboardmem1_size; } if (((p->chipmem_size & (p->chipmem_size - 1)) != 0 && p->chipmem_size != 0x180000) @@ -353,17 +353,22 @@ void fixup_prefs (struct uae_prefs *p) p->fastmem_size = 0; err = 1; } - if ((p->fastmem2_size & (p->fastmem2_size - 1)) != 0 || (p->fastmem_size + p->fastmem2_size) > 0x800000 + 262144 - || (p->fastmem2_size != 0 && (p->fastmem2_size < 0x10000 || p->fastmem_size > 0x800000))) + if ((p->fastmem2_size & (p->fastmem2_size - 1)) != 0 || (p->fastmem2_size != 0 && (p->fastmem2_size < 0x10000 || p->fastmem_size > 0x800000))) { error_log (_T("Unsupported fastmem2 size %d (0x%x)."), p->fastmem2_size, p->fastmem2_size); p->fastmem2_size = 0; err = 1; } - if (p->fastmem2_size > p->fastmem_size) { - error_log (_T("fastmem2 size can't be larger than fastmem1.")); - p->fastmem2_size = 0; - err = 1; + if (p->cachesize) { + if (p->fastmem_size + p->fastmem2_size > 0x800000) { + error_log (_T("Unsupported fastmem2 size %d (0x%x)."), p->fastmem2_size, p->fastmem2_size); + err = 1; + } + if (p->fastmem2_size > p->fastmem_size && p->fastmem_size > 0) { + error_log (_T("Fastmem2 size can't be larger than fastmem1 if JIT is enabled.")); + p->fastmem2_size = 0; + err = 1; + } } if (p->rtgmem_size > max_z3fastmem && p->rtgmem_type == GFXBOARD_UAE_Z3) { @@ -371,6 +376,7 @@ void fixup_prefs (struct uae_prefs *p) p->rtgmem_size = max_z3fastmem; err = 1; } + if ((p->rtgmem_size & (p->rtgmem_size - 1)) != 0 || (p->rtgmem_size != 0 && (p->rtgmem_size < 0x100000))) { error_log (_T("Unsupported graphics card memory size %d (0x%x)."), p->rtgmem_size, p->rtgmem_size); if (p->rtgmem_size > max_z3fastmem) @@ -455,13 +461,21 @@ void fixup_prefs (struct uae_prefs *p) } if (p->rtgmem_type >= GFXBOARD_HARDWARE) { - if (p->rtgmem_size < gfxboard_get_vram_min (p->rtgmem_type)) + if (gfxboard_get_vram_min(p->rtgmem_type) > 0 && p->rtgmem_size < gfxboard_get_vram_min (p->rtgmem_type)) { + error_log(_T("Graphics card memory size %d (0x%x) smaller than minimum hardware supported %d (0x%x)."), + p->rtgmem_size, p->rtgmem_size, gfxboard_get_vram_min(p->rtgmem_type), gfxboard_get_vram_min(p->rtgmem_type)); p->rtgmem_size = gfxboard_get_vram_min (p->rtgmem_type); + } if (p->address_space_24 && gfxboard_is_z3 (p->rtgmem_type)) { p->rtgmem_type = GFXBOARD_UAE_Z2; p->rtgmem_size = 0; error_log (_T("Z3 RTG and 24-bit address space are not compatible.")); } + if (gfxboard_get_vram_max(p->rtgmem_type) > 0 && p->rtgmem_size > gfxboard_get_vram_max(p->rtgmem_type)) { + error_log(_T("Graphics card memory size %d (0x%x) larger than maximum hardware supported %d (0x%x)."), + p->rtgmem_size, p->rtgmem_size, gfxboard_get_vram_max(p->rtgmem_type), gfxboard_get_vram_max(p->rtgmem_type)); + p->rtgmem_size = gfxboard_get_vram_max(p->rtgmem_type); + } } if (p->address_space_24 && p->rtgmem_size && p->rtgmem_type == GFXBOARD_UAE_Z3) { error_log (_T("Z3 RTG and 24bit address space are not compatible.")); diff --git a/memory.cpp b/memory.cpp index 964a403b..b9475b37 100644 --- a/memory.cpp +++ b/memory.cpp @@ -2658,6 +2658,30 @@ void map_banks (addrbank *bank, int start, int size, int realsize) ppc_generate_map_banks(bank, start, size); #endif } + +void map_banks_z2 (addrbank *bank, int start, int size) +{ + if (start < 0x20 || (start >= 0xa0 && start < 0xe9) || start >= 0xf0) { + write_log(_T("Z2 map_banks with invalid start address %08X\n"), start << 16); + return; + } + if (start >= 0xe9) { + if (start + size > 0xf0) { + write_log(_T("Z2 map_banks with invalid region %08x - %08X\n"), start << 16, (start + size) << 16); + size = 0xf0 - start; + } + } else { + if (start + size > 0xa0) { + write_log(_T("Z2 map_banks with invalid region %08x - %08X\n"), start << 16, (start + size) << 16); + size = 0xa0 - start; + } + } + if (size <= 0) + return; + map_banks (bank, start, size, 0); +} + + void map_banks_quick (addrbank *bank, int start, int size, int realsize) { map_banks2 (bank, start, size, realsize, 1); diff --git a/newcpu.cpp b/newcpu.cpp index eda4db29..a3ef6186 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -854,6 +854,22 @@ static void set_x_funcs (void) x_do_cycles = do_cycles; x_do_cycles_pre = do_cycles; x_do_cycles_post = do_cycles_post; + } else if (currprefs.cpu_model == 68030 && !currprefs.cachesize) { + x_prefetch = get_word_prefetch; + x_get_ilong = get_long_020_prefetch; + x_get_iword = get_word_020_prefetch; + x_get_ibyte = NULL; + x_next_iword = next_iword_020_prefetch; + x_next_ilong = next_ilong_020_prefetch; + x_put_long = put_long; + x_put_word = put_word; + x_put_byte = put_byte; + x_get_long = get_long; + x_get_word = get_word; + x_get_byte = get_byte; + x_do_cycles = do_cycles; + x_do_cycles_pre = do_cycles; + x_do_cycles_post = do_cycles_post; } else if (currprefs.cpu_model < 68040) { // JIT or 68030+ does not have real prefetch only emulation x_prefetch = NULL; @@ -1148,11 +1164,11 @@ static const struct cputbl *cputbls[6][5] = // 68020 { op_smalltbl_3_ff, op_smalltbl_43_ff, op_smalltbl_20_ff, op_smalltbl_21_ff, NULL }, // 68030 - { op_smalltbl_2_ff, op_smalltbl_42_ff, op_smalltbl_42_ff, op_smalltbl_22_ff, op_smalltbl_32_ff }, + { op_smalltbl_2_ff, op_smalltbl_42_ff, op_smalltbl_22_ff, op_smalltbl_23_ff, op_smalltbl_32_ff }, // 68040 - { op_smalltbl_1_ff, op_smalltbl_41_ff, op_smalltbl_24_ff, op_smalltbl_24_ff, op_smalltbl_31_ff }, + { op_smalltbl_1_ff, op_smalltbl_41_ff, op_smalltbl_25_ff, op_smalltbl_25_ff, op_smalltbl_31_ff }, // 68060 - { op_smalltbl_0_ff, op_smalltbl_40_ff, op_smalltbl_23_ff, op_smalltbl_23_ff, op_smalltbl_33_ff } + { op_smalltbl_0_ff, op_smalltbl_40_ff, op_smalltbl_24_ff, op_smalltbl_24_ff, op_smalltbl_33_ff } }; static void build_cpufunctbl (void) @@ -1265,7 +1281,7 @@ static void build_cpufunctbl (void) } m68k_interrupt_delay = false; if (currprefs.cpu_cycle_exact) { - if (tbl == op_smalltbl_14_ff || tbl == op_smalltbl_13_ff || tbl == op_smalltbl_21_ff || tbl == op_smalltbl_22_ff) + if (tbl == op_smalltbl_14_ff || tbl == op_smalltbl_13_ff || tbl == op_smalltbl_21_ff || tbl == op_smalltbl_23_ff) m68k_interrupt_delay = true; } @@ -2167,13 +2183,12 @@ kludge_me_do: static uae_u32 exception_pc (int nr) { - // zero divide, chk, trapcc/trapv, trace, trap# - if (nr == 5 || nr == 6 || nr == 7 || nr == 9 || (nr >= 32 && nr <= 47)) - return m68k_getpc (); - return regs.instruction_pc; + // bus error, address error, illegal instruction, privilege violation, a-line, f-line + if (nr == 2 || nr == 3 || nr == 4 || nr == 8 || nr == 10 || nr == 11) + return regs.instruction_pc; + return m68k_getpc (); } - static void Exception_build_stack_frame (uae_u32 oldpc, uae_u32 currpc, uae_u32 ssw, int nr, int format) { int i; @@ -2336,6 +2351,9 @@ static void Exception_build_stack_frame (uae_u32 oldpc, uae_u32 currpc, uae_u32 static void Exception_mmu030 (int nr, uaecptr oldpc) { uae_u32 currpc = m68k_getpc (), newpc; + int interrupt; + + interrupt = nr >= 24 && nr < 24 + 8; exception_debug (nr); MakeSR (); @@ -2361,7 +2379,7 @@ static void Exception_mmu030 (int nr, uaecptr oldpc) newpc = x_get_long (regs.vbr + 4 * nr); - if (regs.m && nr >= 24 && nr < 32) { /* M + Interrupt */ + if (regs.m && interrupt) { /* M + Interrupt */ Exception_build_stack_frame (oldpc, currpc, regs.mmu_ssw, nr, 0x0); MakeSR (); regs.m = 0; @@ -2397,6 +2415,9 @@ static void Exception_mmu030 (int nr, uaecptr oldpc) static void Exception_mmu (int nr, uaecptr oldpc) { uae_u32 currpc = m68k_getpc (), newpc; + int interrupt; + + interrupt = nr >= 24 && nr < 24 + 8; exception_debug (nr); MakeSR (); @@ -2405,7 +2426,7 @@ static void Exception_mmu (int nr, uaecptr oldpc) regs.usp = m68k_areg (regs, 7); if (currprefs.cpu_model == 68060) { m68k_areg (regs, 7) = regs.isp; - if (nr >= 24 && nr < 32) + if (interrupt) regs.m = 0; } else if (currprefs.cpu_model >= 68020) { m68k_areg (regs, 7) = regs.m ? regs.msp : regs.isp; @@ -2432,7 +2453,7 @@ static void Exception_mmu (int nr, uaecptr oldpc) write_log (_T("Exception %d (%x) at %x -> %x!\n"), nr, last_fault_for_exception_3, currpc, get_long (regs.vbr + 4 * nr)); } else if (nr == 5 || nr == 6 || nr == 7 || nr == 9) { Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, nr, 0x2); - } else if (regs.m && nr >= 24 && nr < 32) { /* M + Interrupt */ + } else if (regs.m && interrupt) { /* M + Interrupt */ Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, nr, 0x1); } else if (nr == 61) { Exception_build_stack_frame(oldpc, regs.instruction_pc, regs.mmu_ssw, nr, 0x0); @@ -2490,8 +2511,11 @@ static void Exception_normal (int nr) { uae_u32 currpc, newpc; int sv = regs.s; + int interrupt; + + interrupt = nr >= 24 && nr < 24 + 8; - if (nr >= 24 && nr < 24 + 8 && currprefs.cpu_model <= 68010) + if (interrupt && currprefs.cpu_model <= 68010) nr = x_get_byte (0x00fffff1 | (nr << 1)); exception_debug (nr); @@ -2501,7 +2525,7 @@ static void Exception_normal (int nr) regs.usp = m68k_areg (regs, 7); if (currprefs.cpu_model == 68060) { m68k_areg (regs, 7) = regs.isp; - if (nr >= 24 && nr < 32) + if (interrupt) regs.m = 0; } else if (currprefs.cpu_model >= 68020) { m68k_areg (regs, 7) = regs.m ? regs.msp : regs.isp; @@ -2626,7 +2650,7 @@ static void Exception_normal (int nr) x_put_long (m68k_areg (regs, 7), regs.instruction_pc); m68k_areg (regs, 7) -= 2; x_put_word (m68k_areg (regs, 7), 0x2000 + nr * 4); - } else if (regs.m && nr >= 24 && nr < 32) { /* M + Interrupt */ + } else if (regs.m && interrupt) { /* M + Interrupt */ m68k_areg (regs, 7) -= 2; x_put_word (m68k_areg (regs, 7), nr * 4); m68k_areg (regs, 7) -= 4; @@ -3406,8 +3430,6 @@ static int do_specialties (int cycles) unset_special(SPCFLAG_CHECK); } - regs.instruction_pc = m68k_getpc(); - #ifdef ACTION_REPLAY #ifdef ACTION_REPLAY_HRTMON if ((regs.spcflags & SPCFLAG_ACTION_REPLAY) && hrtmon_flag != ACTION_REPLAY_INACTIVE) { @@ -4455,39 +4477,6 @@ retry: #ifdef CPUEMU_20 -// only opcode fetch prefetch (030+ more compatible) -static void m68k_run_2pf (void) -{ - struct regstruct *r = ®s; - -retry: - TRY(prb) { - for (;;) { - r->instruction_pc = m68k_getpc (); - - #if DEBUG_CD32CDTVIO - out_cd32io (m68k_getpc ()); - #endif - - x_do_cycles (cpu_cycles); - - r->opcode = get_word_020_prefetchf (r->instruction_pc); - - count_instr (r->opcode); - - cpu_cycles = (*cpufunctbl[r->opcode])(r->opcode); - cpu_cycles = adjust_cycles (cpu_cycles); - if (r->spcflags) { - if (do_specialties (cpu_cycles)) - return; - } - } - } CATCH(prb) { - bus_error(); - goto retry; - } -} - // full prefetch 020 (more compatible) static void m68k_run_2p (void) { @@ -4758,6 +4747,7 @@ void m68k_go (int may_quit) currprefs.cpu_model >= 68020 && currprefs.cpu_cycle_exact ? m68k_run_2ce : currprefs.cpu_model <= 68020 && currprefs.cpu_compatible ? m68k_run_2p : + currprefs.cpu_model == 68030 && currprefs.cpu_compatible ? m68k_run_2p : currprefs.cpu_model >= 68040 && currprefs.cpu_compatible ? m68k_run_3p : m68k_run_2; @@ -5266,7 +5256,7 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int cn _tcscat(instrname, fpsizes[size]); _tcscat(instrname, _T(" ")); p = instrname + _tcslen(instrname); - _stprintf(p, _T("FP%d,"), (extra >> 10) & 7); + _stprintf(p, _T("FP%d,"), (extra >> 7) & 7); pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, fpsizeconv[size], instrname, &deaddr2, safemode); p = instrname + _tcslen(instrname); if (size == 7) { @@ -5671,6 +5661,9 @@ uae_u8 *restore_cpu (uae_u8 *src) } dcaches030[i].tag = restore_u32 (); } + regs.prefetch020addr = restore_u32 (); + regs.cacheholdingaddr020 = restore_u32 (); + regs.cacheholdingdata020 = restore_u32 (); for (int i = 0; i < CPU_PIPELINE_MAX; i++) regs.prefetch020[i] = restore_u32 (); } else if (model == 68040) { @@ -7194,8 +7187,6 @@ void fill_prefetch (void) } else if (currprefs.cpu_model == 68020) { fill_prefetch_020 (); } else if (currprefs.cpu_model == 68030) { - if (!currprefs.cpu_cycle_exact) - return; fill_prefetch_030 (); } else if (currprefs.cpu_model <= 68010) { uaecptr pc = m68k_getpc (); diff --git a/od-win32/ahidsound_dsonly.cpp b/od-win32/ahidsound_dsonly.cpp index 5e28a280..8c17f046 100644 --- a/od-win32/ahidsound_dsonly.cpp +++ b/od-win32/ahidsound_dsonly.cpp @@ -107,7 +107,7 @@ static uae_u32 REGPARAM2 emulib_ExecuteNativeCode2 (TrapContext *context) uae_u32 a7 = m68k_areg (regs, 7); uae_u32 regs_ = (uae_u32)®s; CREATE_NATIVE_FUNC_PTR2; - uaevar.z3offset = (uae_u32)(get_real_address (0x10000000) - 0x10000000); + uaevar.z3offset = (uae_u32)(get_real_address (z3fastmem_bank.start) - z3fastmem_bank.start); uaevar.amigawnd = hAmigaWnd; a6 = &uaevar; if (object_UAM) { diff --git a/od-win32/avioutput.cpp b/od-win32/avioutput.cpp index 60520f40..fee05185 100644 --- a/od-win32/avioutput.cpp +++ b/od-win32/avioutput.cpp @@ -41,6 +41,7 @@ Copyright(c) 2001 - 2002; #include "registry.h" #include "fsdb.h" #include "threaddep/thread.h" +#include "zfile.h" #define MAX_AVI_SIZE (0x80000000 - 0x1000000) @@ -80,6 +81,7 @@ static int cs_allocated; static PAVIFILE pfile = NULL; // handle of our AVI file static PAVISTREAM AVIStreamInterface = NULL; // Address of stream interface +static struct zfile *FileStream; struct avientry { uae_u8 *lpVideo; @@ -94,6 +96,8 @@ static struct avientry *avientries[AVIENTRY_MAX + 1]; /* audio */ +static int FirstAudio; +static DWORD dwAudioInputRemaining; static unsigned int StreamSizeAudio; // audio write position static double StreamSizeAudioExpected; static PAVISTREAM AVIAudioStream = NULL; // compressed stream pointer @@ -104,6 +108,9 @@ static WAVEFORMATEXTENSIBLE wfxSrc; // source audio format static LPWAVEFORMATEX pwfxDst = NULL; // pointer to destination audio format static DWORD wfxMaxFmtSize; static FILE *wavfile; +static uae_u8 *lpAudioDst, *lpAudioSrc; +static DWORD dwAudioOutputBytes, dwAudioInputBytes; + /* video */ @@ -255,10 +262,12 @@ void AVIOutput_SetSettings (void) void AVIOutput_ReleaseAudio (void) { - if (pwfxDst) { - xfree (pwfxDst); - pwfxDst = NULL; - } +} + +static void AVIOutput_FreeAudioDstFormat () +{ + xfree (pwfxDst); + pwfxDst = NULL; } static int AVIOutput_AudioAllocated (void) @@ -268,17 +277,8 @@ static int AVIOutput_AudioAllocated (void) static int AVIOutput_AllocateAudio (void) { - MMRESULT err; - AVIOutput_ReleaseAudio (); - if ((err = acmMetrics (NULL, ACM_METRIC_MAX_SIZE_FORMAT, &wfxMaxFmtSize))) { - gui_message (_T("acmMetrics() FAILED (%X)\n"), err); - return 0; - } - if (wfxMaxFmtSize < sizeof (WAVEFORMATEX)) // some systems return bogus zero value.. - return 0; - // set the source format memset (&wfxSrc, 0, sizeof (wfxSrc)); wfxSrc.Format.wFormatTag = WAVE_FORMAT_PCM; @@ -307,13 +307,19 @@ static int AVIOutput_AllocateAudio (void) } } - if (!(pwfxDst = (LPWAVEFORMATEX)xmalloc (uae_u8, wfxMaxFmtSize))) - return 0; + if (!pwfxDst) { + MMRESULT err; + if ((err = acmMetrics (NULL, ACM_METRIC_MAX_SIZE_FORMAT, &wfxMaxFmtSize))) { + gui_message (_T("acmMetrics() FAILED (%X)\n"), err); + return 0; + } + if (wfxMaxFmtSize < sizeof (WAVEFORMATEX)) + return 0; + pwfxDst = (LPWAVEFORMATEX)xmalloc (uae_u8, wfxMaxFmtSize); + memcpy(pwfxDst, &wfxSrc.Format, sizeof WAVEFORMATEX); + pwfxDst->cbSize = (WORD) (wfxMaxFmtSize - sizeof (WAVEFORMATEX)); // shrugs + } - // set the initial destination format to match source - memset (pwfxDst, 0, wfxMaxFmtSize); - memcpy (pwfxDst, &wfxSrc, sizeof (WAVEFORMATEX)); - pwfxDst->cbSize = (WORD) (wfxMaxFmtSize - sizeof (WAVEFORMATEX)); // shrugs memset(&acmopt, 0, sizeof (ACMFORMATCHOOSE)); acmopt.cbStruct = sizeof (ACMFORMATCHOOSE); @@ -335,6 +341,8 @@ static int AVIOutput_AllocateAudio (void) //ACM_FORMATENUMF_SUGGEST // with this flag set, only MP3 320kbps is displayed, which is closest to the source format acmopt.pwfxEnum = &wfxSrc.Format; + FirstAudio = 1; + dwAudioInputRemaining = 0; return 1; } @@ -531,13 +539,15 @@ static int AVIOutput_AllocateVideo (void) } static int compressorallocated; -static void AVIOutput_FreeCOMPVARS (COMPVARS *pcv) +static void AVIOutput_FreeVideoDstFormat () { - ICClose(pcv->hic); + if (!pcompvars) + return; + ICClose(pcompvars->hic); if (compressorallocated) - ICCompressorFree(pcv); + ICCompressorFree(pcompvars); compressorallocated = FALSE; - pcv->hic = NULL; + pcompvars->hic = NULL; } static int AVIOutput_GetCOMPVARSFromRegistry (COMPVARS *pcv) @@ -605,7 +615,7 @@ int AVIOutput_GetVideoCodec (TCHAR *name, int len) return AVIOutput_GetVideoCodecName (pcompvars, name, len); if (!AVIOutput_AllocateVideo ()) return 0; - AVIOutput_FreeCOMPVARS (pcompvars); + AVIOutput_FreeVideoDstFormat (); if (AVIOutput_GetCOMPVARSFromRegistry (pcompvars) > 0) { AVIOutput_GetVideoCodecName (pcompvars, name, len); return 1; @@ -621,7 +631,7 @@ int AVIOutput_ChooseVideoCodec (HWND hwnd, TCHAR *s, int len) AVIOutput_End (); if (!AVIOutput_AllocateVideo ()) return 0; - AVIOutput_FreeCOMPVARS (pcompvars); + AVIOutput_FreeVideoDstFormat (); // we really should check first to see if the user has a particular compressor installed before we set one // we could set one but we will leave it up to the operating system and the set priority levels for the compressors @@ -720,74 +730,100 @@ static void AVIOuput_AVIWriteAudio (uae_u8 *sndbuffer, int sndbufsize) static int AVIOutput_AVIWriteAudio_Thread (struct avientry *ae) { - DWORD dwOutputBytes = 0; - LONG written = 0, swritten = 0; + DWORD flags; + LONG swritten = 0, written = 0; unsigned int err; - uae_u8 *lpAudio = NULL; - if (avioutput_audio) { - if (!avioutput_init) - goto error; + if (!avioutput_audio) + return 1; - if ((err = acmStreamSize (has, ae->sndsize, &dwOutputBytes, ACM_STREAMSIZEF_SOURCE) != 0)) { + if (!avioutput_init) + goto error; + + if (FirstAudio) { + if ((err = acmStreamSize (has, ae->sndsize, &dwAudioOutputBytes, ACM_STREAMSIZEF_SOURCE) != 0)) { gui_message (_T("acmStreamSize() FAILED (%X)\n"), err); goto error; } - - if (!(lpAudio = xmalloc (uae_u8, dwOutputBytes))) + dwAudioInputBytes = ae->sndsize * 2; + if (!(lpAudioSrc = xcalloc (uae_u8, dwAudioInputBytes))) goto error; - + if (!(lpAudioDst = xcalloc (uae_u8, dwAudioOutputBytes))) + goto error; + + memset(&ash, 0, sizeof ash); ash.cbStruct = sizeof (ACMSTREAMHEADER); - ash.fdwStatus = 0; - ash.dwUser = 0; // source - ash.pbSrc = ae->lpAudio; - - ash.cbSrcLength = ae->sndsize; - ash.cbSrcLengthUsed = 0; // This member is not valid until the conversion is complete. - - ash.dwSrcUser = 0; + ash.pbSrc = lpAudioSrc; + ash.cbSrcLength = dwAudioInputBytes; // destination - ash.pbDst = lpAudio; - - ash.cbDstLength = dwOutputBytes; - ash.cbDstLengthUsed = 0; // This member is not valid until the conversion is complete. - - ash.dwDstUser = 0; + ash.pbDst = lpAudioDst; + ash.cbDstLength = dwAudioOutputBytes; if ((err = acmStreamPrepareHeader (has, &ash, 0))) { avi_message (_T("acmStreamPrepareHeader() FAILED (%X)\n"), err); goto error; } + } - if ((err = acmStreamConvert (has, &ash, ACM_STREAMCONVERTF_BLOCKALIGN))) { - avi_message (_T("acmStreamConvert() FAILED (%X)\n"), err); - goto error; - } - - if ((err = AVIStreamWrite (AVIAudioStream, StreamSizeAudio, ash.cbDstLengthUsed / pwfxDst->nBlockAlign, lpAudio, ash.cbDstLengthUsed, 0, &swritten, &written)) != 0) { - avi_message (_T("AVIStreamWrite() FAILED (%X)\n"), err); - goto error; - } + ash.cbSrcLength = ae ? ae->sndsize : 0; + ash.cbSrcLength += dwAudioInputRemaining; + if (ae) + memcpy(ash.pbSrc + dwAudioInputRemaining, ae->lpAudio, ash.cbSrcLength); + + ash.cbSrcLengthUsed = 0; - StreamSizeAudio += swritten; - total_avi_size += written; + flags = ACM_STREAMCONVERTF_BLOCKALIGN; + if (FirstAudio) + flags |= ACM_STREAMCONVERTF_START; + if (!ae) + flags |= ACM_STREAMCONVERTF_END; - acmStreamUnprepareHeader (has, &ash, 0); + if ((err = acmStreamConvert (has, &ash, flags))) { + avi_message (_T("acmStreamConvert() FAILED (%X)\n"), err); + goto error; + } - free(lpAudio); - lpAudio = NULL; + if (ash.cbDstLengthUsed) { + if (FileStream) { + zfile_fwrite(lpAudioDst, 1, ash.cbDstLengthUsed, FileStream); + } else { + if ((err = AVIStreamWrite (AVIAudioStream, StreamSizeAudio, ash.cbDstLengthUsed / pwfxDst->nBlockAlign, lpAudioDst, ash.cbDstLengthUsed, 0, &swritten, &written)) != 0) { + avi_message (_T("AVIStreamWrite() FAILED (%X)\n"), err); + goto error; + } + } } + StreamSizeAudio += swritten; + total_avi_size += written; + dwAudioInputRemaining = ash.cbSrcLength - ash.cbSrcLengthUsed; + + FirstAudio = 0; return 1; error: - xfree (lpAudio); return 0; } +static void AVIOutput_AVIWriteAudio_Thread_End(void) +{ + if (!FirstAudio) { + AVIOutput_AVIWriteAudio_Thread(NULL); + } + ash.cbSrcLength = dwAudioInputBytes; + acmStreamUnprepareHeader (has, &ash, 0); + xfree(lpAudioDst); + lpAudioDst = NULL; + xfree(lpAudioSrc); + lpAudioSrc = NULL; + FirstAudio = 1; + dwAudioInputRemaining = 0; +} + + static void AVIOuput_WAVWriteAudio (uae_u8 *sndbuffer, int sndbufsize) { fwrite (sndbuffer, 1, sndbufsize, wavfile); @@ -1057,7 +1093,6 @@ void AVIOutput_End (void) destroy_comm_pipe (&workindex); destroy_comm_pipe (&queuefull); if (has) { - acmStreamUnprepareHeader (has, &ash, 0); acmStreamClose (has, 0); has = NULL; } @@ -1153,9 +1188,11 @@ void AVIOutput_Begin (void) return; } - if (((err = AVIFileOpen (&pfile, avioutput_filename_inuse, OF_CREATE | OF_WRITE, NULL)) != 0)) { - gui_message (_T("AVIFileOpen() FAILED (Error %X)\n\nThis can happen if the path and or file name was entered incorrectly.\nRequired *.avi extension.\n"), err); - goto error; + if (!FileStream) { + if (((err = AVIFileOpen (&pfile, avioutput_filename_inuse, OF_CREATE | OF_WRITE, NULL)) != 0)) { + gui_message (_T("AVIFileOpen() FAILED (Error %X)\n\nThis can happen if the path and or file name was entered incorrectly.\nRequired *.avi extension.\n"), err); + goto error; + } } if (avioutput_audio) { @@ -1284,11 +1321,10 @@ void AVIOutput_Release (void) avioutput_init = 0; } - if (pcompvars) { - AVIOutput_FreeCOMPVARS (pcompvars); - xfree (pcompvars); - pcompvars = NULL; - } + AVIOutput_FreeAudioDstFormat(); + AVIOutput_FreeVideoDstFormat(); + xfree (pcompvars); + pcompvars = NULL; if (cs_allocated) { DeleteCriticalSection (&AVIOutput_CriticalSection); @@ -1298,6 +1334,7 @@ void AVIOutput_Release (void) void AVIOutput_Initialize (void) { + if (avioutput_init) return; @@ -1308,6 +1345,7 @@ void AVIOutput_Initialize (void) if (!pcompvars) return; pcompvars->cbSize = sizeof (COMPVARS); + AVIFileInit (); avioutput_init = 1; } @@ -1348,6 +1386,7 @@ static void *AVIOutput_worker (void *arg) if (idx == 0xfffffffe || idx == 0xffffffff) break; } + AVIOutput_AVIWriteAudio_Thread_End(); write_log (_T("AVIOutput worker thread killed\n")); alive = 0; return 0; diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index 6b83e8fe..d63f9dd8 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -151,6 +151,7 @@ static uae_s16 axisold[MAX_INPUT_DEVICES][256], buttonold[MAX_INPUT_DEVICES][256 int no_rawinput = 0; int no_directinput = 0; +int no_windowsmouse = 0; static int dinput_enum_all; int dinput_winmouse (void) @@ -1597,7 +1598,7 @@ static bool initialize_rawinput (void) if (type == RIM_TYPEMOUSE) { if (rdpdevice (buf1)) continue; - if (num_mouse >= MAX_INPUT_DEVICES - 1) {/* leave space for Windows mouse */ + if (num_mouse >= MAX_INPUT_DEVICES - (no_windowsmouse ? 0 : 1)) {/* leave space for Windows mouse */ write_log (_T("Too many mice\n")); continue; } @@ -2035,7 +2036,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) if (isfocus () && !istest) { if (did->buttons >= 3 && (rm->usButtonFlags & RI_MOUSE_MIDDLE_BUTTON_DOWN)) { if (currprefs.win32_middle_mouse) { - if (isfullscreen () > 0) + if (isfullscreen () != 0 && currprefs.win32_minimize_inactive) minimizewindow (); if (mouseactive) setmouseactive (0); @@ -2778,8 +2779,10 @@ static int di_do_init (void) } } - write_log (_T("Windowsmouse initialization..\n")); - initialize_windowsmouse (); + if (!no_windowsmouse) { + write_log (_T("Windowsmouse initialization..\n")); + initialize_windowsmouse (); + } write_log (_T("Catweasel joymouse initialization..\n")); initialize_catweasel (); // write_log (_T("Parallel joystick port initialization..\n")); @@ -3068,7 +3071,7 @@ static void read_mouse (void) } } if (!istest && isfocus () && currprefs.win32_middle_mouse && dimofs == DIMOFS_BUTTON2 && state) { - if (isfullscreen () > 0) + if (isfullscreen () != 0 && currprefs.win32_minimize_inactive) minimizewindow (); if (mouseactive) setmouseactive (0); diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index ea80f936..61e480d0 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -394,6 +394,7 @@ #define IDS_FILTER_3D_EXTRA 401 #define IDS_ALWAYS_ON 402 #define IDS_DISPLAY_ATTRIBUTES 403 +#define IDS_NUMSG_NO_PPC 404 #define IDS_QS_MODELS 1000 #define IDS_QS_MODEL_A500 1001 #define IDS_QS_MODEL_A500P 1002 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index a6979c29..c779102c 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1834,7 +1834,7 @@ BEGIN IDS_QS_MODEL_A500P "Basic non-expanded configuration\nThe A500+ adds an ECS Agnus chip, 1 MB of Chip RAM and a 2.0 ROM to the A500. Many A500 games and demos don't work properly on an A500+.\n2 MB Chip RAM expanded configuration\n\n4 MB Fast RAM expanded configuration\n" IDS_QS_MODEL_A600 "Basic non-expanded configuration\nThe A600 is smaller than the A500+ and has an updated 2.0 ROM.\n2 MB Chip RAM expanded configuration\n\n4 MB Fast RAM expanded configuration\n" IDS_QS_MODEL_A1000 "512 KB Chip RAM\nThe A1000 was the first model produced, with a configuration equivalent to that of an A500 with OCS chipset. You normally don't need to use this configuration, unless you are nostalgic and would like to hear the short A1000 boot tune\n""ICS"" Denise without EHB support\nVery first A1000 models had Denise without EHB capability.\n256 KB Chip RAM\n Unexpanded A1000. All later A1000 models were sold with a 256 KB RAM expansion built-in." - IDS_QS_MODEL_A1200 "Basic non-expanded configuration\nUse this configuration to run most AGA demos and games\n4 MB Fast RAM expanded configuration\nSome newer AGA games and demos need an expanded A1200 to run." + IDS_QS_MODEL_A1200 "Basic non-expanded configuration\nUse this configuration to run most AGA demos and games\n4 MB Fast RAM expanded configuration\nSome newer AGA games and demos need an expanded A1200 to run.\nBlizzard 1230 IV\n\nBlizzard 1240\n\nBlizzard 1260\n\nBlizzard PPC\n" IDS_QS_MODEL_CD32 "CD32\nThe CD32 was one the first 32-bit consoles on the market. It is basically an A1200 with a built-in CD-ROM drive. Insert your CD32 or CDTV CD-ROM into a free CD-ROM drive before starting the emulation.\nCD32 with Full Motion Video cartridge\n" IDS_QS_MODEL_CDTV "CDTV\nThe CDTV was the first model with a built-in CD-ROM drive. Looking like a black CD player, it featured a configuration equivalent to that of an A500 with 1 MB RAM and an ECS chipset.\nFloppy drive and 64KB SRAM card expanded CDTV\n\nCDTV-CR\n" END @@ -1844,7 +1844,7 @@ BEGIN IDS_QS_MODEL_UAE "High-end expanded configuration" IDS_QS_MODEL_ARCADIA "Arcadia\nArcadia Multi Select system is arcade platform developed by Arcadia and Mastertronic. It is based on an A500 mainboard with ROM cage attached to expansion port. Arcadia ROM files go to ""Cartridge ROM File"" in ROM-panel." IDS_QS_MODEL_A3000 "1.4 ROM, 2MB Chip + 8MB Fast\n\n2.04 ROM, 2MB Chip + 8MB Fast\n\n3.1 ROM, 2MB Chip + 8MB Fast\n" - IDS_QS_MODEL_A4000 "68030, 3.1 ROM, 2MB Chip + 8MB Fast\n\n68040, 3.1 ROM, 2MB Chip + 8MB Fast\n" + IDS_QS_MODEL_A4000 "68030, 3.1 ROM, 2MB Chip + 8MB Fast\n\n68040, 3.1 ROM, 2MB Chip + 8MB Fast\n\nCyberStorm PPC\n" IDS_QS_MODEL_A4000T "A4000T (test)\nA4000T" END @@ -1943,6 +1943,7 @@ BEGIN IDS_FILTER_3D_EXTRA "Point/Bilinear\nScanline opacity\nScanline level\n" IDS_ALWAYS_ON "Always on" IDS_DISPLAY_ATTRIBUTES "Brightness\nContrast\nGamma" + IDS_NUMSG_NO_PPC "PPC CPU was started but PPC CPU emulation core plugin was not found." END #endif // English resources diff --git a/od-win32/sysconfig.h b/od-win32/sysconfig.h index 925d2303..c6a5e728 100644 --- a/od-win32/sysconfig.h +++ b/od-win32/sysconfig.h @@ -55,8 +55,10 @@ #define CPUEMU_13 /* 68000/68010 cycle-exact cpu&blitter */ #define CPUEMU_20 /* 68020 prefetch */ #define CPUEMU_21 /* 68020 "cycle-exact" + blitter */ -#define CPUEMU_22 /* 68030 "cycle-exact" + blitter */ -#define CPUEMU_23 /* 68040/060 "cycle-exact" + blitter */ +#define CPUEMU_22 /* 68030 prefetch */ +#define CPUEMU_23 /* 68030 "cycle-exact" + blitter */ +#define CPUEMU_24 /* 68060 "cycle-exact" + blitter */ +#define CPUEMU_25 /* 68040 "cycle-exact" + blitter */ #define CPUEMU_31 /* Aranym 68040 MMU */ #define CPUEMU_32 /* Previous 68030 MMU */ #define CPUEMU_33 /* 68060 MMU */ diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 97a82298..e391474c 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -94,7 +94,8 @@ #endif #include "uae/ppc.h" -extern int harddrive_dangerous, do_rdbdump, no_rawinput, no_directinput; +extern int harddrive_dangerous, do_rdbdump; +extern int no_rawinput, no_directinput, no_windowsmouse; extern int force_directsound; extern int log_a2065, a2065_promiscuous; extern int rawinput_enabled_hid, rawinput_log; @@ -5050,6 +5051,10 @@ static int parseargs (const TCHAR *argx, const TCHAR *np, const TCHAR *np2) no_directinput = 1; return 1; } + if (!_tcscmp (arg, _T("nowindowsmouse"))) { + no_windowsmouse = 1; + return 1; + } if (!_tcscmp (arg, _T("rawhid"))) { rawinput_enabled_hid = 1; return 1; @@ -6324,7 +6329,7 @@ void *uaenative_get_uaevar (void) #ifdef _WIN32 uaevar.amigawnd = hAmigaWnd; #endif - uaevar.z3offset = (uae_u32)get_real_address (0x10000000) - 0x10000000; + uaevar.z3offset = (uae_u32)get_real_address (z3fastmem_bank.start) - z3fastmem_bank.start; return &uaevar; } diff --git a/od-win32/win32.h b/od-win32/win32.h index b1e5f7fb..dee71dc7 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("23") +#define WINUAEBETA _T("24") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2014, 11, 1) +#define WINUAEDATE MAKEBD(2014, 11, 15) //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index ac35e424..c183e3f4 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -7425,8 +7425,8 @@ static void enable_for_memorydlg (HWND hDlg) ew (hDlg, IDC_Z3FASTMEM, z3); ew (hDlg, IDC_Z3CHIPRAM, z3); ew (hDlg, IDC_Z3CHIPMEM, z3); - ew (hDlg, IDC_FASTMEM, fast); - ew (hDlg, IDC_FASTRAM, fast); + ew (hDlg, IDC_FASTMEM, true); + ew (hDlg, IDC_FASTRAM, true); ew (hDlg, IDC_FASTMEM2, fast); ew (hDlg, IDC_FASTRAM2, fast); ew (hDlg, IDC_FASTMEMAUTOCONFIG, fast); @@ -7532,7 +7532,7 @@ static void values_to_memorydlg (HWND hDlg) workprefs.cpuboardmem1_size = cpuboard_maxmemory(&workprefs); if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_Z2) { - workprefs.fastmem_size = workprefs.cpuboardmem1_size; + workprefs.fastmem2_size = workprefs.cpuboardmem1_size; } mem_size = 0; @@ -8253,7 +8253,7 @@ static INT_PTR CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA currentpage = MEMORY_ID; SendDlgItemMessage (hDlg, IDC_CHIPMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_CHIP_MEM, MAX_CHIP_MEM)); SendDlgItemMessage (hDlg, IDC_FASTMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_FAST_MEM, MAX_FAST_MEM)); - SendDlgItemMessage (hDlg, IDC_FASTMEM2, TBM_SETRANGE, TRUE, MAKELONG (MIN_FAST_MEM, MAX_FAST_MEM - 1)); + SendDlgItemMessage (hDlg, IDC_FASTMEM2, TBM_SETRANGE, TRUE, MAKELONG (MIN_FAST_MEM, MAX_FAST_MEM)); SendDlgItemMessage (hDlg, IDC_SLOWMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_SLOW_MEM, MAX_SLOW_MEM)); SendDlgItemMessage (hDlg, IDC_Z3FASTMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_Z3_MEM, MAX_Z3_MEM)); SendDlgItemMessage (hDlg, IDC_Z3CHIPMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_Z3_MEM, MAX_Z3_CHIPMEM)); @@ -17228,7 +17228,7 @@ static int GetSettings (int all_options, HWND hwnd) } tres = scaleresource (panelresource, hwnd, gui_resize_enabled, workprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0); - dhwnd = CreateDialogIndirect (tres->inst, tres->resource, isfullscreen () > 0 ? hwnd : NULL, DialogProc); + dhwnd = CreateDialogIndirect (tres->inst, tres->resource, isfullscreen () != 0 ? hwnd : NULL, DialogProc); dialog_rect.top = dialog_rect.left = 0; dialog_rect.right = tres->width; dialog_rect.bottom = tres->height; @@ -17812,6 +17812,7 @@ static int transla[] = { NUMSG_KICKREP, IDS_NUMSG_KICKREP, NUMSG_KICKREPNO, IDS_NUMSG_KICKREPNO, NUMSG_KS68030PLUS, IDS_NUMSG_KS68030PLUS, + NUMSG_NO_PPC, IDS_NUMSG_NO_PPC, -1 }; diff --git a/od-win32/winuae_msvc11/winuae_msvc.vcxproj b/od-win32/winuae_msvc11/winuae_msvc.vcxproj index 17aacf3c..e20b5bec 100644 --- a/od-win32/winuae_msvc11/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc11/winuae_msvc.vcxproj @@ -799,6 +799,7 @@ + diff --git a/od-win32/winuae_msvc11/winuae_msvc.vcxproj.filters b/od-win32/winuae_msvc11/winuae_msvc.vcxproj.filters index cee2a4fe..5b08fe48 100644 --- a/od-win32/winuae_msvc11/winuae_msvc.vcxproj.filters +++ b/od-win32/winuae_msvc11/winuae_msvc.vcxproj.filters @@ -712,6 +712,9 @@ qemu + + common + diff --git a/ppc/ppc.cpp b/ppc/ppc.cpp index 1b60bec0..7b06f1d0 100644 --- a/ppc/ppc.cpp +++ b/ppc/ppc.cpp @@ -9,6 +9,7 @@ #include "debug.h" #include "custom.h" #include "uae.h" +#include "gui.h" #include "uae/dlopen.h" #include "uae/ppc.h" @@ -219,7 +220,7 @@ static bool load_qemu_implementation(void) UAE_DLHANDLE handle = uae_qemu_uae_init(); if (!handle) { - gui_message(_T("PPC: Error loading qemu-uae library\n")); + notify_user (NUMSG_NO_PPC); return false; } write_log(_T("PPC: Loaded qemu-uae library at %p\n"), handle); @@ -398,11 +399,11 @@ static void map_banks(void) regions[i].memory = r->memory; } - if (impl.in_cpu_thread() == false) { + if (impl.in_cpu_thread && impl.in_cpu_thread() == false) { uae_ppc_spinlock_release(); } impl.map_memory(regions, map.num_regions); - if (impl.in_cpu_thread() == false) { + if (impl.in_cpu_thread && impl.in_cpu_thread() == false) { uae_ppc_spinlock_get(); } -- 2.47.3