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;
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;
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;
*
*/
-#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)
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;
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
_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"),
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);
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);
}
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)
|| 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;
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;
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;
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;
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;
/* REG_INT 0x28 */
// 0x40 always set
// 0x20
-// 0x10 always cleared
+// 0x10 always set
// 0x08
// 0x04 // MOS sets this bit
#define P5_ENABLE_IPL 0x02
} 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) {
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;
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)
{
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;
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;
#include "cpuboard.h"
#include "uae/ppc.h"
+#define EXP_DEBUG 0
+
#define MAX_EXPANSION_BOARDS 11
/* ********************************************************** */
}
}
-addrbank expamem_null;
+addrbank expamem_null, expamem_none;
DECLARE_MEMORY_FUNCTIONS(expamem);
addrbank expamem_bank = {
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;
code = expamem_read(0);
if ((code & 0xc0) == 0xc0) {
+ // Z2
code &= 7;
if (code == 0)
expamem_z2_size = 8 * 1024 * 1024;
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)
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;
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
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
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;
}
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);
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);
#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];
}
#ifdef JIT
special_mem |= S_WRITE;
#endif
-#ifdef EXP_DEBUG
+#if EXP_DEBUG
write_log (_T("filesys_bput %x %x\n"), addr, b);
#endif
}
{
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;
}
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;
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);
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;
}
#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;
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);
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;
int eeprom_addr;
int size;
int write_offset;
+ int addressbitmask;
uae_u8 *memory;
struct zfile *zf;
};
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);
s->memory = memory;
s->size = size;
s->zf = zf;
+ s->addressbitmask = (size / 256) - 1;
return s;
}
}
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;
generate_includes (stdout, id);
}
+ using_indirect = 0;
+ using_exception_3 = 1;
using_prefetch = 0;
using_prefetch_020 = 0;
using_ce = 0;
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;
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;
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);
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);
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);
}
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;
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;
map_banks (ab, b, gfxboard_bank_registers.allocated >> 16, gfxboard_bank_registers.allocated);
}
configured_regs = b;
- init_board ();
expamem_next (ab, NULL);
return;
}
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;
}
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);
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);
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;
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;
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);
/* 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[];
int filesys_limit;
int filesys_max_name;
int filesys_max_file_size;
+ int uaescsidevmode;
bool reset_delay;
int cs_compatible;
bool cs_cd32c2p;
bool cs_cd32nvram;
bool cs_cd32fmv;
+ int cs_cd32nvram_size;
bool cs_cdtvcd;
bool cs_cdtvram;
int cs_cdtvcard;
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)
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) {
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)
}
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."));
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);
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;
// 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)
}
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;
}
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;
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 ();
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;
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 ();
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;
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);
{
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);
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;
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;
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) {
#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)
{
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;
_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) {
}
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) {
} 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 ();
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) {
#include "registry.h"
#include "fsdb.h"
#include "threaddep/thread.h"
+#include "zfile.h"
#define MAX_AVI_SIZE (0x80000000 - 0x1000000)
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;
/* audio */
+static int FirstAudio;
+static DWORD dwAudioInputRemaining;
static unsigned int StreamSizeAudio; // audio write position
static double StreamSizeAudioExpected;
static PAVISTREAM AVIAudioStream = NULL; // compressed stream pointer
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 */
void AVIOutput_ReleaseAudio (void)
{
- if (pwfxDst) {
- xfree (pwfxDst);
- pwfxDst = NULL;
- }
+}
+
+static void AVIOutput_FreeAudioDstFormat ()
+{
+ xfree (pwfxDst);
+ pwfxDst = NULL;
}
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;
}
}
- 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);
//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;
}
}
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)
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;
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
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);
destroy_comm_pipe (&workindex);
destroy_comm_pipe (&queuefull);
if (has) {
- acmStreamUnprepareHeader (has, &ash, 0);
acmStreamClose (has, 0);
has = NULL;
}
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) {
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);
void AVIOutput_Initialize (void)
{
+
if (avioutput_init)
return;
if (!pcompvars)
return;
pcompvars->cbSize = sizeof (COMPVARS);
+
AVIFileInit ();
avioutput_init = 1;
}
if (idx == 0xfffffffe || idx == 0xffffffff)
break;
}
+ AVIOutput_AVIWriteAudio_Thread_End();
write_log (_T("AVIOutput worker thread killed\n"));
alive = 0;
return 0;
int no_rawinput = 0;
int no_directinput = 0;
+int no_windowsmouse = 0;
static int dinput_enum_all;
int dinput_winmouse (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;
}
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);
}
}
- 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"));
}
}
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);
#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
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
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
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
#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 */
#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;
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;
#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;
}
#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")
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);
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;
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));
}
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;
NUMSG_KICKREP, IDS_NUMSG_KICKREP,
NUMSG_KICKREPNO, IDS_NUMSG_KICKREPNO,
NUMSG_KS68030PLUS, IDS_NUMSG_KS68030PLUS,
+ NUMSG_NO_PPC, IDS_NUMSG_NO_PPC,
-1
};
<ClCompile Include="..\..\cpuemu_21.cpp" />
<ClCompile Include="..\..\cpuemu_22.cpp" />
<ClCompile Include="..\..\cpuemu_23.cpp" />
+ <ClCompile Include="..\..\cpuemu_24.cpp" />
<ClCompile Include="..\..\cpuemu_32.cpp" />
<ClCompile Include="..\..\cpuemu_33.cpp" />
<ClCompile Include="..\..\cpuemu_40.cpp" />
<ClCompile Include="..\..\qemuvga\qemu.cpp">
<Filter>qemu</Filter>
</ClCompile>
+ <ClCompile Include="..\..\cpuemu_24.cpp">
+ <Filter>common</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\resources\35floppy.ico">
#include "debug.h"
#include "custom.h"
#include "uae.h"
+#include "gui.h"
#include "uae/dlopen.h"
#include "uae/ppc.h"
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);
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();
}