static uae_u8 scsidelay_status[WD_STATUS_QUEUE];
static int queue_index;
-static int wd33c93a = 1;
+static int wd33c93_ver = 1; // A
struct scsi_data *scsis[8];
static struct scsi_data *scsi;
return tc == 0;
}
+static bool canwddma (void)
+{
+ uae_u8 mode = wdregs[WD_CONTROL] >> 5;
+ if (mode != 0 && mode != 4 && mode != 1) {
+ write_log (_T("%s weird DMA mode %d!!\n"), WD33C93, mode);
+ }
+ return mode == 4 || mode == 1;
+}
+
static TCHAR *scsitostring (void)
{
static TCHAR buf[200];
wdregs[WD_COMMAND_PHASE] = 0x10;
}
#if WD33C93_DEBUG > 0
- write_log (_T("* %s select and transfer%s, ID=%d PHASE=%02X TC=%d\n"),
- WD33C93, atn ? _T(" with atn") : _T(""), wdregs[WD_DESTINATION_ID] & 0x7, wdregs[WD_COMMAND_PHASE], tmp_tc);
+ write_log (_T("* %s select and transfer%s, ID=%d PHASE=%02X TC=%d wddma=%d dmac=%d\n"),
+ WD33C93, atn ? _T(" with atn") : _T(""), wdregs[WD_DESTINATION_ID] & 0x7, wdregs[WD_COMMAND_PHASE], tmp_tc, wdregs[WD_CONTROL] >> 5, dmac_dma);
#endif
if (wdregs[WD_COMMAND_PHASE] <= 0x30) {
scsi->buffer[0] = 0;
wdregs[WD_COMMAND_PHASE] = 0x44;
}
- if (wdregs[WD_COMMAND_PHASE] == 0x44) {
+ // target replied or start/continue data phase (if data available)
+ if (wdregs[WD_COMMAND_PHASE] == 0x44 || wdregs[WD_COMMAND_PHASE] == 0x45) {
settc (tmp_tc);
wd_dataoffset = 0;
- // target replied
setphase (0x45);
scsi_start_transfer (scsi);
if (scsi->direction) {
scsi_start_transfer (scsi);
- if ((wdregs[WD_CONTROL] >> 5) == 4) {
+ if (canwddma ()) {
if (scsi->direction <= 0) {
scsi_emulate_cmd (scsi);
do_dma ();
scsi->data_len = gettc ();
}
- if ((wdregs[WD_CONTROL] >> 5) == 4) {
+ if (canwddma ()) {
wd_data_avail = -1;
} else {
wd_data_avail = 1;
for (i = 1; i < 0x16; i++)
wdregs[i] = 0;
wdregs[0x18] = 0;
- if (!wd33c93a)
- wdregs[0] &= ~(0x08 | 0x10);
sasr = 0;
wd_selected = false;
scsi = NULL;
return 0;
}
+static void writewdreg (int sasr, uae_u8 val)
+{
+ switch (sasr)
+ {
+ case WD_OWN_ID:
+ if (wd33c93_ver == 0)
+ val &= ~(0x20 | 0x08);
+ else if (wd33c93_ver == 1)
+ val &= ~0x20;
+ break;
+ }
+ if (sasr > WD_QUEUE_TAG && sasr < WD_AUXILIARY_STATUS)
+ return;
+ // queue tag is B revision only
+ if (sasr == WD_QUEUE_TAG && wd33c93_ver < 2)
+ return;
+ wdregs[sasr] = val;
+}
+
void wdscsi_put (uae_u8 d)
{
#if WD33C93_DEBUG > 1
if (WD33C93_DEBUG > 3 || sasr != WD_DATA)
write_log (_T("W %s REG %02X = %02X (%d) PC=%08X\n"), WD33C93, sasr, d, d, M68K_GETPC);
#endif
- if (!writeonlyreg (sasr))
- wdregs[sasr] = d;
+ if (!writeonlyreg (sasr)) {
+ writewdreg (sasr, d);
+ }
if (!wd_used) {
wd_used = 1;
write_log (_T("%s in use\n"), WD33C93);
cdaudiostop ();
akiko_thread_running = 0;
while(akiko_thread_running == 0)
- Sleep (10);
+ sleep_millis (10);
akiko_thread_running = 0;
}
akiko_cdrom_free ();
write_log (_T("AFWM=%04X ALWM=%04X MOD A=%04X B=%04X C=%04X D=%04X\n"),
blt_info.bltafwm, blt_info.bltalwm,
blt_info.bltamod & 0xffff, blt_info.bltbmod & 0xffff, blt_info.bltcmod & 0xffff, blt_info.bltdmod & 0xffff);
+ write_log (_T("PC=%08X DMA=%d\n"), m68k_getpc (), dmaen (DMA_BLITTER));
}
STATIC_INLINE const int *get_ch (void)
extern int is_bitplane_dma (int hpos);
STATIC_INLINE int canblit (int hpos)
{
+ if (!dmaen (DMA_BLITTER))
+ return 0;
if (is_bitplane_dma (hpos))
return 0;
if (cycle_line[hpos] & CYCLE_MASK)
break;
}
- if ((!dmaen (DMA_BLITTER) || v <= 0) && (c == 3 || c == 4)) {
- blit_misscyclecounter++;
- blitter_nasty++;
- break;
- }
-
blit_cyclecounter++;
blit_totalcyclecounter++;
}
blitter_nasty++;
-
- if (!dmaen (DMA_BLITTER) || v <= 0) {
- blit_misscyclecounter++;
- break;
- }
-
blt_info.got_cycle = 1;
if (c == 4) {
blitter_doddma (last_blitter_hpos);
blit_frozen = 1;
write_log (_T("BLITTER: frozen! %d (%d) -> %d (%d) %08X\n"), original_ch, iseo, blit_ch, isen, M68K_GETPC);
} else if (!iseo && isen) {
- if (log_blitter & 2)
+ if (!dmaen (DMA_BLITTER)) // subtle shades / nuance bootblock bug
+ blit_frozen = 1;
+ if (log_blitter)
write_log (_T("BLITTER: on the fly %d (%d) -> %d (%d) switch\n"), original_ch, iseo, blit_ch, isen);
}
}
}
if (blt_info.vblitsize == 0 || (blitline && blt_info.hblitsize != 2)) {
- blitter_done (hpos);
+ if (dmaen (DMA_BLITTER))
+ blitter_done (hpos);
return;
}
blit_waitcyclecounter = 0;
if (currprefs.immediate_blits) {
- if (dmaen (DMA_BLITTER)) {
+ if (dmaen (DMA_BLITTER))
blitter_doit ();
- return;
- }
return;
}
#include "memory.h"
#include "newcpu.h"
#include "cpummu.h"
+#include "debug.h"
#define DBG_MMU_VERBOSE 1
#define DBG_MMU_SANITY 1
ssw |= MMU_SSW_TT1;
if ((fc2 & 3) != 3)
fc2 &= ~2;
-#if MMUDEBUG > 0
+#if MMUDEBUGMISC > 0
write_log (_T("040 MMU MOVES fc=%d -> %d\n"), fc, fc2);
#endif
fc = fc2;
if (locked_rmw_cycle) {
ssw |= MMU_SSW_LK | MMU_SSW_RW;
locked_rmw_cycle = false;
-#if MMUDEBUG > 0
+#if MMUDEBUGMISC > 0
write_log (_T("040 MMU_SSW_LK!\n"));
#endif
}
uae_u32 fslw = 0;
fslw |= write ? MMU_FSLW_W : MMU_FSLW_R;
-#if 0
- // read-modify-write?
- if (table68k[mmu060_opcode].rmw) {
- fslw |= MMU_FSLW_W | MMU_FSLW_R;
- }
-#endif
-
fslw |= fc << 16; /* MMU_FSLW_TM */
+
switch (size) {
case sz_byte:
fslw |= MMU_FSLW_SIZE_B;
}
if ((fc & 3) == 2) {
// instruction faults always point to opcode address
+#if MMUDEBUGMISC > 0
+ write_log(_T("INS FAULT %08x %08x %d\n"), addr, regs.instruction_pc, mmu060_state);
+#endif
addr = regs.instruction_pc;
if (mmu060_state == 0) {
fslw |= MMU_FSLW_IO; // opword fetch
regs.mmu_fslw = fslw;
#if MMUDEBUG > 0
- write_log(_T("BF: fc=%d w=%d logical=%08x ssw=%08x rmw=%d PC=%08x INS=%04X\n"), fc, write, addr, fslw, rmw, m68k_getpc(), mmu_opcode);
+ write_log(_T("BF: fc=%d w=%d s=%d log=%08x ssw=%08x rmw=%d PC=%08x INS=%04X\n"), fc, write, 1 << size, addr, fslw, rmw, m68k_getpc(), mmu_opcode);
#endif
}
uaecptr REGPARAM2 mmu_translate(uaecptr addr, bool super, bool data, bool write)
{
struct mmu_atc_line *l;
- uae_u32 status;
+ uae_u32 status = 0;
// this should return a miss but choose a valid line
mmu_user_lookup(addr, super, data, write, &l);
#if MMUDEBUG > 2
write_log(_T("[MMU] mmu_translate error"));
#endif
- THROW(2);
+ mmu_bus_error(addr, mmu_get_fc(super, data), write, 0, false, status);
+ return 0;
}
return l->phys | (addr & mmu_pagemask);
return desc;
}
+static void misalignednotfirst(uaecptr addr)
+{
+#if MMUDEBUGMISC > 0
+ write_log (_T("misalignednotfirst %08x -> %08x %08X\n"), regs.mmu_fault_addr, addr, regs.instruction_pc);
+#endif
+ regs.mmu_fault_addr = addr;
+ regs.mmu_fslw |= MMU_FSLW_MA;
+ regs.mmu_ssw |= MMU_SSW_MA;
+}
+
+static void misalignednotfirstcheck(uaecptr addr)
+{
+#if MMUDEBUGMISC > 0
+ write_log (_T("misalignednotfirstcheck %08x -> %08x %08X\n"), regs.mmu_fault_addr, addr, regs.instruction_pc);
+#endif
+ if (regs.mmu_fault_addr == addr)
+ return;
+ misalignednotfirst (addr);
+}
+
uae_u16 REGPARAM2 mmu_get_word_unaligned(uaecptr addr, bool data, bool rmw)
{
uae_u16 res;
}
CATCH(prb) {
RESTORE_EXCEPTION;
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
+ misalignednotfirst(addr);
THROW_AGAIN(prb);
} ENDTRY
return res;
}
CATCH(prb) {
RESTORE_EXCEPTION;
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
+ misalignednotfirst(addr);
THROW_AGAIN(prb);
} ENDTRY
} else {
}
CATCH(prb) {
RESTORE_EXCEPTION;
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
+ misalignednotfirst(addr);
THROW_AGAIN(prb);
} ENDTRY
}
{
uae_u16 res;
- res = (uae_u16)mmu_get_user_byte(addr, regs.s != 0, false, true, sz_word) << 8;
+ res = (uae_u16)mmu_get_user_byte(addr, regs.s != 0, true, true, sz_word) << 8;
SAVE_EXCEPTION;
TRY(prb) {
- res |= mmu_get_user_byte(addr + 1, regs.s != 0, false, true, sz_word);
+ res |= mmu_get_user_byte(addr + 1, regs.s != 0, true, true, sz_word);
RESTORE_EXCEPTION;
}
CATCH(prb) {
RESTORE_EXCEPTION;
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
+ misalignednotfirst(addr);
THROW_AGAIN(prb);
} ENDTRY
return res;
uae_u32 res;
if (likely(!(addr & 1))) {
- res = (uae_u32)mmu_get_user_word(addr, regs.s != 0, false, true, sz_long) << 16;
+ res = (uae_u32)mmu_get_user_word(addr, regs.s != 0, true, true, sz_long) << 16;
SAVE_EXCEPTION;
TRY(prb) {
- res |= mmu_get_user_word(addr + 2, regs.s != 0, false, true, sz_long);
+ res |= mmu_get_user_word(addr + 2, regs.s != 0, true, true, sz_long);
RESTORE_EXCEPTION;
}
CATCH(prb) {
RESTORE_EXCEPTION;
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
+ misalignednotfirst(addr);
THROW_AGAIN(prb);
} ENDTRY
} else {
- res = (uae_u32)mmu_get_user_byte(addr, regs.s != 0, false, true, sz_long) << 8;
+ res = (uae_u32)mmu_get_user_byte(addr, regs.s != 0, true, true, sz_long) << 8;
SAVE_EXCEPTION;
TRY(prb) {
- res = (res | mmu_get_user_byte(addr + 1, regs.s != 0, false, true, sz_long)) << 8;
- res = (res | mmu_get_user_byte(addr + 2, regs.s != 0, false, true, sz_long)) << 8;
- res |= mmu_get_user_byte(addr + 3, regs.s != 0, false, true, sz_long);
+ res = (res | mmu_get_user_byte(addr + 1, regs.s != 0, true, true, sz_long)) << 8;
+ res = (res | mmu_get_user_byte(addr + 2, regs.s != 0, true, true, sz_long)) << 8;
+ res |= mmu_get_user_byte(addr + 3, regs.s != 0, true, true, sz_long);
RESTORE_EXCEPTION;
}
CATCH(prb) {
RESTORE_EXCEPTION;
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
+ misalignednotfirst(addr);
THROW_AGAIN(prb);
} ENDTRY
}
CATCH(prb) {
RESTORE_EXCEPTION;
regs.wb3_data = val;
- if (regs.mmu_fault_addr != addr) {
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
- }
+ misalignednotfirstcheck(addr);
THROW_AGAIN(prb);
} ENDTRY
}
CATCH(prb) {
RESTORE_EXCEPTION;
regs.wb3_data = val;
- if (regs.mmu_fault_addr != addr) {
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
- }
+ misalignednotfirstcheck(addr);
THROW_AGAIN(prb);
} ENDTRY
}
}
CATCH(prb) {
RESTORE_EXCEPTION;
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
+ misalignednotfirst(addr);
THROW_AGAIN(prb);
} ENDTRY
} else {
}
CATCH(prb) {
RESTORE_EXCEPTION;
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
+ misalignednotfirst(addr);
THROW_AGAIN(prb);
} ENDTRY
}
}
CATCH(prb) {
RESTORE_EXCEPTION;
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
+ misalignednotfirst(addr);
THROW_AGAIN(prb);
} ENDTRY
}
CATCH(prb) {
RESTORE_EXCEPTION;
regs.wb3_data = val;
- if (regs.mmu_fault_addr != addr) {
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
- }
+ misalignednotfirstcheck(addr);
THROW_AGAIN(prb);
} ENDTRY
ismoves = false;
CATCH(prb) {
RESTORE_EXCEPTION;
regs.wb3_data = val;
- if (regs.mmu_fault_addr != addr) {
- regs.mmu_fault_addr = addr;
- regs.mmu_fslw |= MMU_FSLW_MA;
- regs.mmu_ssw |= MMU_SSW_MA;
- }
+ misalignednotfirstcheck(addr);
THROW_AGAIN(prb);
} ENDTRY
ismoves = false;
{
int way,type,index;
- uaecptr tag = (mmu_is_super | (addr >> 1)) & mmu_tagmask;
+ uaecptr tag = ((super ? 0x80000000 : 0) | (addr >> 1)) & mmu_tagmask;
if (mmu_pagesize_8k)
index=(addr & 0x0001E000)>>13;
else
index=(addr & 0x0000F000)>>12;
- for (type=0;type<ATC_TYPE;type++)
- for (way=0;way<ATC_WAYS;way++) {
- if (!global && mmu_atc_array[type][way][index].global)
- continue;
- // if we have this
- if ((tag == mmu_atc_array[type][way][index].tag) && (mmu_atc_array[type][way][index].valid)) {
- mmu_atc_array[type][way][index].valid=false;
+ for (type=0;type<ATC_TYPE;type++) {
+ for (way=0;way<ATC_WAYS;way++) {
+ if (!global && mmu_atc_array[type][way][index].global)
+ continue;
+ // if we have this
+ if ((tag == mmu_atc_array[type][way][index].tag) && (mmu_atc_array[type][way][index].valid)) {
+ mmu_atc_array[type][way][index].valid=false;
+ }
}
}
}
void REGPARAM2 mmu_flush_atc_all(bool global)
{
unsigned int way,slot,type;
- for (type=0;type<ATC_TYPE;type++)
- for (way=0;way<ATC_WAYS;way++)
- for (slot=0;slot<ATC_SLOTS;slot++) {
- if (!global && mmu_atc_array[type][way][slot].global)
- continue;
- mmu_atc_array[type][way][slot].valid=false;
+ for (type=0;type<ATC_TYPE;type++) {
+ for (way=0;way<ATC_WAYS;way++) {
+ for (slot=0;slot<ATC_SLOTS;slot++) {
+ if (!global && mmu_atc_array[type][way][slot].global)
+ continue;
+ mmu_atc_array[type][way][slot].valid=false;
+ }
+ }
}
}
}
}
+void m68k_do_rte_mmu060 (uaecptr a7)
+{
+#if 0
+ mmu060_state = 2;
+#endif
+}
+
void flush_mmu040 (uaecptr addr, int n)
{
}
return v;
}
+uae_u32 REGPARAM2 mmu060_get_rmw_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width)
+{
+ uae_u32 tmp1, tmp2, res, mask;
+
+ offset &= 7;
+ mask = 0xffffffffu << (32 - width);
+ switch ((offset + width + 7) >> 3) {
+ case 1:
+ tmp1 = get_rmw_byte_mmu060 (src);
+ res = tmp1 << (24 + offset);
+ bdata[0] = tmp1 & ~(mask >> (24 + offset));
+ break;
+ case 2:
+ tmp1 = get_rmw_word_mmu060 (src);
+ res = tmp1 << (16 + offset);
+ bdata[0] = tmp1 & ~(mask >> (16 + offset));
+ break;
+ case 3:
+ tmp1 = get_rmw_word_mmu060 (src);
+ tmp2 = get_rmw_byte_mmu060 (src + 2);
+ res = tmp1 << (16 + offset);
+ bdata[0] = tmp1 & ~(mask >> (16 + offset));
+ res |= tmp2 << (8 + offset);
+ bdata[1] = tmp2 & ~(mask >> (8 + offset));
+ break;
+ case 4:
+ tmp1 = get_rmw_long_mmu060 (src);
+ res = tmp1 << offset;
+ bdata[0] = tmp1 & ~(mask >> offset);
+ break;
+ case 5:
+ tmp1 = get_rmw_long_mmu060 (src);
+ tmp2 = get_rmw_byte_mmu060 (src + 4);
+ res = tmp1 << offset;
+ bdata[0] = tmp1 & ~(mask >> offset);
+ res |= tmp2 >> (8 - offset);
+ bdata[1] = tmp2 & ~(mask << (8 - offset));
+ break;
+ default:
+ /* Panic? */
+ write_log (_T("x_get_bitfield() can't happen %d\n"), (offset + width + 7) >> 3);
+ res = 0;
+ break;
+ }
+ return res;
+}
+
+void REGPARAM2 mmu060_put_rmw_bitfield (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 offset, int width)
+{
+ offset = (offset & 7) + width;
+ switch ((offset + 7) >> 3) {
+ case 1:
+ put_rmw_byte_mmu060 (dst, bdata[0] | (val << (8 - offset)));
+ break;
+ case 2:
+ put_rmw_word_mmu060 (dst, bdata[0] | (val << (16 - offset)));
+ break;
+ case 3:
+ put_rmw_word_mmu060 (dst, bdata[0] | (val >> (offset - 16)));
+ put_rmw_byte_mmu060 (dst + 2, bdata[1] | (val << (24 - offset)));
+ break;
+ case 4:
+ put_rmw_long_mmu060 (dst, bdata[0] | (val << (32 - offset)));
+ break;
+ case 5:
+ put_rmw_long_mmu060 (dst, bdata[0] | (val >> (offset - 32)));
+ put_rmw_byte_mmu060 (dst + 4, bdata[1] | (val << (40 - offset)));
+ break;
+ default:
+ write_log (_T("x_put_bitfield() can't happen %d\n"), (offset + 7) >> 3);
+ break;
+ }
+}
+
+
#ifndef __cplusplus
jmp_buf __exbuf;
int __exvalue;
return;
if (plf_state == plf_end)
return;
- pos += flush_plane_data (fm);
plf_state = plf_end;
- ddfstate = DIW_waiting_start;
- fetch_state = fetch_not_started;
+ if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS)) {
+ finish_final_fetch (fm);
+ } else {
+ bpl1dat_early = true;
+ pos += flush_plane_data (fm);
+ ddfstate = DIW_waiting_start;
+ fetch_state = fetch_not_started;
+ }
}
STATIC_INLINE int one_fetch_cycle_0 (int pos, int ddfstop_to_test, int dma, int fm)
cycle_diagram_shift = hstart;
bpldmawasactive = true;
+
}
last_fetch_hpos = hstart;
plfstop = 0xff;
plfstrt_start = HARD_DDF_START_REAL - 2;
} else {
- plfstrt_start = plfstrt - 4;
+ plfstrt_start = plfstrt;
}
}
diw_change = 2;
cnt++;
if (cnt == 500) {
int port_insert_custom (int inputmap_port, int devicetype, DWORD flags, const TCHAR *custom);
- port_insert_custom (0, 2, 0, _T("Fire.autorepeat=0x38 Left=0x4B Right=0x4D Up=0x48 Down=0x50 Fire=0x4C Fire2=0x52'"));
- port_insert_custom (1, 2, 0, _T("Left=0x48 Right=0x50 Up=0x4B Down=0x4D Fire=0x4C"));
- } else if (cnt == 1000) {
+ //port_insert_custom (0, 2, 0, _T("Left=0xCB Right=0xCD Up=0xC8 Down=0xD0 Fire=0x39 Fire.autorepeat=0xD2"));
+ port_insert_custom (1, 2, 0, _T("Left=0x1E Right=0x20 Up=0x11 Down=0x1F Fire=0x38"));
+ } else if (0 && cnt == 1000) {
TCHAR out[256];
bool port_get_custom (int inputmap_port, TCHAR *out);
port_get_custom (0, out);
return txt;
}
+void mmu_disasm (uaecptr pc, int lines)
+{
+ debug_mmu_mode = regs.s ? 6 : 2;
+ m68k_dumpstate (0xffffffff, NULL);
+ m68k_disasm (pc, NULL, lines);
+}
+
static int mmu_logging;
#define MMU_PAGE_SHIFT 16
#endif
} drive;
-#define MIN_STEPLIMIT_CYCLE (CYCLE_UNIT * 250)
+#define MIN_STEPLIMIT_CYCLE (CYCLE_UNIT * 210)
static uae_u16 bigmfmbufw[0x4000 * DDHDMULT];
static drive floppy[MAX_FLOPPY_DRIVES];
// emulate step limit only if cycle-exact or approximate CPU speed
if (currprefs.m68k_speed != 0)
return;
- drv->steplimit = 10;
+ drv->steplimit = 4;
drv->steplimitcycle = get_cycles ();
}
cdname_amiga = uip[unit_no].devname_amiga;
uip[unit_no].devno = unit_no;
type = FILESYS_VIRTUAL;
- gui_flicker_led (LED_CD, cd_unit_no, -1);
+ gui_flicker_led (LED_CD, cd_unit_no, 0);
write_log (_T("Mounting uaescsi.device %d: (%d)\n"), cd_unit_no, unit_no);
put_long (parmpacket + 0, cdname_amiga);
} else {
- gui_flicker_led (LED_HD, unit_no, -1);
+ gui_flicker_led (LED_HD, unit_no, 0);
type = is_hardfile (unit_no);
if (type == FILESYS_HARDFILE_RDB || type == FILESYS_HARDDRIVE) {
/* RDB hardfile */
#endif
}
-static void fpu_op_illg (uae_u32 opcode, int pcoffset)
+static void fpu_op_illg2 (uae_u16 opcode, uae_u32 ea, uaecptr oldpc)
{
if ((currprefs.cpu_model == 68060 && (currprefs.fpu_model == 0 || (regs.pcr & 2)))
|| (currprefs.cpu_model == 68040 && currprefs.fpu_model == 0)) {
/* 68040 unimplemented/68060 FPU disabled exception.
* Line F exception with different stack frame.. */
uaecptr newpc = m68k_getpc ();
- uaecptr oldpc = newpc - pcoffset;
regs.t0 = regs.t1 = 0;
MakeSR ();
if (!regs.s) {
m68k_areg (regs, 7) = regs.isp;
}
regs.s = 1;
- m68k_areg (regs, 7) -= 4;
- x_put_long (m68k_areg (regs, 7), oldpc);
- m68k_areg (regs, 7) -= 4;
- x_put_long (m68k_areg (regs, 7), oldpc);
- m68k_areg (regs, 7) -= 2;
- x_put_long (m68k_areg (regs, 7), 0x4000 + 11 * 4);
- m68k_areg (regs, 7) -= 4;
+ if (currprefs.cpu_model == 68060) {
+ m68k_areg (regs, 7) -= 4;
+ x_put_long (m68k_areg (regs, 7), oldpc);
+ m68k_areg (regs, 7) -= 4;
+ x_put_long (m68k_areg (regs, 7), ea);
+ m68k_areg (regs, 7) -= 2;
+ x_put_long (m68k_areg (regs, 7), 0x4000 + 11 * 4);
+ m68k_areg (regs, 7) -= 4;
+ } else {
+ m68k_areg (regs, 7) -= 4;
+ x_put_long (m68k_areg (regs, 7), ea);
+ m68k_areg (regs, 7) -= 2;
+ x_put_long (m68k_areg (regs, 7), 0x2000 + 11 * 4);
+ m68k_areg (regs, 7) -= 4;
+ }
x_put_long (m68k_areg (regs, 7), newpc);
m68k_areg (regs, 7) -= 2;
x_put_long (m68k_areg (regs, 7), regs.sr);
- write_log (_T("68040/060 FPU disabled exception PC=%x\n"), newpc);
+ write_log (_T("68040/060 FPU disabled exception OP=%04X EA=%08X PC=%08X\n"), opcode, ea, oldpc);
newpc = x_get_long (regs.vbr + 11 * 4);
m68k_setpc (newpc);
#ifdef JIT
op_illg (opcode);
}
-static bool fault_if_no_fpu (uae_u32 opcode, int pcoffset)
+static void fpu_op_illg (uae_u16 opcode, uaecptr oldpc)
+{
+ fpu_op_illg2 (opcode, 0, oldpc);
+}
+
+static bool fault_if_no_fpu (uae_u16 opcode, uaecptr ea, uaecptr oldpc)
{
if ((regs.pcr & 2) || currprefs.fpu_model <= 0) {
- fpu_op_illg (opcode, pcoffset);
+ fpu_op_illg2 (opcode, ea, oldpc);
return true;
}
return false;
}
+static void fpu_noinst (uae_u16 opcode, uaecptr pc)
+{
+ write_log (_T("Unknown FPU instruction %04X %08X\n"), opcode, pc);
+ m68k_setpc (pc);
+ op_illg (opcode);
+}
+
+
static int get_fpu_version (void)
{
int v = 0;
}
}
-STATIC_INLINE int get_fp_value (uae_u32 opcode, uae_u16 extra, fptype *src)
+STATIC_INLINE int get_fp_value (uae_u32 opcode, uae_u16 extra, fptype *src, uaecptr oldpc)
{
int size, mode, reg;
uae_u32 ad = 0;
static const int sz2[8] = { 4, 4, 12, 12, 2, 8, 2, 0 };
if (!(extra & 0x4000)) {
+ if (fault_if_no_fpu (opcode, 0, oldpc))
+ return -1;
*src = regs.fp[(extra >> 10) & 7];
return 1;
}
return 0;
}
}
+
+ if (fault_if_no_fpu (opcode, ad, oldpc))
+ return -1;
+
switch (size)
{
case 0:
return 1;
}
-STATIC_INLINE int put_fp_value (fptype value, uae_u32 opcode, uae_u16 extra)
+STATIC_INLINE int put_fp_value (fptype value, uae_u32 opcode, uae_u16 extra, uaecptr oldpc)
{
int size, mode, reg;
- uae_u32 ad;
+ uae_u32 ad = 0;
static int sz1[8] = { 4, 4, 12, 12, 2, 8, 1, 0 };
static int sz2[8] = { 4, 4, 12, 12, 2, 8, 2, 0 };
write_log (_T("PUTFP: %f %04X %04X\n"), value, opcode, extra);
#endif
if (!(extra & 0x4000)) {
+ if (fault_if_no_fpu (opcode, 0, oldpc))
+ return 1;
regs.fp[(extra >> 10) & 7] = value;
return 1;
}
return 0;
}
}
+
+ if (fault_if_no_fpu (opcode, ad, oldpc))
+ return 1;
+
switch (size)
{
case 0:
void fpuop_dbcc (uae_u32 opcode, uae_u16 extra)
{
- uaecptr pc = (uae_u32) m68k_getpc ();
+ uaecptr pc = m68k_getpc ();
uae_s32 disp;
int cc;
if (!isinrom ())
write_log (_T("fdbcc_opp at %08lx\n"), m68k_getpc ());
#endif
- if (fault_if_no_fpu (opcode, 4))
- return;
- regs.fpiar = m68k_getpc () - 4;
disp = (uae_s32) (uae_s16) x_next_iword ();
+ if (fault_if_no_fpu (opcode, pc + disp, pc))
+ return;
+ regs.fpiar = m68k_getpc () - 4;
cc = fpp_cond (extra & 0x3f);
if (cc == -1) {
- fpu_op_illg (opcode, 4);
+ fpu_op_illg (opcode, regs.fpiar);
} else if (!cc) {
int reg = opcode & 0x7;
if (!isinrom ())
write_log (_T("fscc_opp at %08lx\n"), m68k_getpc ());
#endif
- if (fault_if_no_fpu (opcode, 4))
+ if (fault_if_no_fpu (opcode, 0, 4))
return;
regs.fpiar = m68k_getpc () - 4;
cc = fpp_cond (extra & 0x3f);
if (cc == -1) {
- fpu_op_illg (opcode, 4);
+ fpu_op_illg (opcode, regs.fpiar);
} else if ((opcode & 0x38) == 0) {
+ if (fault_if_no_fpu (opcode, 0, 4))
+ return;
m68k_dreg (regs, opcode & 7) = (m68k_dreg (regs, opcode & 7) & ~0xff) | (cc ? 0xff : 0x00);
} else {
if (get_fp_ad (opcode, &ad) == 0) {
- m68k_setpc (m68k_getpc () - 4);
- op_illg (opcode);
- } else
+ fpu_noinst (opcode, regs.fpiar);
+ } else {
x_cp_put_byte (ad, cc ? 0xff : 0x00);
+ }
}
}
if (!isinrom ())
write_log (_T("ftrapcc_opp at %08lx\n"), m68k_getpc ());
#endif
- if (fault_if_no_fpu (opcode, pc - oldpc))
+ if (fault_if_no_fpu (opcode, 0, pc))
return;
regs.fpiar = oldpc;
cc = fpp_cond (extra & 0x3f);
if (cc == -1) {
- fpu_op_illg (opcode, pc - oldpc);
+ fpu_op_illg (opcode, oldpc);
}
if (cc)
Exception (7);
if (!isinrom ())
write_log (_T("fbcc_opp at %08lx\n"), m68k_getpc ());
#endif
- if (fault_if_no_fpu (opcode, pc - oldpc))
+ if (fault_if_no_fpu (opcode, 0, pc))
return;
regs.fpiar = oldpc;
cc = fpp_cond (opcode & 0x3f);
if (cc == -1) {
- fpu_op_illg (opcode, pc - oldpc);
+ fpu_op_illg (opcode, oldpc);
} else if (cc) {
if ((opcode & 0x40) == 0)
extra = (uae_s32) (uae_s16) extra;
if (!isinrom ())
write_log (_T("fsave_opp at %08lx\n"), m68k_getpc ());
#endif
- if (fault_if_no_fpu (opcode, 2))
- return;
if (get_fp_ad (opcode, &ad) == 0) {
- fpu_op_illg (opcode, 2);
+ fpu_op_illg (opcode, pc);
return;
}
+ if (fault_if_no_fpu (opcode, ad, pc))
+ return;
regs.fpiar = pc;
if (currprefs.fpu_model == 68060) {
if (!isinrom ())
write_log (_T("frestore_opp at %08lx\n"), m68k_getpc ());
#endif
- if (fault_if_no_fpu (opcode, 2))
- return;
if (get_fp_ad (opcode, &ad) == 0) {
- fpu_op_illg (opcode, 2);
+ fpu_op_illg (opcode, pc);
return;
}
+ if (fault_if_no_fpu (opcode, ad, pc))
+ return;
regs.fpiar = pc;
+
uae_u32 pad = ad;
if (incr < 0) {
ad -= 4;
static void fpuop_arithmetic2 (uae_u32 opcode, uae_u16 extra)
{
- int reg;
+ int reg, v;
fptype src;
uaecptr pc = m68k_getpc () - 4;
+ uaecptr ad = 0;
#if DEBUG_FPP
if (!isinrom ())
write_log (_T("FPP %04lx %04x at %08lx\n"), opcode & 0xffff, extra, pc);
#endif
- if (fault_if_no_fpu (opcode, 4))
- return;
switch ((extra >> 13) & 0x7)
{
case 3:
- if (put_fp_value (regs.fp[(extra >> 7) & 7], opcode, extra) == 0) {
- m68k_setpc (pc);
- op_illg (opcode);
- }
+ if (put_fp_value (regs.fp[(extra >> 7) & 7], opcode, extra, pc) == 0)
+ fpu_noinst (opcode, pc);
return;
case 4:
case 5:
if ((opcode & 0x38) == 0) {
+ if (fault_if_no_fpu (opcode, 0, pc))
+ return;
if (extra & 0x2000) {
if (extra & 0x1000)
m68k_dreg (regs, opcode & 7) = regs.fpcr & 0xffff;
regs.fpiar = m68k_dreg (regs, opcode & 7);
}
} else if ((opcode & 0x38) == 0x08) {
+ if (fault_if_no_fpu (opcode, 0, pc))
+ return;
if (extra & 0x2000) {
if (extra & 0x1000)
m68k_areg (regs, opcode & 7) = regs.fpcr & 0xffff;
regs.fpiar = m68k_areg (regs, opcode & 7);
}
} else if ((opcode & 0x3f) == 0x3c) {
+ if (fault_if_no_fpu (opcode, 0, pc))
+ return;
if ((extra & 0x2000) == 0) {
if (extra & 0x1000) {
regs.fpcr = x_next_ilong ();
int incr = 0;
if (get_fp_ad (opcode, &ad) == 0) {
- m68k_setpc (pc);
- op_illg (opcode);
+ fpu_noinst (opcode, pc);
return;
}
+ if (fault_if_no_fpu (opcode, ad, pc))
+ return;
+
if ((opcode & 0x38) == 0x20) {
if (extra & 0x1000)
incr += 4;
int incr = 0;
if (get_fp_ad (opcode, &ad) == 0) {
- m68k_setpc (pc);
- op_illg (opcode);
+ fpu_noinst (opcode, pc);
return;
}
+ if (fault_if_no_fpu (opcode, ad, pc))
+ return;
+
if((opcode & 0x38) == 0x20) {
if (extra & 0x1000)
incr += 4;
if (extra & 0x2000) {
/* FMOVEM FPP->memory */
if (get_fp_ad (opcode, &ad) == 0) {
- m68k_setpc (pc);
- op_illg (opcode);
+ fpu_noinst (opcode, pc);
return;
}
+ if (fault_if_no_fpu (opcode, ad, pc))
+ return;
+
switch ((extra >> 11) & 3)
{
case 0: /* static pred */
} else {
/* FMOVEM memory->FPP */
if (get_fp_ad (opcode, &ad) == 0) {
- m68k_setpc (pc);
- op_illg (opcode);
+ fpu_noinst (opcode, pc);
return;
}
+ if (fault_if_no_fpu (opcode, ad, pc))
+ return;
switch ((extra >> 11) & 3)
{
case 0: /* static pred */
case 2: /* Extremely common */
reg = (extra >> 7) & 7;
if ((extra & 0xfc00) == 0x5c00) {
+ if (fault_if_no_fpu (opcode, 0, pc))
+ return;
switch (extra & 0x7f)
{
case 0x00:
regs.fp[reg] = *fp_1e4096;
break;
default:
- m68k_setpc (pc);
- op_illg (opcode);
+ fpu_noinst (opcode, pc);
return;
}
MAKE_FPSR (regs.fp[reg]);
return;
}
- if (get_fp_value (opcode, extra, &src) == 0) {
- m68k_setpc (pc);
- op_illg (opcode);
+ v = get_fp_value (opcode, extra, &src, pc);
+ if (v <= 0) {
+ if (v == 0)
+ fpu_noinst (opcode, pc);
return;
}
MAKE_FPSR (src);
return;
default:
- m68k_setpc (pc);
- op_illg (opcode);
+ fpu_noinst (opcode, pc);
return;
}
MAKE_FPSR (regs.fp[reg]);
default:
break;
}
- m68k_setpc (pc);
- op_illg (opcode);
+ fpu_noinst (opcode, pc);
}
void fpuop_arithmetic (uae_u32 opcode, uae_u16 extra)
#include "ncr_scsi.h"
#include "blkdev.h"
#include "scsi.h"
+#include "threaddep/thread.h"
#define PCMCIA_SRAM 1
#define PCMCIA_IDE 2
static struct ide_hdf *ide;
+static smp_comm_pipe requests;
+static volatile int gayle_thread_running;
+
STATIC_INLINE void pw (int offset, uae_u16 w)
{
ide->secbuf[offset * 2 + 0] = (uae_u8)w;
return v;
}
-
static void ide_interrupt (void)
{
ide->irq_delay = 2;
ide->data_offset = 0;
ide->regs.ide_status |= IDE_STATUS_DRQ;
ide->data_size = nsec * ide->blocksize;
+ ide_interrupt ();
}
static void atapi_packet (void)
break;
case IDE_STATUS:
ide->irq = 0;
- if (isdrive (ide))
+ if (isdrive (ide)) {
+ ide->regs.ide_status |= IDE_STATUS_BSY;
ide_do_command (val);
+ }
+#if 0
+ write_comm_pipe_u32 (&requests, (ide->num << 8) | val, 1);
+#endif
break;
}
}
return freepcmcia (0);
}
+static void *ide_thread (void *null)
+{
+ for (;;) {
+ uae_u32 command = read_comm_pipe_u32_blocking (&requests);
+ if (gayle_thread_running == 0 || command == 0xfffffff)
+ break;
+ ide_do_command ((uae_u8)command);
+ }
+ gayle_thread_running = -1;
+ return 0;
+}
+
static void initide (void)
{
int i;
+ if (!gayle_thread_running) {
+ gayle_thread_running = 1;
+ init_comm_pipe (&requests, 100, 1);
+ uae_start_thread (_T("ide"), ide_thread, 0, NULL);
+ }
+
alloc_ide_mem (idedrive, TOTAL_IDE * 2);
if (isrestore ())
return;
gayle_irq = gayle_int = 0;
}
+void gayle_free (void)
+{
+ if (gayle_thread_running > 0) {
+ gayle_thread_running = 0;
+ write_comm_pipe_u32 (&requests, 0xffffffff, 1);
+ while(gayle_thread_running == 0)
+ sleep_millis (10);
+ gayle_thread_running = 0;
+ }
+}
+
void gayle_reset (int hardreset)
{
static TCHAR bankname[100];
printf ("\t\tif (frame == 0x0) { m68k_areg (regs, 7) += offset; break; }\n");
printf ("\t\telse if (frame == 0x1) { m68k_areg (regs, 7) += offset; }\n");
printf ("\t\telse if (frame == 0x2) { m68k_areg (regs, 7) += offset + 4; break; }\n");
- printf ("\t\telse if (frame == 0x4) { m68k_areg (regs, 7) += offset + 8; break; }\n");
+ if (using_mmu == 68060) {
+ printf ("\t\telse if (frame == 0x4) { m68k_do_rte_mmu060 (a); m68k_areg (regs, 7) += offset + 8; break; }\n");
+ } else {
+ printf ("\t\telse if (frame == 0x4) { m68k_areg (regs, 7) += offset + 8; break; }\n");
+ }
printf ("\t\telse if (frame == 0x8) { m68k_areg (regs, 7) += offset + 50; break; }\n");
if (using_mmu == 68040) {
printf ("\t\telse if (frame == 0x7) { m68k_do_rte_mmu040 (a); m68k_areg (regs, 7) += offset + 52; break; }\n");
printf ("\tint ru = (src >> 6) & 7;\n");
printf ("\tint rc = src & 7;\n");
genflags (flag_cmp, curi->size, "newv", "m68k_dreg (regs, rc)", "dst");
- sync_m68k_pc ();
gen_set_fault_pc ();
printf ("\tif (GET_ZFLG ()) ");
old_brace_level = n_braces;
printf ("else");
start_brace ();
printf ("\n");
+ if (cpu_level >= 4) {
+ // apparently 68040/060 needs to always write at the end of RMW cycle
+ printf ("\t");
+ genastore_cas ("dst", curi->dmode, "dstreg", curi->size, "dst");
+ }
switch (curi->size) {
case sz_byte:
printf ("\t\tm68k_dreg(regs, rc) = (m68k_dreg(regs, rc) & ~0xff) | (dst & 0xff);\n");
printf ("\t\tm68k_dreg(regs, rc) = dst;\n");
break;
}
- if (cpu_level >= 4) {
- // apparently 68040/060 needs to always write at the end of RMW cycle
- printf ("\t");
- genastore_cas ("dst", curi->dmode, "dstreg", curi->size, "dst");
- }
pop_braces (old_brace_level);
}
break;
sync_m68k_pc ();
pop_braces (old_brace_level);
}
- if (using_mmu != 68040)
- sync_m68k_pc ();
}
break;
case i_BKPT: /* only needed for hardware emulators */
char *getb, *putb;
int flags = 0;
- if (using_mmu || using_ce020) {
+ if (using_mmu == 68060 && (curi->mnemo == i_BFCHG || curi->mnemo == i_BFCLR || curi->mnemo == i_BFSET || curi->mnemo == i_BFINS)) {
+ getb = "mmu060_get_rmw_bitfield";
+ putb = "mmu060_put_rmw_bitfield";
+ } else if (using_mmu || using_ce020) {
getb = "x_get_bitfield";
putb = "x_put_bitfield";
} else {
getb = "get_bitfield";
putb = "put_bitfield";
}
- if (curi->mnemo == i_BFCHG || curi->mnemo == i_BFCLR || curi->mnemo == i_BFSET || curi->mnemo == i_BFINS)
- flags = GF_RMW;
genamode (curi->smode, "srcreg", curi->size, "extra", 1, 0, 0);
genamode (curi->dmode, "dstreg", sz_long, "dst", 2, 0, 0);
extern void mmu_tt_modified (void);
+extern uae_u32 REGPARAM3 mmu060_get_rmw_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width) REGPARAM;
+extern void REGPARAM3 mmu060_put_rmw_bitfield (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 offset, int width) REGPARAM;
+
extern uae_u16 REGPARAM3 mmu_get_word_unaligned(uaecptr addr, bool data, bool rmw) REGPARAM;
extern uae_u32 REGPARAM3 mmu_get_long_unaligned(uaecptr addr, bool data, bool rmw) REGPARAM;
extern int debug_bankchange (int);
extern void log_dma_record (void);
extern void debug_parser (const TCHAR *cmd, TCHAR *out, uae_u32 outsize);
+extern void mmu_disasm (uaecptr pc, int lines);
#define BREAKPOINT_TOTAL 20
struct breakpoint_node {
extern void gayle_reset (int);
extern void gayle_hsync (void);
+extern void gayle_free (void);
extern int gayle_add_ide_unit (int ch, struct uaedev_config_info *ci);
extern int gayle_modify_pcmcia_sram_unit (const TCHAR *path, int readonly, int insert);
extern int gayle_modify_pcmcia_ide_unit (const TCHAR *path, int readonly, int insert);
#define MMUDEBUG 1
#define MMUINSDEBUG 0
+#define MMUDEBUGMISC 0
#ifdef _MSC_VER
#define unlikely(x) x
#define ALWAYS_INLINE __inline
// take care of 2 kinds of alignement, bus size and page
+#if 1
static inline bool is_unaligned(uaecptr addr, int size)
{
return unlikely((addr & (size - 1)) && (addr ^ (addr + size - 1)) & regs.mmu_page_size);
}
+#else
+static inline bool is_unaligned(uaecptr addr, int size)
+{
+ return (addr & (size - 1));
+}
+#endif
static ALWAYS_INLINE void phys_put_long(uaecptr addr, uae_u32 l)
{
extern void init_m68k_full (void);
extern void m68k_go (int);
extern void m68k_dumpstate (uaecptr *);
+extern void m68k_dumpstate (uaecptr, uaecptr *);
extern void m68k_reset (int);
extern int getDivu68kCycles (uae_u32 dividend, uae_u16 divisor);
extern int getDivs68kCycles (uae_s32 dividend, uae_s16 divisor);
inputdevice_default_kb (p, i);
}
-static bool read_slot (TCHAR *parm, int num, int joystick, int button, struct uae_input_device *id, int keynum, int subnum, struct inputevent *ie, uae_u64 flags, int port, TCHAR *custom)
+static bool read_slot (const TCHAR *parm, int num, int joystick, int button, struct uae_input_device *id, int keynum, int subnum, struct inputevent *ie, uae_u64 flags, int port, TCHAR *custom)
{
int mask;
} while (handle_msgpump ());
}
+static void inject_events (const TCHAR *str)
+{
+ bool quot = false;
+ bool first = true;
+ uae_u8 keys[300];
+ int keycnt = 0;
+
+ for (;;) {
+ TCHAR ch = *str++;
+ if (!ch)
+ break;
+
+ if (ch == '\'') {
+ first = false;
+ quot = !quot;
+ continue;
+ }
+
+ if (!quot && (ch == ' ' || first)) {
+ const TCHAR *s = str;
+ if (first)
+ s--;
+ while (*s == ' ')
+ s++;
+ const TCHAR *s2 = s;
+ while (*s && *s != ' ')
+ s++;
+ int s2len = s - s2;
+ if (!s2len)
+ break;
+ for (int i = 1; events[i].name; i++) {
+ const TCHAR *cf = events[i].confname;
+ if (!_tcsnicmp (cf, _T("KEY_"), 4))
+ cf += 4;
+ if (events[i].allow_mask == AM_K && !_tcsnicmp (cf, s2, _tcslen (cf)) && s2len == _tcslen (cf)) {
+ int j;
+ uae_u8 kc = events[i].data << 1;
+ TCHAR tch = _totupper (s2[0]);
+ if (tch != s2[0]) {
+ // release
+ for (j = 0; j < keycnt; j++) {
+ if (keys[j] == kc)
+ keys[j] = 0xff;
+ }
+ kc |= 0x01;
+ } else {
+ for (j = 0; j < keycnt; j++) {
+ if (keys[j] == kc) {
+ kc = 0xff;
+ }
+ }
+ if (kc != 0xff) {
+ for (j = 0; j < keycnt; j++) {
+ if (keys[j] == 0xff) {
+ keys[j] = kc;
+ break;
+ }
+ }
+ if (j == keycnt) {
+ if (keycnt < sizeof keys)
+ keys[keycnt++] = kc;
+ }
+ }
+ }
+ if (kc != 0xff) {
+ //write_log (_T("%s\n"), cf);
+ record_key (kc);
+ }
+ }
+ }
+ } else if (quot) {
+ ch = _totupper (ch);
+ if ((ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9')) {
+ for (int i = 1; events[i].name; i++) {
+ if (events[i].allow_mask == AM_K && events[i].name[1] == 0 && events[i].name[0] == ch) {
+ record_key (events[i].data << 1);
+ record_key ((events[i].data << 1) | 0x01);
+ //write_log (_T("%c\n"), ch);
+ }
+ }
+ }
+ }
+ first = false;
+ }
+ while (--keycnt >= 0) {
+ uae_u8 kc = keys[keycnt];
+ if (kc != 0xff)
+ record_key (kc | 0x01);
+ }
+}
+
static int handle_custom_event (const TCHAR *custom)
{
TCHAR *p, *buf, *nextp;
+ bool noquot = false;
if (custom == NULL)
return 0;
config_changed = 1;
write_log (_T("%s\n"), custom);
- p = buf = my_strdup (custom);
+ p = buf = my_strdup_trim (custom);
+ if (p[0] != '\"')
+ noquot = true;
while (p && *p) {
TCHAR *p2;
- if (*p != '\"')
- break;
- p++;
- p2 = p;
- while (*p2 != '\"' && *p2 != 0)
- p2++;
- if (*p2 == '\"') {
- *p2++ = 0;
- nextp = p2 + 1;
- while (*nextp == ' ')
- nextp++;
+ if (!noquot) {
+ if (*p != '\"')
+ break;
+ p++;
+ p2 = p;
+ while (*p2 != '\"' && *p2 != 0)
+ p2++;
+ if (*p2 == '\"') {
+ *p2++ = 0;
+ nextp = p2 + 1;
+ while (*nextp == ' ')
+ nextp++;
+ }
}
//write_log (L"-> '%s'\n", p);
if (!_tcsicmp (p, _T("no_config_check"))) {
config_changed = 1;
} else if (!_tcsnicmp (p, _T("dbg "), 4)) {
debug_parser (p + 4, NULL, -1);
+ } else if (!_tcsnicmp (p, _T("kbr "), 4)) {
+ inject_events (p + 4);
} else {
cfgfile_parse_line (&changed_prefs, p, 0);
}
+ if (noquot)
+ break;
p = nextp;
}
xfree (buf);
while (keyboard_default[k].scancode >= 0) {
if (keyboard_default[k].scancode == kb[j]) {
for (int l = 0; l < MAX_INPUT_DEVICE_EVENTS; l++) {
- if (uid->extra[l] == id) {
+ if (uid->extra[l] == id && uid->port[l][0] == 0) {
for (int m = 0; m < MAX_INPUT_SUB_EVENT && keyboard_default[k].node[m].evt; m++) {
uid->eventid[l][m] = keyboard_default[k].node[m].evt;
+ uid->port[l][m] = 0;
+ uid->flags[l][m] = 0;
}
break;
}
int inputdevice_get_compatibility_input (struct uae_prefs *prefs, int index, int *typelist, int **inputlist, int **at)
{
if (index >= MAX_JPORTS || joymodes[index] < 0)
- return 0;
+ return -1;
*typelist = joymodes[index];
*inputlist = joyinputs[index];
*at = axistable;
+ //write_log (_T("%d %p %p\n"), *typelist, *inputlist, *at);
int cnt = 0;
for (int i = 0; joyinputs[index] && joyinputs[index][i] >= 0; i++, cnt++);
+ //write_log (_T("%d\n"), cnt);
return cnt;
}
{
int typelist, *inputlist, *atp;
- if (!inputdevice_get_compatibility_input (prefs, index, &typelist, &inputlist, &atp))
+ if (inputdevice_get_compatibility_input (prefs, index, &typelist, &inputlist, &atp) <= 0)
return;
for (int i = 0; inputlist[i] >= 0; i++) {
int evtnum = inputlist[i];
joyinputs[port] = ip_mousecdtv;
break;
}
+ //write_log (_T("joyinput %d = %p\n"), port, joyinputs[port]);
}
static void setautofire (struct uae_input_device *uid, int port, int af)
inputdevice_updateconfig (src, dst);
}
+static void swapevent (struct uae_input_device *uid, int i, int j, int evt)
+{
+ uid->eventid[i][j] = evt;
+ int port = uid->port[i][j];
+ if (port == 1)
+ port = 2;
+ else if (port == 2)
+ port = 1;
+ else if (port == 3)
+ port = 4;
+ else if (port == 4)
+ port = 3;
+ uid->port[i][j] = port;
+}
+
static void swapjoydevice (struct uae_input_device *uid, int **swaps)
{
for (int i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++) {
int evtnum;
for (int kk = 0; (evtnum = swaps[k][kk]) >= 0 && !found; kk++) {
if (uid->eventid[i][j] == evtnum) {
- uid->eventid[i][j] = swaps[1 - k][kk];
+ swapevent (uid, i, j, swaps[1 - k][kk]);
found = true;
} else {
for (int jj = 0; axistable[jj] >= 0; jj += 3) {
int evtnum2 = swaps[1 - k][kk];
for (int m = 0; axistable[m] >= 0; m += 3) {
if (evtnum2 == axistable[m] || evtnum2 == axistable[m + 1] || evtnum2 == axistable[m + 2]) {
- uid->eventid[i][j] = axistable[m + ii];
+ swapevent (uid, i, j, axistable[m + ii]);
found = true;
}
}
static int kpb_first, kpb_last;
-static int keybuf[256];
+#define KEYBUF_SIZE 256
+static int keybuf[KEYBUF_SIZE];
int keys_available (void)
{
assert (kpb_first != kpb_last);
key = keybuf[kpb_last];
- if (++kpb_last == 256)
+ if (++kpb_last == KEYBUF_SIZE)
kpb_last = 0;
//write_log (_T("%02x:%d\n"), key >> 1, key & 1);
return key;
int b = !(kc & 1);
//write_log (_T("got kc %02X\n"), ((kc << 7) | (kc >> 1)) & 0xff);
- if (kpb_next == 256)
+ if (kpb_next == KEYBUF_SIZE)
kpb_next = 0;
if (kpb_next == kpb_last) {
write_log (_T("Keyboard buffer overrun. Congratulations.\n"));
#include "dongle.h"
#include "sampler.h"
#include "consolehook.h"
+#include "gayle.h"
#ifdef RETROPLATFORM
#include "rp.h"
#endif
#ifdef BSDSOCKET
bsdlib_reset ();
#endif
+ gayle_free ();
device_func_reset ();
savestate_free ();
memory_cleanup ();
memset (&gui_data, 0, sizeof gui_data);
gui_data.cd = -1;
gui_data.hd = -1;
+ gui_data.md = -1;
logging_init (); /* Yes, we call this twice - the first case handles when the user has loaded
a config using the cmd-line. This case handles loads through the GUI. */
x_cp_get_byte = x_get_byte;
x_cp_next_iword = x_next_iword;
x_cp_next_ilong = x_next_ilong;
- x_cp_get_disp_ea_020 = get_disp_ea_020;
+ x_cp_get_disp_ea_020 = x_get_disp_ea_020;
if (currprefs.mmu_model == 68030) {
x_cp_put_long = put_long_mmu030_state;
x_cp_next_ilong = next_ilong_mmu030_state;
x_cp_get_disp_ea_020 = get_disp_ea_020_mmu030;
}
+
}
bool can_cpu_tracer (void)
uae_u32 REGPARAM2 x_get_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width)
{
- uae_u32 tmp, res, mask;
+ uae_u32 tmp1, tmp2, res, mask;
offset &= 7;
mask = 0xffffffffu << (32 - width);
switch ((offset + width + 7) >> 3) {
case 1:
- tmp = x_cp_get_byte (src);
- res = tmp << (24 + offset);
- bdata[0] = tmp & ~(mask >> (24 + offset));
+ tmp1 = x_cp_get_byte (src);
+ res = tmp1 << (24 + offset);
+ bdata[0] = tmp1 & ~(mask >> (24 + offset));
break;
case 2:
- tmp = x_cp_get_word (src);
- res = tmp << (16 + offset);
- bdata[0] = tmp & ~(mask >> (16 + offset));
+ tmp1 = x_cp_get_word (src);
+ res = tmp1 << (16 + offset);
+ bdata[0] = tmp1 & ~(mask >> (16 + offset));
break;
case 3:
- tmp = x_cp_get_word (src);
- res = tmp << (16 + offset);
- bdata[0] = tmp & ~(mask >> (16 + offset));
- tmp = x_cp_get_byte (src + 2);
- res |= tmp << (8 + offset);
- bdata[1] = tmp & ~(mask >> (8 + offset));
+ tmp1 = x_cp_get_word (src);
+ tmp2 = x_cp_get_byte (src + 2);
+ res = tmp1 << (16 + offset);
+ bdata[0] = tmp1 & ~(mask >> (16 + offset));
+ res |= tmp2 << (8 + offset);
+ bdata[1] = tmp2 & ~(mask >> (8 + offset));
break;
case 4:
- tmp = x_cp_get_long (src);
- res = tmp << offset;
- bdata[0] = tmp & ~(mask >> offset);
+ tmp1 = x_cp_get_long (src);
+ res = tmp1 << offset;
+ bdata[0] = tmp1 & ~(mask >> offset);
break;
case 5:
- tmp = x_cp_get_long (src);
- res = tmp << offset;
- bdata[0] = tmp & ~(mask >> offset);
- tmp = x_cp_get_byte (src + 4);
- res |= tmp >> (8 - offset);
- bdata[1] = tmp & ~(mask << (8 - offset));
+ tmp1 = x_cp_get_long (src);
+ tmp2 = x_cp_get_byte (src + 4);
+ res = tmp1 << offset;
+ bdata[0] = tmp1 & ~(mask >> offset);
+ res |= tmp2 >> (8 - offset);
+ bdata[1] = tmp2 & ~(mask << (8 - offset));
break;
default:
/* Panic? */
x_put_long (m68k_areg (regs, 7), regs.mmu_fault_addr);
break;
case 0xB: // long bus cycle fault stack frame (68020, 68030)
- // store state information to internal register space
+ // We always use B frame because it is easier to emulate,
+ // our PC always points at start of instruction but A frame assumes
+ // it is + 2 and handling this properly is not easy.
+ // Store state information to internal register space
for (i = 0; i < mmu030_idx + 1; i++) {
m68k_areg (regs, 7) -= 4;
x_put_long (m68k_areg (regs, 7), mmu030_ad[i].val);
// 68030 MMU
static void Exception_mmu030 (int nr, uaecptr oldpc)
{
- uae_u32 currpc = m68k_getpc(), newpc;
+ uae_u32 currpc = m68k_getpc (), newpc;
int sv = regs.s;
- exception_debug(nr);
- MakeSR();
+ exception_debug (nr);
+ MakeSR ();
if (!regs.s) {
regs.usp = m68k_areg (regs, 7);
uae_u32 opcr = regs.pcr;
regs.pcr &= ~(0x40 | 2 | 1);
regs.pcr |= (*regp) & (0x40 | 2 | 1);
+ if (currprefs.fpu_model <= 0)
+ regs.pcr |= 2;
if (((opcr ^ regs.pcr) & 2) == 2) {
write_log (_T("68060 FPU state: %s\n"), regs.pcr & 2 ? _T("disabled") : _T("enabled"));
/* flush possible already translated FPU instructions */
mmufixup[1].reg = -1;
}
- //activate_debugger ();
TRY (prb2) {
Exception (prb);
} CATCH (prb2) {
mmu_restart = true;
pc = regs.instruction_pc = m68k_getpc ();
-
-#if 0
- if (pc == 0x0004B0A6) {
- //write_log (_T("*"));
- activate_debugger ();
- }
-#endif
-
mmu_opcode = -1;
mmu_opcode = opcode = x_prefetch (0);
count_instr (opcode);
mmufixup[0].reg = -1;
}
- //activate_debugger ();
TRY (prb2) {
Exception (prb);
} CATCH (prb2) {
f.x = regflags.x;
mmu030_state[0] = mmu030_state[1] = mmu030_state[2] = 0;
-#if 0
- if (pc == 0xC0075432) {
- write_log (_T("*"));
- //activate_debugger ();
- }
-#endif
mmu030_opcode = -1;
if (mmu030_opcode_stageb < 0) {
opcode = get_iword_mmu030 (0);
cnt--; // so that we don't get in infinite loop if things go horribly wrong
if (!mmu030_retry)
break;
- if (cnt < 0)
+ if (cnt < 0) {
+ cpu_halt (9);
break;
+ }
if (mmu030_retry && mmu030_opcode == -1)
goto insretry; // urgh
}
}
}
-void m68k_dumpstate (uaecptr *nextpc)
+void m68k_dumpstate (uaecptr pc, uaecptr *nextpc)
{
int i, j;
console_out_f (_T("Prefetch %04x (%s) %04x (%s)\n"), regs.irc, lookup1->name, regs.ir, lookup2->name);
}
- m68k_disasm (m68k_getpc (), nextpc, 1);
- if (nextpc)
- console_out_f (_T("Next PC: %08lx\n"), *nextpc);
+ if (pc != 0xffffffff) {
+ m68k_disasm (pc, nextpc, 1);
+ if (nextpc)
+ console_out_f (_T("Next PC: %08lx\n"), *nextpc);
+ }
+}
+void m68k_dumpstate (uaecptr *nextpc)
+{
+ m68k_dumpstate (m68k_getpc (), nextpc);
}
#ifdef SAVESTATE
const TCHAR **eventorder;
max = inputdevice_get_compatibility_input (&currprefs, inputmap_port, &mode, &events, &axistable);
- if (!max)
+ if (max <= 0)
return false;
int devicetype = -1;
}
}
}
- write_log (_T("port_get_custom: %s\n"), out);
+ write_log (_T("port%d_get_custom: %s\n"), inputmap_port, out);
return true;
}
int kb;
const TCHAR **eventorder;
+ max = inputdevice_get_compatibility_input (&changed_prefs, inputmap_port, &mode, &events, &axistable);
+
eventorder = getcustomeventorder (&devicetype);
if (!eventorder)
return FALSE;
kb = inputdevice_get_device_total (IDTYPE_JOYSTICK) + inputdevice_get_device_total (IDTYPE_MOUSE);
- inputdevice_updateconfig_internal (NULL, &changed_prefs);
+ inputdevice_copyconfig (&currprefs, &changed_prefs);
inputdevice_compa_prepare_custom (&changed_prefs, inputmap_port, devicetype);
- inputdevice_updateconfig_internal (NULL, &changed_prefs);
+ inputdevice_updateconfig (NULL, &changed_prefs);
max = inputdevice_get_compatibility_input (&changed_prefs, inputmap_port, &mode, &events, &axistable);
write_log (_T("custom='%s' max=%d port=%d dt=%d kb=%d kbnum=%d\n"), custom, max, inputmap_port, devicetype, kb, inputdevice_get_device_total (IDTYPE_KEYBOARD));
- if (!max)
+ if (max <= 0)
return FALSE;
while (p && p[0]) {
}
}
if (wdnum >= 0) {
- //write_log (_T("kb=%d (%s) wdnum=%d\n"), j, inputdevicefunc_keyboard.get_friendlyname (j), wdnum);
+ write_log (_T("kb=%d (%s) wdnum=%d\n"), j, inputdevicefunc_keyboard.get_friendlyname (j), wdnum);
inputdevice_set_gameports_mapping (&changed_prefs, kb + j, wdnum, evtnum, flags, inputmap_port);
- inputdevice_set_gameports_mapping (&currprefs, kb + j, wdnum, evtnum, flags, inputmap_port);
} else {
write_log (_T("kb=%d (%): keycode %02x not found!\n"), j, inputdevicefunc_keyboard.get_friendlyname (j), kc);
}
}
}
-
- inputdevice_updateconfig_internal (NULL, &changed_prefs);
- inputdevice_updateconfig (NULL, &currprefs);
+ inputdevice_copyconfig (&changed_prefs, &currprefs);
return TRUE;
}
switch (led)
{
case LED_POWER:
- ledstate = onoff >= 250 ? 100 : onoff * 10 / 26;
+ ledstate = onoff >= 250 ? 100 : onoff * 5 / 26 + 49;
if (ledstate == oldled[led])
return;
oldled[led] = ledstate;
#define LANG_DLL 1
#if WINUAEPUBLICBETA
-#define WINUAEBETA _T("4")
+#define WINUAEBETA _T("5")
#else
#define WINUAEBETA _T("")
#endif
-#define WINUAEDATE MAKEBD(2013, 1, 26)
+#define WINUAEDATE MAKEBD(2013, 2, 1)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
}
}
-static int picasso_offset_x, picasso_offset_y, picasso_offset_mx, picasso_offset_my;
+static int picasso_offset_x, picasso_offset_y;
+static float picasso_offset_mx, picasso_offset_my;
void getgfxoffset (float *dxp, float *dyp, float *mxp, float *myp)
{
picasso_offset_x = 0;
picasso_offset_y = 0;
- picasso_offset_mx = 1000;
- picasso_offset_my = 1000;
+ picasso_offset_mx = 1.0;
+ picasso_offset_my = 1.0;
if (scalepicasso) {
int srcratio, dstratio;
int srcwidth, srcheight;
SetRect (&dr, xx / 2, 0,srcwidth - xx / 2, srcheight);
picasso_offset_x = xx / 2;
}
- picasso_offset_mx = picasso96_state.Width * 1000 / (dr.right - dr.left);
- picasso_offset_my = picasso96_state.Height * 1000 / (dr.bottom - dr.top);
+ picasso_offset_mx = (float)picasso96_state.Width / (dr.right - dr.left);
+ picasso_offset_my = (float)picasso96_state.Height / (dr.bottom - dr.top);
DirectDraw_BlitToPrimaryScale (&dr, &sr);
} else {
SetRect (&sr, x, y, x + w, y + h);
}
OffsetRect (zr, picasso_offset_x, picasso_offset_y);
- picasso_offset_mx = srcwidth * 1000 / (dr->right - dr->left);
- picasso_offset_my = srcheight * 1000 / (dr->bottom - dr->top);
+ picasso_offset_mx = (float)srcwidth / (dr->right - dr->left);
+ picasso_offset_my = (float)srcheight / (dr->bottom - dr->top);
}
static bool rtg_locked;
if (startactive) {
setpriority (&priorities[currprefs.win32_active_capture_priority]);
for (i = 0; i < NUM_LEDS; i++)
- gui_led (i, -1);
+ gui_flicker_led (i, -1, -1);
gui_led (LED_POWER, gui_data.powerled);
gui_fps (0, 0, 0);
for (i = 0; i < 4; i++) {
portnum = inputmap_port;
cntitem = 1;
cntgroup = 1;
- if (inputdevice_get_compatibility_input (&workprefs, portnum, &mode, &events, &axistable)) {
+ if (inputdevice_get_compatibility_input (&workprefs, portnum, &mode, &events, &axistable) > 0) {
int evtnum;
for (int i = 0; (evtnum = events[i]) >= 0; i++) {
struct inputevent *evt = inputdevice_get_eventinfo (evtnum);
if (!memcmp (id, "RDSK", 4))
break;
}
- if (i == 16)
+ if (i == 16) {
hdf_read (&hfd, id, 0, 512);
- current_hfdlg.dostype = (id[0] << 24) | (id[1] << 16) | (id[2] << 8) | (id[3] << 0);
+ current_hfdlg.dostype = (id[0] << 24) | (id[1] << 16) | (id[2] << 8) | (id[3] << 0);
+ }
}
if (defaults) {
if (hfd.flags & HFD_FLAGS_REALDRIVE) {
{ 0, 0, 0 }
};
+static void hilitehd (HWND hDlg)
+{
+ int total = ListView_GetItemCount (cachedlist);
+ if (total <= 0) {
+ ew (hDlg, IDC_EDIT, FALSE);
+ ew (hDlg, IDC_REMOVE, FALSE);
+ return;
+ }
+ if (clicked_entry < 0)
+ clicked_entry = 0;
+ if (clicked_entry >= total)
+ clicked_entry = total;
+ ListView_SetItemState (cachedlist, clicked_entry, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
+ ew (hDlg, IDC_EDIT, TRUE);
+ ew (hDlg, IDC_REMOVE, TRUE);
+}
+
static int harddiskdlg_button (HWND hDlg, WPARAM wParam)
{
int button = LOWORD (wParam);
quickstart_cdtype = 1;
workprefs.cdslots[0].inuse = true;
addcdtype (hDlg, IDC_CD_TYPE);
+ InitializeListView (hDlg);
+ hilitehd (hDlg);
break;
case IDC_CD_EJECT:
eject_cd ();
SetDlgItemText (hDlg, IDC_CD_TEXT, _T(""));
addcdtype (hDlg, IDC_CD_TYPE);
+ InitializeListView (hDlg);
+ hilitehd (hDlg);
break;
case IDC_NEW_FS:
default_fsvdlg (¤t_fsvdlg);
}
}
-static void hilitehd (HWND hDlg)
-{
- int total = ListView_GetItemCount (cachedlist);
- if (total <= 0) {
- ew (hDlg, IDC_EDIT, FALSE);
- ew (hDlg, IDC_REMOVE, FALSE);
- return;
- }
- if (clicked_entry < 0)
- clicked_entry = 0;
- if (clicked_entry >= total)
- clicked_entry = total;
- ListView_SetItemState (cachedlist, clicked_entry, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
- ew (hDlg, IDC_EDIT, TRUE);
- ew (hDlg, IDC_REMOVE, TRUE);
-}
-
/* harddisk parent view */
static INT_PTR CALLBACK HarddiskDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
for (int idx = 0; idx < MAX_JPORTS; idx++) {
int mode, **events, *axistable;
write_log (_T("Port: %d\n"), idx);
- if (inputdevice_get_compatibility_input (&workprefs, idx, &mode, &events, &axistable)) {
+ if (inputdevice_get_compatibility_input (&workprefs, idx, &mode, &events, &axistable) > 0) {
for (int k = 0; k < 2 && events[k]; k++) {
int *p = events[k];
int evtnum;
break;
case ZFILE_HDFRDB:
default_hfdlg (¤t_hfdlg, true);
+ _tcscpy (current_hfdlg.ci.rootdir, file);
add_filesys_config (&workprefs, -1, ¤t_hfdlg.ci);
break;
case ZFILE_NVR:
old = *p;
if (status < 0) {
if (old < 0) {
- *p = 0;
+ gui_led (led, -1);
+ } else {
gui_led (led, 0);
}
return;
}
if (status == 0 && old < 0) {
+ *p = 0;
resetcounter[led] = 0;
+ gui_led (led, 0);
return;
}
if (status == 0) {
return;
}
#ifdef RETROPLATFORM
- if (led == LED_HD)
- rp_hd_activity (unitnum, status ? 1 : 0, status == 2 ? 1 : 0);
- else if (led == LED_CD)
- rp_cd_activity (unitnum, status);
+ if (unitnum >= 0) {
+ if (led == LED_HD)
+ rp_hd_activity (unitnum, status ? 1 : 0, status == 2 ? 1 : 0);
+ else if (led == LED_CD)
+ rp_cd_activity (unitnum, status);
+ }
#endif
*p = status;
resetcounter[led] = 6;
- restore only single input target to default.
+Beta 5:
+
+- RDB hardfile dragndrop to hardfiles panel added empty hardfile.
+- Windowed mode bottom border "led" state didn't always match OSD led state.
+- SCSI emulation improved, select and transfer starting from 0x45 can be used to receive data.
+- SCSI emulation WD33C93 is now correctly detected as revision A, not B. (only B has Queue Tag register)
+- 68060 MMU: BFCHG, BFCLR, BFSET and BFINS are read-modify-write instructions.
+- GUI IDE/SCSI CD path was not updated in harddrive list when CD was changed using "Select image file" button.
+- 68040/060 MMU emulation fix, PFLUSH/PFLUSHN only flushed supervisor space ATC. Hopefully this was the last major
+ 040/060 MMU bug. Weird NetBSD and Linux crashes are gone.
+- Subtle Shades / Nuance remaining graphics glitches fixed. (NOTE: ECS only, OCS has corrupted graphics and it is correct behavior)
+- GUI "Swap Ports" cleared custom mappings.
+- 68040/060 no FPU/disabled FPU exceptions now include correctly calculated EA field. This should allow "compatible" 040/060 FPU
+ emulation with correctly handled missing instructions in the future (currently 040/060 FPU always supports all 68881/2 instructions)
+- Added new keyboard custom event type, "kbr <string>". For example 'kbr "abc " SHIFT_LEFT "abc" shift_left RETURN'
+ generates "abc ABC<return>". Input name in upper case = press, lower case = release. Quoted string automatically sends both press
+ and release key codes. Any unreleased keys are automatically released at the end. Non-quoted names are same as input event config
+ names without KEY-prefix. (inputevents.def in source archive)
+- Adjusted drive step limit value slightly, Extemporized / Digital works again.
+- Fixed virtual mouse driver mouse movement problem (b1)
+
Beta 4:
- Fixed 68030 MMU MOVEM to memory wrong bus error data output buffer value.
SetConsoleCP (65001);
SetConsoleOutputCP (65001);
if (GetConsoleScreenBufferInfo (stdoutput, &csbi)) {
- if (csbi.dwMaximumWindowSize.Y < 900) {
- csbi.dwMaximumWindowSize.Y = 900;
+ if (csbi.dwMaximumWindowSize.Y < 5000) {
+ csbi.dwMaximumWindowSize.Y = 5000;
SetConsoleScreenBufferSize (stdoutput, csbi.dwMaximumWindowSize);
}
}
} else if (led == LED_MD && gui_data.drive_disabled[3]) {
// DF3 reused as internal non-volatile ram led (cd32/cdtv)
pos = 6 + 3;
- on = gui_data.md;
- on_rgb = on == 2 ? 0xcc0000 : 0x00cc00;
- off_rgb = 0x003300;
+ if (gui_data.md >= 0) {
+ on = gui_data.md;
+ on_rgb = on == 2 ? 0xcc0000 : 0x00cc00;
+ off_rgb = 0x003300;
+ }
num1 = -1;
num2 = -1;
num3 = -1;