minor persist fix

This commit is contained in:
Luxferre
2022-08-12 11:50:59 +03:00
parent d736ab3019
commit 8401e5bbb3
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ Main features of an Equi machine:
- Instruction ignore (II) flag;
- 16-bit input buffer pointer;
- 42752 bytes of main RAM (0x0000-0xa6ff), 41984 bytes of which are available for the program and data and 768 bytes hold the three stacks and necessary service registers listed above;
- Up to 2GB flat persistent storage (tape, disk, flash etc);
- Up to 4GB flat persistent storage (tape, disk, flash etc);
- Serial terminal input and output;
- Up to 65535 peripheral extension ports, including several virtual ports.
+1 -1
View File
@@ -308,7 +308,7 @@ ushort crc16(const uchar* data_p, uchar length) {
ushort persistOp(FILE *pfd, ushort maddr, ushort dataLen, ushort adl, ushort adh, uchar isWrite) {
ushort status = 0, proc;
if(pfd) {
fseek(pfd, ((adh&0x7fffu) << 15) | adl, SEEK_SET);
fseek(pfd, ((unsigned long) adh << 16) | adl, SEEK_SET);
if(isWrite) /* writing to the persistent area from the memory */
proc = (ushort) fwrite(&flatram[maddr], 1, dataLen, pfd);
else /* reading from the persistent area into the memory */