Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.00
5.0i
11 changes: 3 additions & 8 deletions acsi2stm/Acsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void Acsi::process(uint8_t cmd) {
// Used by UltraSatan protocol emulation (used for RTC)
#if ACSI_RTC
if(memcmp(&cmdBuf[1], "USCurntFW", 9) == 0) {
verbose("USatan query ");
verbose("USatan ");
// Fake the firmware
memcpy(buf, "ACSI2STM " ACSI2STM_VERSION "\r\n", 16);
DmaPort::sendDma(buf, 16);
Expand Down Expand Up @@ -423,7 +423,7 @@ void Acsi::process(uint8_t cmd) {
commandStatus(ERR_OK);
return;
}
verboseHex("Invalid buffer ", "read mode ", cmdBuf[1], ' ');
verboseHex("Invalid buffer ", "read ", cmdBuf[1], ' ');
commandStatus(ERR_INVARG);
return;
}
Expand Down Expand Up @@ -595,15 +595,10 @@ void Acsi::modeSense4(uint8_t *outBuf) {
int cylinders;
for(heads = 255; heads >= 1; --heads) {
cylinders = blocks / heads;
if(cylinders > 0xffffff || (blocks % heads) == 0) {
if((blocks % heads) != 0)
dbg("(truncated) ");
if(cylinders > 0xffffff || (blocks % heads) == 0)
break;
}
}

verbose("blocks=", blocks, " cylinders=", cylinders, " heads=", heads, ' ');

for(uint8_t b = 0; b < 24; ++b)
outBuf[b] = 0;

Expand Down
37 changes: 11 additions & 26 deletions acsi2stm/GemDrive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,17 @@ void GemDrive::onInit(bool setBootDrive) {
// if ACSI_RTC is disabled to keep file dates in sync with the ST clock.
Devices::setDateTime(Tgetdate(), Tgettime());

#if ACSI_RTC
else {
// Sync internal ST clock with ours
uint16_t date;
uint16_t time;
Devices::getDateTime(&date, &time);
Tsetdate(date);
Tsettime(time);
}
#endif

#if ACSI_DEBUG
// With a debug build, just leave a small delay to make onscreen messages
// easily readable.
Expand All @@ -1262,9 +1273,7 @@ void GemDrive::onGemdos() {
DECLARE_CALLBACK(Pterm0);
DECLARE_CALLBACK(Cconws);
DECLARE_CALLBACK(Dsetdrv);
DECLARE_CALLBACK(Tgetdate);
DECLARE_CALLBACK(Tsetdate);
DECLARE_CALLBACK(Tgettime);
DECLARE_CALLBACK(Tsettime);
DECLARE_CALLBACK(Dfree);
DECLARE_CALLBACK(Dcreate);
Expand Down Expand Up @@ -1353,18 +1362,6 @@ bool GemDrive::onDsetdrv(const Tos::Dsetdrv_p &p) {
return forward();
}

bool GemDrive::onTgetdate(const Tos::Tgetdate_p &) {
#if ACSI_RTC
if(Devices::isDateTimeSet()) {
uint16_t date;
uint16_t time;
Devices::getDateTime(&date, &time);
return rte(ToLong(date));
}
#endif
return forward();
}

bool GemDrive::onTsetdate(const Tos::Tsetdate_p &p) {
// Set even if ACSI_RTC is disabled to keep file dates in sync with the ST
// clock.
Expand All @@ -1377,18 +1374,6 @@ bool GemDrive::onTsetdate(const Tos::Tsetdate_p &p) {
return forward();
}

bool GemDrive::onTgettime(const Tos::Tgettime_p &) {
#if ACSI_RTC
if(isDateTimeSet()) {
uint16_t date;
uint16_t time;
getDateTime(&date, &time);
return rte(ToLong(time));
}
#endif
return forward();
}

bool GemDrive::onTsettime(const Tos::Tsettime_p &p) {
// Set even if ACSI_RTC is disabled to keep file dates in sync with the ST
// clock.
Expand Down
2 changes: 0 additions & 2 deletions acsi2stm/GemDrive.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ struct GemDrive: public Devices, public Tos {
DECLARE_CALLBACK(Pterm0);
DECLARE_CALLBACK(Cconws);
DECLARE_CALLBACK(Dsetdrv);
DECLARE_CALLBACK(Tgetdate);
DECLARE_CALLBACK(Tsetdate);
DECLARE_CALLBACK(Tgettime);
DECLARE_CALLBACK(Tsettime);
DECLARE_CALLBACK(Dfree);
DECLARE_CALLBACK(Dcreate);
Expand Down
40 changes: 13 additions & 27 deletions acsi2stm/Tos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,44 +94,30 @@ Long Tos::Mfree(ToLong block) {
return gemdos(Mfree_op, p);
}

Long Tos::Pexec_4(ToLong basepage) {
Pexec_4_p p;
p.mode = 4;
p.z1 = 0;
p.basepage = basepage;
p.z2 = 0;
Long Tos::Pexec(ToWord mode, ToLong l1, ToLong l2, ToLong l3) {
Pexec_p p;
p.mode = mode;
p.l1 = l1;
p.l2 = l2;
p.l3 = l3;
verbose("Pexec\n");
return gemdos(Pexec_op, p);
}

Long Tos::Pexec_4(ToLong basepage) {
return Pexec(4, 0, basepage, 0);
}

Long Tos::Pexec_5(ToLong cmdline, ToLong env) {
Pexec_5_p p;
p.mode = 5;
p.z1 = 0;
p.cmdline = cmdline;
p.env = env;
verbose("Pexec\n");
return gemdos(Pexec_op, p);
return Pexec(5, 0, cmdline, env);
}

Long Tos::Pexec_6(ToLong basepage) {
Pexec_6_p p;
p.mode = 6;
p.z1 = 0;
p.basepage = basepage;
p.z2 = 0;
verbose("Pexec\n");
return gemdos(Pexec_op, p);
return Pexec(6, 0, basepage, 0);
}

Long Tos::Pexec_7(ToLong prgflags, ToLong cmdline, ToLong env) {
Pexec_7_p p;
p.mode = 7;
p.prgflags = prgflags;
p.cmdline = cmdline;
p.env = env;
verbose("Pexec\n");
return gemdos(Pexec_op, p);
return Pexec(7, prgflags, cmdline, env);
}

Long Tos::sysCall(void (*trap)(), Word opCode, uint8_t *paramBytes, int paramSize, int extraData)
Expand Down
2 changes: 1 addition & 1 deletion acsi2stm/Tos.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ struct Tos: public SysHook {
Long block;
Long newsiz;
};
DECLARE_FUNCTION(Pexec, 75, (ToWord mode)) {
DECLARE_FUNCTION(Pexec, 75, (ToWord mode, ToLong l1, ToLong l2, ToLong l3)) {
Word mode;
Long l1;
Long l2;
Expand Down
2 changes: 1 addition & 1 deletion acsi2stm/acsi2stm.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// acsi2stm global configuration

#define ACSI2STM_VERSION "5.00"
#define ACSI2STM_VERSION "5.0i"

// Set to 1 to enable debug output on the serial port
#define ACSI_DEBUG 0
Expand Down
23 changes: 23 additions & 0 deletions doc/firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,3 +439,26 @@ ACSI2STM device 1 has id 0-2 and device 2 has id 3-5 (ID_SHIFT set).
| 1.04 | Strict | ICD | PIO | FAT | ACSI2STM | cdefGHI |
| 1.04 | Normal | FAT | PIO | FAT | ACSI2STM | CDEFGH |
| 1.04 | PIO | FAT | PIO | FAT | ACSI2STM | CDEFGH |

### Date setting test

With 2 devices in GemDrive mode, standard firmware. Device 0 will be IDs 0-2 and
device 3 will be IDs 3-5.

* Put a battery only in device 0
* Set the date on device 0
* Power off everything and let capacitors discharge
* Boot with both units
* Check the date is correct
* Create a folder on a floppy disk
* Check the folder's date and time
* Switch device IDs
* Power off everything and let capacitors discharge
* Boot with both units
* Check the date is correct
* Power off everything and let capacitors discharge
* Put a battery in device 0. Both units now have a battery
* Boot with both units
* Power off everything and let capacitors discharge
* Boot only with device 0
* Check the date is correct
Binary file modified pcb/Compact/3D view - ACSI2STM Compact.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pcb/Compact/BOM - ACSI2STM Compact.csv
Binary file not shown.
Binary file modified pcb/Compact/Gerber - ACSI2STM Compact.zip
Binary file not shown.
Loading