America Online
APPLE II DEVELOPMENT FORUM CONFERENCE LOG
Tuesday, July 3, 1990  10:00 p.m. eastern time
Topic:  Network and Communication Programming
Forum Leader:  Gary Jacobson (AFA Gary J)

A2Evanglst Coach..... I am trying to open a second window with controls in a
          cdev... any
A2Evanglst Ideas??
Coach101   Whew...   Hmm....   That could get tricky....
A2Evanglst I know <grin>
Coach101   First, I think you are going to have to give up on letting the
          user do anything but stay in the
Coach101   window until you close it.  That is, intercept all events and if
          they don't apply to the window
Coach101   you just opened, ignore them, issue a <boing> or whatever, but you
          cannot act on them...
Coach101   The situation is akin to having an NDA "spawn" a new window and
          that is presently fairly unsolvable..
Coach101   ga
A2Evanglst Hmmmm...   Basically I have run out of room on my main window and
          I have some
A2Evanglst controls that I need to have the user access
A2Evanglst so... I thought that another window would do the trick...
          but.....
A2Evanglst we (my programmer and I) are finding out that it is very hard to
          do
Coach101   I had that problem and used a pop-up control to let the user
          select which set of fields they were going
Coach101   to work with.  That may work for you...
AFA Gary J Ok, let's get started officially.
AFA Gary J Welcome to the Apple II Development Forum.  Tonight's topic
          is...
AFA Gary J Network and Communication programming.
AFA Gary J Let's use protocol so we can keep track of what's being said,
          beginning NOW...
AFA Gary J so if you have a question, type a "?" on a line by itself, or if
          you have a
AFA Gary J comment on the current topic, type a "!" on a line by itself.
AFA Gary J Ok, let's open the floor to questions.
AFA Gary J GA, Jeffrey
JeffreyH11 Is there any EASY way to access the GS serial ports from within a
          16-bit
JeffreyH11 program (assembly or otherwise)?  The Text Tools just don't cut it
          for
JeffreyH11 making the control calls.  GA
AFA Gary J GA, Matt
AFA Gary J (Jim Luther has lots of info on this, I know)
Matt DTS   There's a better way than text tools - the OS.
Matt DTS   "But wait - you can't set the baud rate from GS/OS."  Yes, you
          can, and here's how.
Matt DTS   You use DInfo to go looking for drivers.  You're interested in
          drivers that have a device ID of
Matt DTS   "printer port" or "modem port" and their characteristics word has
          the "generated driver" bit
Matt DTS   set.
Matt DTS   If you find such a driver, you can send firmware commands to it as
          part of the data stream.  You only
Matt DTS   run into trouble if you have to "zap" so no commands can be set.
Matt DTS   GA.
JeffreyH11 If I do "Zap," how can I recover?  And how can I do things like
          check DCD or
JeffreyH11 set the state of DTR?  GA
AFA Gary J Hi Jim!
AFA Gary J GA, Jim
Jump Long  You can use the firmware's extended interface to manipulate those
          signals
Jump Long  after using Zap on the IIGS.
Jump Long  Oh yeah, you can turn off Zap with the SetModeBits command.
Jump Long  just zero out bit 23.
Jump Long  ga
JeffreyH11 I know how the firmware works; I've used it with no problem from
          8-bit
JeffreyH11 programs, but it's a pain in the neck from a 16-bit program.  GA
Jump Long  You need a GS/OS loaded driver, right?
Jump Long  (for the serial ports)
Coach101   Sounds like your cue Jim :)
JeffreyH11 I don't know that there is one.
Jump Long  There isn't.
Jump Long  Would it help if you you had one?
AFA Gary J :)
JeffreyH11 Hence my problem.  Why, do you know where there is one?
Jump Long  Nope.  We need to write one when we find time.
JeffreyH11 It would be a useful thing to have around.
Matt DTS   We need to find time.  If you want one write to DTS and say so.
          We won't respond but we'll pass it
Matt DTS   along to engineering.
Matt DTS   (that means ALL of you)
AFA Gary J Is this kind of like voting?  :)
Jump Long  If there's a demand, then it will probably happen.
Matt DTS   Apple does what it believes the customers want.  :)
JeffreyH11 I want one.  (is that good enough, or would a letter be better?)
          :)
Matt DTS   A letter would be MUCH better.
AFA Gary J (Let's stuff the ballet box :)
Matt DTS   We can pile letters on people's desks and say "See?"
Jump Long  A letter can be passed along... physical proof :)
Matt DTS   Change your handwriting - send more than one letter.
JeffreyH11 :)
Matt DTS   Vote early and vote often.
Matt DTS   (getting too silly - GA)
Jump Long  Tell us what features you think a serial port driver should have
          (i.e., what
Jump Long  should you be able to control.)
JeffreyH11 What's the address?  (Can it be sent AOL, or is US mail
          preferable?)
AFA Gary J US Mail
Jump Long  Apple II Developer Technical Support
Jump Long  Apple Computer, Inc.
Jump Long  20525 Mariani Ave., MS: 75-3T
Jump Long  Cupertino, CA 95014
AFA Gary J Any further questions, Jeffrey?  (Thanks, Jim :)
JeffreyH11 No; that about covers it.  GA
AFA Gary J Ok, I see Coach has the next question..  GA, Coach
Coach101   I know that the physical speed of AppleTalk is in the 250k bps
          range.  Have any tests been done
Coach101   to determine what effective speed a IIgs can get with its
          AppleTalk SendDatagram interface?  ga
AFA Gary J GA, Jim
Jump Long  It really depends on how much processing you're doing while the
          AppleTalk
Jump Long  packets are coming in.  DDP doesn't have much overhead, but what
          your appli-
Jump Long  cation does with the data will affect how fast you can take it
          from AppleTalk.
Jump Long  I havne't done any benchmarks, though, if that's what you're
          getting at. :)
Jump Long  GA
Coach101   I was just wondering what the speed would be with a  program that
          just dumped the data in the bit
Coach101   bucket.  From that one would have an upper limit on speed for any
          protocol/application...   ga
Jump Long  We'd have to see how much overhead is added by the interrupt
          handling chain
Jump Long  to really know that. GA
AFA Gary J Anything else, Coach?
Coach101   Not for now....    I have found that the manual answers almost all
          of my questions...  ga
Jump Long  Good, that's what we like to here :)
Jump Long  hear
Coach101   Of course, it, the manual, could stand improvement :)
Jump Long  ahhhh
Matt DTS   Yeah, so could your tact.  Big deal.
Matt DTS   :)
Coach101   touche
AFA Gary J Ok, while we're waiting for more of your questions to come
          rolling in :),
AFA Gary J could we get the Apple DTS folks to outline some of the resources
          (i.e.
AFA Gary J technotes, etc.) that deal with telecommunication programming?
Matt DTS   Sure.  Go ahead, Jim.
AFA Gary J :)
Jump Long  IIGS #18 & #30
Jump Long  IIGS #18 covers the SCC from a low-level (firmware) programmer's
          view.
Jump Long  IIGS #30 was just revised to add more details about the Apple
          IIGS's serial
Jump Long  hardware.
AFA Gary J Thanks, Jim.
Jump Long  From what I've seen (a quick galnce over the source code), John
          Snow's
Jump Long  SERIO routines look like they should work OK for accessing the
          serial firmware
JeffreyH11 Are they in the library?
Jump Long  from the 16-bit world, but I can tell you now that they will
          probably be
Jump Long  broken by almost any loaded serial driver that's written (either
          that or they
Jump Long  will break the loaded driver), so it's hard to really recommend
          them whole-
Jump Long  heartedly.
Jump Long  Yes, they are in the library.
Jump Long  SERIO.ACU I believe.
AFA Gary J Yes.
AFA Gary J GA, Jeffrey
JeffreyH11 If somebody writes a loaded serial driver, we won't need John
          Snow's
JeffreyH11 routines anymore.  GA
Jump Long  Right.  In fact, a loaded driver would be able to transfer data to
          your application at much higher rates than the firmware could ever
          do.
AFA Gary J Since we don't really have people pounding down the walls with
          Telecom/Network
AFA Gary J questions this evening, let's open up the topic to whatever
          programming
AFA Gary J questions you might have (right after Jeffrey's comment :)  GA,
          Jeffrey
JeffreyH11 So the moral of the story is, check for a loaded driver and use it
          if it
JeffreyH11 is there, instead of using the firmware or SERIO or a similar
          library.  GA3
AFA Gary J GA Jim
Jump Long  I was just going to say YES, Use the driver. GA
JeffreyH11 (Did I ask a question - I didn't know that!) :)
Jump Long  (we're just confirming your statement's truth :)
AFA Gary J Back to you, Coach :)  Do you have something to add?
Coach101   I was going to follow up on the documentation for using the IIgs
          for communications and networking.
Coach101   If you are planning to do any work with AppleTalk, there are a
          couple of technotes you should read
Coach101   but only after having read the "AppleShare Programmer's Guide for
          the Apple II" and having
Coach101   a copy of "Inside AppleTalk" around.  ga
Jump Long  (there's 7 AppleTalk Tech Notes)
Coach101   Oops, change "couple" to "seven"
Coach101   :)
AFA Gary J Just make it a "few" :)
Jump Long  Jeffrey, feel free to send me your views of what a serial driver
          should have
Jump Long  in it.  You can EMail it to me here.
AFL Marty  What are the requirements for becoming an Apple Associate?
AFL Marty  (Other than paying your money, that is.)
Matt DTS   If you want more information, call (408) 974-4897.  Either that or
          I can make something up.
AFL Marty  I was just looking for general information.
Jump Long  Marty, I'd read the program sheet to you, but it's 5 miles away at
          work -- I
Jump Long  can't see that far :)
AFL Marty  Ah.   Thanks anyhow.
JeffreyH11 OK. Is there any way to tell exactly what keys are down on the
          IIgs (i.e., if
JeffreyH11 the A and K keys are down, how can I tell that?).  GA
Matt DTS   Jeffrey, the IIgs does not have n-key rollover.  You can't tell if
          more than one key is down.
Dave Lyons (Besides looking at the keyboard, JH? :-)
Dave Lyons (Don't think it can be done programmatically.)
JeffreyH11 Is it possible to get the ADB microcontroller to tell you about
          key presses
JeffreyH11 and releases but still process them?
Jump Long  ADB is serial, so it only sees one key (with modifiers) at a
          time.
Coach101   Is the serialization done in the keyboard or in the ADB chip in
          the IIgs?
Jump Long  at the keyboard
JeffreyH11 OK.  I was under the impression that the keyboard sent a message
          to the ADB
JeffreyH11 chip each time a key (modifier or otherwise) was pressed or
          released.
Jump Long  and at the chip
Jump Long  It's two-way communication.
Dave Lyons I think ADB would be perfectly happy to tell you all the keys that
          go down, as they go down, but
Dave Lyons Apple's keyboards don't scan for new keypresses when 2 keys are
          already down.
JeffreyH11 I assume that holds only for non-modifier keys?
Dave Lyons JH, probably--I think the ADB controller knows about the modifiers
          all the time, even though the
Dave Lyons modifiers register often has an outdated copy, *on purpose* (it
          tells you the modifiers that go with
Dave Lyons the keypress you're trying to read, at least if keyboard buffering
          is on).
JeffreyH11 I wrote a program to monitor the ADB chip RAM and noticed a
          register that
JeffreyH11 always reflects the currect state of the modifiers, and another in
          which a
JeffreyH11 bit changes to indicate the state of the RESET key.
JeffreyH11 Is there any way to examine the contents of the keyboard buffer
          without
JeffreyH11 emptying it (i.e. an INIT checking for a specific key without
          disturbing
JeffreyH11 others that do the same thing).
Dave Lyons JH, nope, no supported way (it's gotta be in the ADB controller
          RAM, but we don't guarantee
Dave Lyons what's in there).  I don't know whether you can look at all the
          keys as they're pressed using
Dave Lyons an ADB completion routine or not--I'm not an ADB expert.
JeffreyH11 Finally, (and this is the biggie), is there any info on what's in
          the ADB
JeffreyH11 RAM?  (at least what's currently there, even if it's not
          guaranteed)
Dave Lyons Sounds like you have more info than I do, from playing with it
          (you've played with it more than
Dave Lyons I have).
AFA Gary J I suspect that if there was, Apple wouldn't admit it for fear
          someone would
AFA Gary J write something that tried to adhere to it.
AFA Gary J :)
AFA Gary J (For good reasons)
JeffreyH11 There's already plenty of incompatibilities between ROM 2 and 3
          IIgs's, why
JeffreyH11 not one more?
Dave Lyons (BTW, I believe a lot of it *is* different between the "ROM 1" and
          "ROM 3" motherboards.)
Coach101   If you just want to sneak a peek, at the characters, can't you do
          something along the lines
Coach101   that GSBug does (presuming GsBug's trick is supported) ?
Dave Lyons (No such thing as ROM 2!  It's ROM 1 and ROM 3.)
JeffreyH11 What does GSBug do? (never even heard of it).
Dave Lyons What does GSBug do?
AFA Gary J GSBug is great!  A debugger for the IIGS.
JeffreyH11 Where is it available?  How much??
AFA Gary J APDA...
AFA Gary J $30.00
AFA Gary J GSBug (INIT version) resides in memory all the time.  At any time
          you can
AFA Gary J break into it (during your program execution) and step/trace
          through your code.
AFA Gary J It's nice, and a must have for assembly programmers on the
          IIGS.
Dave Lyons I think GSBug calls GetNextEvent to get its keys, actually.
          Coach, do you mean how it gets
Dave Lyons control on option-apple-ctrl-esc?  That's just done by chaining
          into the Apple-Ctrl-ESC vector
Dave Lyons and checking the KeyModReg for the Option key.
Dave Lyons (Apple-Ctrl-ESC produces an interrupt right away, whether keyboard
          buffering is on or not.)
Coach101   GsBug will intercept some key strokes and not others...   Caps
          Lock being the keep/put-back trig
Dave Lyons Coach:  Oh, *that*!  That's even more interesting, but it's not
          terribly related to keyboard
Dave Lyons buffering or ADB.  GSBug is intercepting *all* toolbox calls (to
          support tool-breaks), and if
Dave Lyons it sees a SystemEvent call
Dave Lyons and doesn't let it happen if CapsLock is down & the event is a
          keyDown.
JeffreyH11 I know the ADB tool set can be called to simulate a keypress, but
          it doesn't
JeffreyH11 support buffering (according to the Toolbox Ref.)
DL Davies  Oh, are we talking about buffering?
DL Davies  I am working on a macro program that sends keystrokes to the
          keyboard
JeffreyH11 Keyboard buffering, actually.
DL Davies  if I do it slow enough it works
DL Davies  if to fast I miss key strokes
JeffreyH11 How are you sending keystrokes?
DL Davies  any way to tell if the buffer is full?
DL Davies  Using the ADB send command
JeffreyH11 You mean SendInfo, with command #$11 (keyCode)?
DL Davies  yes
DL Davies  I set up a heart beat to send the keystroke
DL Davies  but if I send to many too fast
DL Davies  it loses some
JeffreyH11 The Toolbox Ref., Vol. 1 (page 3-20) claims that that call doesn't
          support
JeffreyH11 buffering, so you have to be sure that one keystroke is picked up
          by the
JeffreyH11 calling program before the next is sent.
DL Davies  ok, if it doesn't....how do I check if the key has been picked
          up?
JeffreyH11 I'd be interested in seeing how you're doing it.
JeffreyH11 Try checking the keyboard latch at $E0C000 to see if the character
          is still
JeffreyH11 there (with hi bit set).  If so, the keyboard hasn't been read.
DL Davies  right now I am checking $00C000...and if it is plus then the
          keyboard
DL Davies  has been read
DL Davies  but this doesn't seem to work properly
DL Davies  backwards....yes
DL Davies  that's how I do it
DL Davies  you are right...I typed it wrong
JeffreyH11 I think we just both said the same thing.  What I meant earlier
          was how you
JeffreyH11 were sending the keystrokes, etc.
DL Davies  I check $00C000 first thing in my interrupt handler
DL Davies  if it is minus...I get out immediately
DL Davies  if it is plus...then I send another key
DL Davies  but I still lose key strokes
JeffreyH11 Sounds to me like it should work perfectly, unless the program
          isn't resetting
JeffreyH11 the buffer (by writing to $E0C010
Coach101   Something I have always been confused about...
Coach101   Do the softswitches I/O space etc, reside at $00Cxxx or $e0cxxx?

DL Davies  both coach.
JeffreyH11 Technically, they reside at $E0C0xx, but they can also be found at
          $00C0xx
Coach101   Is that true regardless of machine state?  Me thinks not!
JeffreyH11 IF the I/O shadowing is enabled (which it usually is).  I always
          use $E0C0xx
JeffreyH11 just in case.
Dave Lyons (I/O shadowing always has to be enabled when interrupts occur!)
DL Davies  Well, I hacked at diversy...and he seems to send about 5 keys at a
          time
JeffreyH11 You mean Diversi-Key?  I took a look at that code as well, and was
          rather
JeffreyH11 confused by parts of it.  Do you have a sensible disassembly of
          any of it?
DL Davies  MacroMate only sends one and it checks the same way I am
Coach101   I agree Jeffrey...   E0Cxxx never fails, 00Cxxx could fail if the
          machine state was muddled...
DL Davies  No Jeff, Diversy Key is a MESS!
DL Davies  I guess I can only send one key at a time, right?
JeffreyH11 Agreed.  I've never seen MacroMate.
DL Davies  I wanted to send about 5 every heartbeat to make it faster
DL Davies  but I guess I can't
JeffreyH11 I guess so; unless someone redesigns the ADB chip to handle
          buffering on that
JeffreyH11 command.  I don't see any reason you couldn't speed it up, as long
          as your
JeffreyH11 check works right.
DL Davies  I set buffering with the send command (you can set the modes)
DL Davies  doesn't seem to make a difference
JeffreyH11 The toolbox manual insists that SendInfo keyCode never supports
          buffering,
JeffreyH11 regardless of the mode settings.  See Vol. 1, page 3-20.
DL Davies  it seems to buffer to a point
DL Davies  maybe 20 characters
JeffreyH11 There may be a way to check the # of characters in the buffer by
          reading
JeffreyH11 ADB ram, but I still haven't deciphered it.  If you want, I'll
          send you back
JeffreyH11 a copy of my ADBRead program (reads and displays ADB RAM
          continuously until
JeffreyH11 you tell it to quit.)
DL Davies  Dave, you got any help on this subject?
Dave Lyons Not really...not an ADB expert.
DL Davies  Well, it works fine one character every HeartBeat, but I really
          wanted to
DL Davies  speed it up
DL Davies  Is the ADB ram documented anywhere?
JeffreyH11 No way you can send more than one character per HeartBeat if
          there's no
JeffreyH11 buffering, because the program can't read the keyboad until your
          HeartBeat
JeffreyH11 routine ends.
DL Davies  Is the ADB ram documented anywhere?
AFA Gary J We were just discussing that earlier.
AFA Gary J No. :)
DL Davies  Wish I had been here
JeffreyH11 I don't think so, but I have a few notes on what some of the
          locations do.
AFA Gary J (Just a minute or two before you came in.  You had good timing
          :)
DL Davies  Diversy key plays with the RAM locations....where did he get his
          info? :)
JeffreyH11 He probably just experimented until he got what he wanted.  Notice
          that in
JeffreyH11 Diversi-Key, it doesn't wait for the key to be read.  If you don't
          put delays
JeffreyH11 between the characters in your macros, and the application slows
          down, you
JeffreyH11 will lose keystrokes.
AFA Gary J Right.  (Probably hacked it out)
DL Davies  Have you noticed he has his own buffer...very big....if you type
          while a long
DL Davies  macro executes NO keys are lost
DL Davies  amazing...macromate does not do that
JeffreyH11 I've also noticed that he makes major changes to the Toolbox
          vectors and
JeffreyH11 intercepts toolbox calls.
JeffreyH11 The reason (I think) that no keys are lost while a macro executes
          is that the
JeffreyH11 macros bypass the KB buffer and so the buffer fills up with
          manually typed
JeffreyH11 keystrokes.  Anyone have any more info on DivKey or MacroMate?
DL Davies  NO...I'm talking...he saves upto 255 characters...he does it
          himself...I found
DL Davies  his buffer...and saw the data in it
JeffreyH11 If you have any info whatsoever on how DivKey works, please send
          it to me.
DL Davies  I've been hacking it for a week
DL Davies  and it still makes no sense
JeffreyH11 Do you want my ADBRead program in E-Mail?  I might be able to send
          it right
JeffreyH11 away (have to check, though.)
DL Davies  He uses the setmodes call to disable the keyboard
DL Davies  while the macro executes
DL Davies  macromate doesn't do this
DL Davies  sure, jeff! :)
JeffreyH11 I have some disassembly of it; do you have Orca/Disassembler?
DL Davies  yep
JeffreyH11 I'll send you my template file for DivKey.  What info do you have
          on
JeffreyH11 MacroMate?
DL Davies  This has been very frustrating....DAVE we need a Tech Note on ADB!
          :)
JeffreyH11 Please!!!!
DL Davies  Well....Thanks for all your help...Jeff, I'll get the file
          later....thanks