Menu ▾ ▴

#2272 1571 VIA1 PA reads missing bits

v3.10
closed-fixed
gpz
None
GTK3
Drives
7 days ago
2026-11-08
Lord Crass
No

Reads of the $1801 address on 1571 do not return bit 5, which correspond to the 1MHz/2MHz setting. This breaks 1571 mode detection on Action Replay 5 and Super Snapshot 5 cartridges, which have a special disk routine for double-sided 1571 mode which does not blank the screen. Instead, they crash because they assume the drive a 1541 and their code does not work at 2MHz.

--- vice-3.10/src/drive/iec/via1d1541.c 2025-12-24 12:51:33.000000000 -0600
+++ vice-3.10/src/drive/iec/via1d1541.c 2026-11-08 13:27:57.023056102 -0500
@@ -299,7 +299,13 @@
         || via1p->diskunit->type == DRIVE_TYPE_1571CR) {
         uint8_t tmp;
         rotation_rotate_disk(via1p->drive);

+        /* Only PA7 (byte ready) and PA0 (track 0 sensor) are driven from
+           outside; PA1-PA6 read high whenever they are inputs.  Measured on a
+           real 1571: $1801 = $99 (1 MHz) / $B9 (2 MHz) with the DOS's DDRA $66,
+           $FF with DDRA $00.  The Super Snapshot 5 and Action Replay 5 fast
+           loaders test PA3/PA4 to tell a 1571 in 2 MHz mode from a 1541.  */
         tmp = (via1p->drive->byte_ready_level ? 0 : 0x80)
+              | 0x7e
               | (via1p->drive->current_half_track == 2 ? 0 : 1);
         return (tmp & ~(via_context->via[VIA_DDRA]))
                | (via_context->via[VIA_PRA] & via_context->via[VIA_DDRA]);

Discussion

  • gpz

    gpz - 7 days ago

    applied in r46396 - thanks!

     
  • gpz

    gpz - 7 days ago

    PS: pls make a ticket for that G64 enhancement :)

     
  • gpz

    gpz - 7 days ago
    • status: open --> closed-fixed
    • assigned_to: gpz
     

Log in to post a comment.