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

Re: Looking for Serial Card programming information (not SSC)



Rubywand (rubywand@swbell.net) wrote:
: "Rich J." writes ...
: > 
: > Hello,
: > 
: > Trying to configure the Serial port of Oasis Apple II emulator.
: > 
: > I'd like the basic commands to set BAUD RATE, stop bits, parity, flow
: > control.

:      There is some info on serial interface commands which should work. See
: http://apple2.org.za/gswv/a2zine/Docs/SerialPortFirmwareInterfaceCommands.txt .



: > 
: > I'd also like to know how to send data to PR#1 (slot 1, where the card
: > is at) with a POKE, instead of PRINTing it to PR#1.
: > 
: > Rich


:      In a program, you can try POKEing the start location for SLOT 1 into the
: output hook-- e.g. 100 POKE 54, 0: POKE 55, 193: ... . 

:      From the keyboard, it seems to work okay for doing a LIST to the printer
: if you enter POKE 54, 0: POKE 55, 193: LIST-- i.e. all in one input. But; just
: the POKEs followed by a LIST at a separate prompt doesn't work because the
: pointer gets switched back between KB inputs.

If what you are doing is sending data to the card, you don't need to hook
through CSW...in fact, if I read correctly, that's what Rich doesn't want
to do...as hooking CSW is equivalent to executing PR#n.  What you want to
do instead is send bytes directly to the card.

The easiest way to do that might be (untested by me!) to send bytes
directly to the card's I/O routines without hooking CSW/KSW first.  In
fact, if I am reading this book correctly, Apple even provides the I/O
locations for it.  Unfortunately "this book" is the SSC manual which
includes a firmware listing, and I see from the title that we're not
talking about the SSC.

Hmmm...well, I have SSC entry points here...
$Cn05:  Read a character from card or keyboard, returned in A
$Cn07:  Output a character from A to card

Obviously those are hooks.  Look at the code in $Cn00 for guidance.  Look
for a place where it stores data in $36-$37 (CSW; KSW is $38-$39).  Find
whatever they put in CSW, and that will tell you the 'real' entry point. 
It won't work to initialize the card and then examine CSW because DOS has
a habit of always wanting to be last, so CSW will tend to always point to
$9EBD (DOS 3.3) no matter what cards are active.  Not sure about
BASIC.SYSTEM but I imagine it probably uses the same tactic.  I suppose
you could interrupt startup (no DOS), init the card, and then look at CSW
and see where it points.  Or just look at the firmware code and be done
with it.  8-)

In any case, if you wanted to output a byte to the SSC "the hard way" the
simplest way to do it is:
     LDA byte
     JSR $Cn07

--Dave Althoff, ][.
-- 
    /X\        _       _               *** Closed for the season. ***
   /XXX\      /X\     /X\_      _     /X\__      _     _        _____
  /XXXXX\    /XXX\  _/XXXX\_   /X\   /XXXXX\    /X\   /X\      /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX