A self-descriptive stack-based PC platform
git clone git://git.luxferre.top/equi.git
Log | Files | Refs | README | LICENSE

commit d736ab301961c78647f12c36ad14dadf429f9400
parent 1a95042757e140e16945da3166c38ac90c04724e
Author: Luxferre <lux@ferre>
Date:   Fri, 12 Aug 2022 11:46:04 +0300

Adapted persfile to 96K and the buffer size to fit AppleIIe

MMakefile | 16+++++++++++-----
MREADME.md | 2+-
Mequi.c | 6+++---
Mplatform-build-tools/PERS.DAT | 0
4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile @@ -3,30 +3,36 @@ PROJNAME=equi CFILES=equi.c PBTDIR=platform-build-tools +PERSFILE=PERS.DAT DFLAGS= -desktopcc: +desktopcc: perscopy cc -std=c89 -Os -o $(PROJNAME) $(CFILES) $(DFLAGS) # strip $(PROJNAME) -tcc: +tcc: perscopy tcc -std=c89 -o $(PROJNAME) $(CFILES) $(DFLAGS) apple2-build: cl65 --standard c89 -O -Os -t apple2 -o $(PROJNAME).apple2 $(CFILES) $(DFLAGS) -apple2: apple2-build +apple2: apple2-build perscopy cp $(PBTDIR)/apple2/tpl.dsk $(PROJNAME).dsk java -jar $(PBTDIR)/apple2/ac.jar -p $(PROJNAME).dsk $(PROJNAME).system sys < $$(cl65 --print-target-path)/apple2/util/loader.system java -jar $(PBTDIR)/apple2/ac.jar -as $(PROJNAME).dsk $(PROJNAME) bin < $(PROJNAME).apple2 + java -jar $(PBTDIR)/apple2/ac.jar -dos $(PROJNAME).dsk $(PERSFILE) bin < $(PERSFILE) apple2enh-build: cl65 --standard c89 -O -Os -t apple2enh -o $(PROJNAME).a2enh $(CFILES) $(DFLAGS) -apple2enh: apple2enh-build +apple2enh: apple2enh-build perscopy cp $(PBTDIR)/apple2/tpl.dsk $(PROJNAME)-enh.dsk java -jar $(PBTDIR)/apple2/ac.jar -p $(PROJNAME)-enh.dsk $(PROJNAME).system sys < $$(cl65 --print-target-path)/apple2enh/util/loader.system java -jar $(PBTDIR)/apple2/ac.jar -as $(PROJNAME)-enh.dsk $(PROJNAME) bin < $(PROJNAME).a2enh + java -jar $(PBTDIR)/apple2/ac.jar -dos $(PROJNAME)-enh.dsk $(PERSFILE) bin < $(PERSFILE) + +perscopy: + cp $(PBTDIR)/$(PERSFILE) $(PERSFILE) clean: - rm -f ./$(PROJNAME) *.dsk *.o *.apple2 *.a2enh + rm -f ./$(PROJNAME) $(PERSFILE) *.dsk *.o *.apple2 *.a2enh diff --git a/README.md b/README.md @@ -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 4GB flat persistent storage (tape, disk, flash etc); +- Up to 2GB flat persistent storage (tape, disk, flash etc); - Serial terminal input and output; - Up to 65535 peripheral extension ports, including several virtual ports. diff --git a/equi.c b/equi.c @@ -59,12 +59,12 @@ /* Command buffer size in bytes */ #ifndef GPD_AREA_SIZE -#define GPD_AREA_SIZE 6400u +#define GPD_AREA_SIZE 5100u #endif /* Command buffer size in bytes */ #ifndef CMD_BUF_SIZE -#define CMD_BUF_SIZE 15600u +#define CMD_BUF_SIZE 14000u #endif /* Maximum amount of CLT entries */ @@ -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 << 16) | adl, SEEK_SET); + fseek(pfd, ((adh&0x7fffu) << 15) | 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 */ diff --git a/platform-build-tools/PERS.DAT b/platform-build-tools/PERS.DAT Binary files differ.