From d350d60264be34572c9d5495e40892b5c2261c2e Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 11 Mar 2018 12:37:13 +0200 Subject: [PATCH] CSA Magnum 40 autoboot disable jumper. --- cpuboard.cpp | 4 ++-- expansion.cpp | 11 ++++++++++- ncr_scsi.cpp | 46 ++++++++++++++++++++++++++-------------------- 3 files changed, 38 insertions(+), 23 deletions(-) diff --git a/cpuboard.cpp b/cpuboard.cpp index c2b78cd6..a54fe433 100644 --- a/cpuboard.cpp +++ b/cpuboard.cpp @@ -1128,7 +1128,7 @@ static uae_u32 REGPARAM2 blizzardio_bget(uaecptr addr) uae_u8 v = 0; //write_log(_T("CS IO XBGET %08x=%02X PC=%08x\n"), addr, v & 0xff, M68K_GETPC); if (is_magnum40(&currprefs)) { - if (regs.s && (addr & 0xff0f) == 0x0c0c) { + if ((addr & 0xff0f) == 0x0c0c) { int reg = (addr >> 4) & 7; v = io_reg[reg]; if (reg >= 0 && reg <= 3) @@ -1236,7 +1236,7 @@ static void REGPARAM2 blizzardio_bput(uaecptr addr, uae_u32 v) write_log(_T("CS IO XBPUT %08x %02x PC=%08x\n"), addr, v & 0xff, M68K_GETPC); #endif if (is_magnum40(&currprefs)) { - if (regs.s && (addr & 0xff0f) == 0x0c0c) { + if ((addr & 0xff0f) == 0x0c0c) { int reg = (addr >> 4) & 7; if (reg == 3 && ((v ^ io_reg[reg]) & 1)) { maprom_state = v & 1; diff --git a/expansion.cpp b/expansion.cpp index 26d76de8..70820e0c 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -5855,6 +5855,15 @@ static const struct cpuboardsubtype ivs_sub[] = { } }; +static const struct expansionboardsettings magnum40_settings[] = { + { + _T("Autoboot disable"), + _T("autoboot") + }, + { + NULL + } +}; static const struct expansionboardsettings zeus040_settings[] = { { _T("Autoboot disable (A3)"), @@ -5892,7 +5901,7 @@ static const struct cpuboardsubtype csa_sub[] = { 128 * 1024 * 1024, 0, ncr710_magnum40_autoconfig_init, NULL, BOARD_AUTOCONFIG_Z2, 1, - NULL, NULL + magnum40_settings, NULL }, { NULL diff --git a/ncr_scsi.cpp b/ncr_scsi.cpp index 3dccd651..bcb08319 100644 --- a/ncr_scsi.cpp +++ b/ncr_scsi.cpp @@ -378,29 +378,33 @@ int pci710_dma_rw(PCIDevice *dev, dma_addr_t addr, void *buf, dma_addr_t len, DM return 0; } +static void check_timer(struct ncr_state *ncr) +{ + if (ncr->state[1] & 1) { + int v = (ncr->state[5] << 16) | (ncr->state[6] << 8) | (ncr->state[7]); + if (v > 0) { + v -= 2304; + ncr->state[5] = (v >> 16) & 0xff; + ncr->state[6] = (v >> 8) & 0xff; + ncr->state[7] = (v >> 0) & 0xff; + } + if (v <= 0) { + ncr->state[0] |= 1; + ncr->state[5] = ncr->state[2]; + ncr->state[6] = ncr->state[3]; + ncr->state[7] = ncr->state[4]; + } + } + if (ncr->state[0] & 1) { + set_irq2(ncr->id, 1); + } +} + void ncr_vsync(void) { for (int i = 0; ncr_units[i]; i++) { if (ncr_units[i] == ncr_magnum40) { - struct ncr_state *ncr = ncr_units[i]; - if (ncr->state[1] & 1) { - int v = (ncr->state[5] << 16) | (ncr->state[6] << 8) | (ncr->state[7]); - if (v > 0) { - v -= 2304; - ncr->state[5] = (v >> 16) & 0xff; - ncr->state[6] = (v >> 8) & 0xff; - ncr->state[7] = (v >> 0) & 0xff; - } - if (v <= 0) { - ncr->state[0] |= 1; - ncr->state[5] = ncr->state[2]; - ncr->state[6] = ncr->state[3]; - ncr->state[7] = ncr->state[4]; - } - } - if (ncr->state[0] & 1) { - set_irq2(ncr->id, 1); - } + check_timer(ncr_magnum40); } } @@ -537,7 +541,9 @@ static uae_u32 ncr_bget2 (struct ncr_state *ncr, uaecptr addr) switch(reg) { case 0x0c: // jumpers (68230 port C) - return 0x00; + if (currprefs.cpuboard_settings & 1) + v |= 0x80; + return v; case 0x1a: // timer ZDS return ncr->state[0] & 1; } -- 2.47.3