Skip to content

Commit bf97a61

Browse files
committed
Fix for Dual Controller Support
1 parent 1bbd16a commit bf97a61

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

arch/m68k-amiga/boot/romlog.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Idx Name Size VMA LMA File off Algn
2-
0 .rom 00078d90 00f80000 00f80000 0007c000 2**2
3-
1 .ext 0007848e 00e00000 00e00000 00002000 2**2
2+
0 .rom 00078d40 00f80000 00f80000 0007c000 2**2
3+
1 .ext 00078446 00e00000 00e00000 00002000 2**2

arch/m68k-amiga/devs/sagasd/sagasd_device.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ static LONG SAGASD_PerformSCSI(struct IORequest *io)
236236
default:
237237
if (i >= 8 && i < 36)
238238
{
239-
if (sdu->sdu_SDCmd.unitnumber == 1) val = "Apollo SD-Card Slot #1 "[i - 8];
240-
if (sdu->sdu_SDCmd.unitnumber == 2) val = "Apollo SD-Card Slot #2 "[i - 8];
241-
if (sdu->sdu_SDCmd.unitnumber == 3) val = "Apollo SD-Card Slot #3 "[i - 8];
239+
if (sdu->sdu_SDCmd.unitnumber == 0) val = "Apollo SD-Card Slot #1 "[i - 8];
240+
if (sdu->sdu_SDCmd.unitnumber == 1) val = "Apollo SD-Card Slot #2 "[i - 8];
241+
if (sdu->sdu_SDCmd.unitnumber == 2) val = "Apollo SD-Card Slot #3 "[i - 8];
242242
} else {
243243
if (i >= 36 && i < 44)
244244
{
@@ -593,7 +593,7 @@ static LONG SAGASD_PerformIO(struct IORequest *io)
593593
sprintf(message,"Inserted SD-Card in Slot#%d contains a RDB Boot Record\n"
594594
"Only FAT File System is supported for hot-swap Disks\n"
595595
"For RDB Disks with OFS, FFS, SFS or PFS File Systems\n"
596-
"Please Reboot ApolloOS with Disk inserted to Mount", sdu->sdu_SDCmd.unitnumber);
596+
"Please Reboot ApolloOS with Disk inserted to Mount", sdu->sdu_SDCmd.unitnumber+1);
597597
choices = "Reboot|Continue";
598598

599599
struct IntuitionBase *IntuitionBase;
@@ -625,7 +625,7 @@ static LONG SAGASD_PerformIO(struct IORequest *io)
625625
sprintf(message,"Inserted SD-Card in Slot#%d contains a MBR Boot Record\n"
626626
"But the FAT File System is not readable/initialised\n"
627627
"Please use HDToolBox to create one fullsize FAT partition\n"
628-
"After that use Format to initialize the FAT Partition", sdu->sdu_SDCmd.unitnumber);
628+
"After that use Format to initialize the FAT Partition", sdu->sdu_SDCmd.unitnumber+1);
629629
choices = "Continue";
630630

631631
struct IntuitionBase *IntuitionBase;
@@ -749,7 +749,7 @@ static void SAGASD_IOTask(struct Library *SysBase)
749749
BOOL sdpin = FALSE;
750750
ULONG detectcounter = 0;
751751

752-
if (sdu->sdu_SDCmd.unitnumber > 0) sdpin = TRUE; //hardware pin enable for SD-Cards Slots #1 and higher
752+
//if (sdu->sdu_SDCmd.unitnumber > 0) sdpin = TRUE; //hardware pin enable for SD-Cards Slots #1 and higher
753753

754754
debug("Starting SAGASD_IOTask");
755755

@@ -859,14 +859,14 @@ static void SAGASD_IOTask(struct Library *SysBase)
859859
if(present)
860860
{
861861
sdpin = TRUE; // If hw detect reports TRUE, so we know now that SD pin works
862-
if (sdu->sdu_SDCmd.unitnumber == 2) debug("SD-Card Quick HW Detection: unit = %d | sdu_Present = %s | detect = %s",
862+
debug("SD-Card Quick HW Detection: unit = %d | sdu_Present = %s | detect = %s",
863863
sdu->sdu_SDCmd.unitnumber, sdu->sdu_Present ? "TRUE":"FALSE", present ? "TRUE":"FALSE");
864864
present = sdcmd_sw_detect_full(&sdu->sdu_SDCmd);
865865
} else {
866866
if (!sdpin)
867867
{
868868
present = sdcmd_sw_detect_full(&sdu->sdu_SDCmd); // If hw detect reports FALSE we have to do a second sw detect for V4 without SD pin
869-
if (sdu->sdu_SDCmd.unitnumber == 2) debug("SD-Card Full SW Detection: unit = %d | sdu_Present = %s | detect = %s",
869+
debug("SD-Card Full SW Detection: unit = %d | sdu_Present = %s | detect = %s",
870870
sdu->sdu_SDCmd.unitnumber, sdu->sdu_Present ? "TRUE":"FALSE", present ? "TRUE":"FALSE");
871871
}
872872
}
@@ -899,16 +899,14 @@ static void SAGASD_IOTask(struct Library *SysBase)
899899
if (sdpin)
900900
{
901901
present = sdcmd_hw_detect(&sdu->sdu_SDCmd);
902-
if (sdu->sdu_SDCmd.unitnumber == 2) debug("SD-Card Quick HW Detection: unit = %d | sdu_Present = %s | detect = %s",
902+
debug("SD-Card Quick HW Detection: unit = %d | sdu_Present = %s | detect = %s",
903903
sdu->sdu_SDCmd.unitnumber, sdu->sdu_Present ? "TRUE":"FALSE", present ? "TRUE":"FALSE");
904904
} else {
905905
present = sdcmd_sw_detect_quick(&sdu->sdu_SDCmd); // We can do a "light" detect when in sdu_Present mode
906-
if (sdu->sdu_SDCmd.unitnumber == 2) debug("SD-Card Quick SW Detection: unit = %d | sdu_Present = %s | detect = %s",
906+
debug("SD-Card Quick SW Detection: unit = %d | sdu_Present = %s | detect = %s",
907907
sdu->sdu_SDCmd.unitnumber, sdu->sdu_Present ? "TRUE":"FALSE", present ? "TRUE":"FALSE");
908908
}
909909

910-
911-
912910
if (!present) // SD-Card is Removed
913911
{
914912
//Forbid();
@@ -1081,14 +1079,14 @@ static void SAGASD_InitUnit(struct SAGASDBase * SAGASDBase, int id)
10811079
case 0: // SPI#1 | CS=0 | Micro-SD-Card slot (backside)
10821080
sdu->sdu_SDCmd.iobase = SAGA_SD_BASE_SPI1;
10831081
sdu->sdu_SDCmd.cs = SAGA_SD_CTL_NCS;
1084-
sdu->sdu_SDCmd.unitnumber = id+1;
1082+
sdu->sdu_SDCmd.unitnumber = id;
10851083
sdu->sdu_Enabled = TRUE;
10861084
break;
10871085

10881086
case 1: // SPI#2 | CS=0 | SD-Card slot 1 (Expansion Port)
10891087
sdu->sdu_SDCmd.iobase = SAGA_SD_BASE_SPI2;
10901088
sdu->sdu_SDCmd.cs = SAGA_CS_DRIVE0;
1091-
sdu->sdu_SDCmd.unitnumber = id+1;
1089+
sdu->sdu_SDCmd.unitnumber = id;
10921090
sdu->sdu_Enabled = TRUE;
10931091
break;
10941092

arch/m68k-amiga/hidd/gayle_ata/probe.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,11 @@ static int gayle_bus_Scan(struct ataBase *base)
212212
if (bus)
213213
{
214214
DINIT(bug("[ATA:Probe] Added: %s\n", attrs[1].ti_Data);)
215-
return TRUE;
216215
}
217216
DERROR(bug("[ATA:Probe] Failed to create object for device IO: %x:%x IRQ: %x\n", probedbus->port, probedbus->altport, probedbus->gayleirqbase);)
218217
if (!probedbus->atapb_Node.ln_Succ) FreeVec(probedbus);
219-
return TRUE;
220218
}
221219
}
222-
FreeVec(probedbus);
223220
}
224221
return TRUE;
225222
}

rom/filesys/fat/volume.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,10 +1291,10 @@ BOOL AttemptDestroyVolume(struct FSSuper *sb)
12911291

12921292
void DoDiskRemove(struct Globals *glob)
12931293
{
1294-
D(bug("[FAT] [%s] %s\n",__FUNCTION__, AROS_BSTR_ADDR(glob->sb->doslist->dol_Name) ));
1295-
12961294
if (glob->sb)
12971295
{
1296+
D(bug("[FAT] [%s] %s\n",__FUNCTION__, AROS_BSTR_ADDR(glob->sb->doslist->dol_Name) ));
1297+
12981298
struct FSSuper *sb = glob->sb;
12991299

13001300
if (!AttemptDestroyVolume(sb))
@@ -1305,5 +1305,7 @@ void DoDiskRemove(struct Globals *glob)
13051305
AddTail((struct List *)&glob->sblist, (struct Node *)sb);
13061306
SendEvent(IECLASS_DISKREMOVED, glob);
13071307
}
1308+
} else {
1309+
D(bug("[FAT] [%s] No existing disk to remove\n",__FUNCTION__ ));
13081310
}
13091311
}

0 commit comments

Comments
 (0)