From 4021cbf83db928447f62ea0edad8ff68ef00a367 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 27 May 2017 09:44:40 +0300 Subject: [PATCH] A2090 ST-506 disable, support command 0x0F. --- a2091.cpp | 15 ++++++++++++++- expansion.cpp | 13 ++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/a2091.cpp b/a2091.cpp index 84b1a02a..2f752533 100644 --- a/a2091.cpp +++ b/a2091.cpp @@ -1940,6 +1940,9 @@ static void dmac8727_cbp(struct wd_state *wd) static void a2090_st506(struct wd_state *wd, uae_u8 b) { uae_u8 cb[16]; + + if (wd->rc->device_settings & 1) + return; if (!b) { wd->cdmac.dmac_istr &= ~(ISTR_INT_F | ISTR_INTS); return; @@ -1988,6 +1991,14 @@ static void a2090_st506(struct wd_state *wd, uae_u8 b) wd->cdmac.xt_heads[0] = heads; wd->cdmac.xt_sectors[0] = secs_per_track; } + } else if (cmd == 0x0f) { // change command block address + uae_u8 ccba[4]; + for (int i = 0; i < sizeof ccba; i++) { + ccba[i] = get_byte(dmaaddr + i); + } + wd->cdmac.c8727_st506_cb = (ccba[1] << 16) | (ccba[2] << 8) | (ccba[3] << 0); + write_log(_T("ST-506 Change Command Block %02x.%02x.%02x.%02x\n"), + ccba[0], ccba[1], ccba[2], ccba[3]); } else if (cmd == 0x00 || cmd == 0x01 || cmd == 0x03 || cmd == 0x05 || cmd == 0x06 || cmd == 0x08 || cmd == 0x0a || cmd == 0x0b) { bool outofbounds = false; if (cmd == 0x05 || cmd == 0x06 || cmd == 0x08 || cmd == 0x0a) { @@ -3957,12 +3968,14 @@ bool a2090_init (struct autoconfig_info *aci) init_wd_scsi(wd); + if (aci->rc->device_settings & 1) + ew(aci->autoconfig_raw, 0x30, 0x80); // SCSI only flag + wd->configured = 0; wd->autoconfig = true; wd->board_mask = 65535; memcpy(&wd->bank, &dmaca2091_bank, sizeof addrbank); memcpy(wd->dmacmemory, aci->autoconfig_raw, sizeof wd->dmacmemory); - //ew(wd, 0x30, 0x80); // SCSI only flag alloc_expansion_bank(&wd->bank, aci); diff --git a/expansion.cpp b/expansion.cpp index b0a9e1f1..a5d5f9dc 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -4364,6 +4364,15 @@ static const struct expansionboardsettings comspec_settings[] = { NULL } }; +static const struct expansionboardsettings a2090a_settings[] = { + { + _T("Disable ST-506 support"), + _T("nost506"), + }, + { + NULL + } +}; static const struct expansionboardsettings a4091_settings[] = { { _T("Fast Bus"), @@ -4503,7 +4512,9 @@ const struct expansionromtype expansionroms[] = { _T("a2090a"), _T("A2090a"), _T("Commodore"), a2090_init, NULL, a2090_add_scsi_unit, ROMTYPE_A2090 | ROMTYPE_NONE, 0, 0, BOARD_AUTOCONFIG_Z2, false, NULL, 0, - true, EXPANSIONTYPE_SCSI | EXPANSIONTYPE_CUSTOM_SECONDARY + true, EXPANSIONTYPE_SCSI | EXPANSIONTYPE_CUSTOM_SECONDARY, + 0, 0, 0, false, NULL, + false, 0, a2090a_settings }, { _T("a2091"), _T("A590/A2091"), _T("Commodore"), -- 2.47.3