]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
A2090 ST-506 disable, support command 0x0F.
authorToni Wilen <twilen@winuae.net>
Sat, 27 May 2017 06:44:40 +0000 (09:44 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 27 May 2017 06:44:40 +0000 (09:44 +0300)
a2091.cpp
expansion.cpp

index 84b1a02a86a98c83a2de3e958f36018d443ee78d..2f752533203828660e90392a4caae8345bdd7a80 100644 (file)
--- 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);
 
index b0a9e1f1f57c4e7d3cd38d33f589f148bc9033a4..a5d5f9dc017c9aeb18f25e444c97e21be157eace 100644 (file)
@@ -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"),