[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emulating a Z80, and, So that's why CP/M 3.1 is so slow...
mjmahon@aol.com (Michael J. Mahon) wrote in message news:<20030910021726.17885.00000962@mb-m05.aol.com>...
> Dosius wrote:
>
> >We're working on emulating the Z80 in EMU][, which has come a lot
> >farther than my attempts in Dapple. Well, we have CP/M 3.1 booting,
> >but not yet 2.2 (I have to figure how to implement some ops myself,
> >possibly, and the code is very different from any of the other Z80
> >cores I have). Right now, I'm trying to get the "CP" opcode to work.
> >
> >Well, interestingly enough, while running CP/M-80 3.1 on EMU][, there
> >was visibly a lot of alternating between the 6502 and the Z80, and, as
> >with Apple Oasis, it ran like molasses.
> >
> >That would explain it...the frequent CPU switching probably slowed the
> >system down to a crawl. No wonder it dragged.
Well, that's the case for 2.2 apparently unless a ][+ is being used...
:\ (I got CP/M 2.2 to work myself, after I got a patch to the Z80
source that implemented a few more ops.)
> It's good to hear that your emulation is coming along.
>
> But in a real system, switching CPUs is not a very expensive
> operation, since, at least in the SoftCard model, each CPU is
> just waiting to be "tagged" while the other CPU is running.
I thought the 6502 had to run half an op's length every so many cycles
or it would "forget" where it was.
> Although the SoftCard scheme was speed-limited by sharing
> the Apple's memory, it at least had the advantage that no data
> copying had to be done. (I'm kidding, of course--having most
> of the Apple's memory as an I/O buffer is sweet, as in the
> AppliCard approach.)
For the following text, I decided to pass this on to comp.os.cpm ;)
Heh. Well, it was SoftCard CP/M we had (3.1, and I had 2.2), so
that's what we emulated (also, we had docs for the SoftCard).
BTW, I'm still trying to get the thing to work better... MBASIC is
broken, and my VER.COM doesn't work, but hey... :) It's something.
(Stylistically z80.c is much cleaner than most Z80 emulators. This
may affect its speed, but I doubt it. It does run significantly
faster in emu]['s turbo mode as a ][+ where all the console I/O is
done on the Z80.)
(I wonder if there's a "com2hex" type program... Transferring files to
CP/M seems very difficult for me, unless I transfer as an ASCII file
to DOS 3.3 and use APDOS to get it, then, LOAD it. (A DOS-based CP/M
disk tool would be nice to bundle with the emulator if there only were
one.)
Also, an interesting idea might be to create an extended CP/M-80 BIOS
which knows how to access the Dapple Megadisk in Slot 5, allowing a
1.44 MB CP/M disk (in the same format, perhaps, as 144FEAT?) to be
used with CP/M-80 (and 22DISK to be used to transfer files).
-uso.