[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing emulator...



On 6 Sep 2002, Dosius wrote:

> Date: 6 Sep 2002 11:00:16 -0700
> From: Dosius <steve@dosius.zzn.com>
> Newsgroups: comp.sys.apple2
> Subject: Re: Writing emulator...

...

> Thanks.  The current version is 0.67


Hello,

thanks for your kind reply. After downloading version 0.51, I took a closer
look at it. There are a few things I noticed:
a) About the language card: I may be wrong, but in your code the readbank
and writebank functions differ in that way that when calling writebank you
do not subtract 0xd000 from addr, neither is that done within writebank. The
index you've got then might be wrong. (You also check for addr<4096, which
may not work then.) Second, your code does not differentiate between read-
and write access to the LC. With the AppleII it is possible to write a
copyloop that reads the rom and stores it to the LC without changing the
softswitches since read and write access are kept apart. (Well, to my
knowledge.) This may be the reason, why DOS 3.3 Master etc do not work.
b) There is a bug in your graphic emulation. When converting the bits to
pixels you need to take the surrounding bits of the left and right byte also
into account, e.g. when writing to address $2001, use bits from $2000,$2001,
and $2002. Otherwise you will get strange vertical lines (black or white).
I've written a (long) email for you, which also contains some example code
of my Java-emulator (LC and graphic) for you to compare, but I'm not quite
sure whether I should send it. (Well.. I don't like to get on people's
nerve by sending them things they don't want.) Please let me know if you are
interested.
Important: The bugs I mentioned may be very old and already corrected, thus
only appear in version 0.51. My apologies then. I will download the latest
version 0.67 now.
c) Some people of this newsgroup (Mr. David Empson and others) have put
together a nice and, I guess, almost complete list of all the softswitches
and other things about the AppleII. In case you haven't got it, I could send
it to you. Also, if you need information about illegal opcodes, I've got lot
of sheets for it, though I do not recommend to implement them, since later
AppleIIes (and, of course, the AppleIIc) were shipped with 65c02 processors
that do not have illegal instructions anymore, just NOPs. In other words:
You can almost ignore them, as long as you make sure that you skip the right
amount of bytes that belong to the instruction. BTW.: This is a bug in
AppleWin, and I know of one case where, as a result, a disk image does not
work with AppleWin. (Oh dear, I should write a mail to Oliver about it...)
d) Could I ask you, please, whether your C-compiler generates 16-bit real mode
code or 32-bit protected mode code? This is important if you want a good
emulation of the various AppleII resolutions. You can stick to DOS, of
course, if you like (my first PC emulator also runs under DOS), but 16 bit
real mode today is simply a dead end and far too slow.

Kind regards

  Holger