
Greetings all,

I hope someone will read this as I haven't seen any traffic in this
newsgroup for some weeks.  I'm writing my own Apple ][ emulator on
the PC, and I need some technical information about the following
things.  If anyone can help me I would really appreciate it.

BTW, I have a real Apple //e (NOT enhanced) with a Parallel Interface
Card, Disk ][ card and an extended 80-col card, so *don't* send ROM's.

NOTE: I have ordered a copy of the Apple //e Technical Reference
Manual.  So if you know that "such-and-such" is in the manual, then a
quick line to let me know would be nice.  I have no idea when the
manual is going to arrive, but I thought I should take advantage of my
account before it is closed mid-November (see below).

Peripheral Card Entry Points
============================

Are there set entry points for ROM code in peripheral cards?  The
ROM listings for my Parallel Interface Card seem to indicate entry
points at offsets $0,$2,$80,$82,$C0,$C2.  Is this true for all
cards? The Applesoft BASIC statements PR#n and IN#n would seem to
require specific entry points.

Disk ][ Controller
==================

Here's what I know about the controller's soft switches:

Offset Description
  $0   Stepper motor phase 0 off
  $1   Stepper motor phase 0 on
  $2   Stepper motor phase 1 off
  $3   Stepper motor phase 1 on
  $4   Stepper motor phase 2 off
  $5   Stepper motor phase 2 on
  $6   Stepper motor phase 3 off
  $7   Stepper motor phase 3 on
  $8   Drive motor off
  $9   Drive motor on
  $A   Select drive 1
  $B   Select drive 2
  $C   Shift while writing/read data
  $D   Load while writing/read write protect
  $E   Read
  $F   Write

This list does NOT tell me what actually accessing the soft switch
does.  Especially, I have no idea how to use the stepper motor phases
to move the head.  I know that you can read/write a byte every 32
clock cycles, but I don't know how to actually get it to read or
write.  Also, for a really good emulation I need to know what happens
if you don't read/write every 32 clock cycles.  i.e. I need to know
exactly what happens when a soft switch is accessed, either
immediately or some N clock cycles in the future.

Language Card
=============

Another area which I don't know much about is the language card.
Here's what I do know (N=slot of card).  Corrections will be very
much appreciated.

$C082+$N0 - De-select slot N RAM.  Presumably, if N=0, then this
            selects the Applesoft/Monitor ROM's.
$C083+$N0 - Select bank 2 slot N RAM. Access again to write enable.
$C08B+$N0 - Select bank 1 slot N RAM. Access again to write enable.

When ROM is *NOT* selected, $E000-$FFFF of bank 1 is available no
matter if bank 1 or 2 is selected.
$D000-$DFFF - Change depending on which RAM bank (1 or 2) or if ROM
is selected.

80-Column Card (& Extended 80-Column Card)
==========================================

I know NOTHING about this card, even though I have one in my //e.
Like the Disk ][ card above, I would need to know details about all
the soft switches.  Things like turning 80-column mode on and off,
and accessing the extended memory.

I guess a related area is the double-hires graphics that are
available on the enhanced //e.  As mentioned above, I only have one
of the early //e's, so presumably the ROM's I have at my disposal
won't support the graphics directly.  I would still like info on the
double-hires stuff so that I can support it, even if I can't use it
easily.

Is there such a thing as double-lores graphics?  And are there two
pages of each type?

***********************************

While I have Randy Spurlock's apl2em and his assembler source, my
PC assember knowledge is just this side of zero and I've found the
going tough.  Hopefully my work on my emulator should improve my
assembler. 

My Emulator
===========

Currently my emulator is written in 90% C (Borland C++ 3.1) with a
sprinkling of in-line assembler to access the BIOS.  I 'borrowed'
the Apple ROM from Randy Spurlock's apl2em, but eventually I'll
grab my //e's ROM and bring it across.

Right now my real //e runs about 6 times faster, but that should
change when I re-work the CPU emulation into assembler. 

It doesn't support anything other than text page 1, but eventually
I will use 640x200x16 VGA to support text, lores and hires full and
split screen video (640 so that 560 pixels of double-hires will fit,
and VGA so that I can match colours better).

My plans for the emulator include:

 o ProDOS mass-storage for up to 32MB.
 o ProDOS clock/calendar support.
 o Mouse support.
 o Serial port support.
 o Remote control of a real Apple's floppy disk for easy transfer
   of programs.
 o Double hires modes.

I can forsee some real problems trying to emulate a mouse and
serial port, since I don't have any ROM's for them.  I do have some
info on the I/O soft switches they use, so I'll try to
reverse-engineer those, but if anyone knows anything that might be
handy I'd be glad to hear from you.

If anyone has some useful trivia about the Apple ][ system or any
cards they would like to see in the emulator, I will be glad to hear
from you.  I can't accept ROM images due to copyright stuff,
but would be happy to try and fake the I/O soft switches.  To do
this requires detailed knowledge of what the soft switches do, so
you would need to supply that.  Please don't ask for such-and-such-
a-card without that sort of information.

Apple->PC Disk Transfer
=======================

Since my Apple only has a parallel card and no serial card, I wrote
my own program and built my own adapter to plug the Apple and PC
parallel ports together.  I used it to transfer (@~9000bps) disk
images for use with Randy's apl2em.  It's really crappy with NO
error checking, but seemed to work for most of my disks. 

My Account
==========

Please note that as I am a student, this account will die
mid-November, so don't send anything after then.  I anticipate
being back early March (depending on my exam results :-).  If the
emulator is in a workable condition by then I will post it, but
if nobody replies to my plea for Disk ][ interface info it is highly
unlikely it will support floppy disks.

Cheers and many thanks in advance,

Andrew Gregory

gregorya@cs.curtin.edu.au
