So I happened to read an article today by Andy Hertzfeld on folklore.org and it got me thinking, maybe I should look at the 6522 VIA registers for silentype activity.

https://www.folklore.org/StoryView.py?project=Macintosh&story=Apple_II_Mouse_Card.txt

Quote
Bud Tribble had written the initial code to drive the mouse on the Macintosh, but I had to maintain it, so I was familiar with how it worked. I had used a 6522 chip the previous year, since the Apple III had one, which I had programmed to shift bits out to the Silentype thermal printer. I realized that all that was required to interface a mouse to the Apple III was to make a simple connector to route the appropriate signals to the proper pins.

so let's fire up Business Basic v1.23 and see what happens:

OPEN #1,".SILENTYPE"

The "D" 6522 via is mapped in at FFD0-FFDF. A is the shift register address, so let's watch $FFDA.

Code
wp ffda,1,w,1,{printf "f1=%x f2=%x",b@f1,b@f2}

f1=0 f2=6
Stopped at watchpoint 3 writing 00 to 0000FFDA (PC=4801)
Stopped at watchpoint 3 writing 06 to 0000FFDA (PC=480D)
f1=0 f2=C
Stopped at watchpoint 3 writing 00 to 0000FFDA (PC=4801)
Stopped at watchpoint 3 writing 0C to 0000FFDA (PC=480D)
f1=0 f2=9
Stopped at watchpoint 3 writing 00 to 0000FFDA (PC=4801)
Stopped at watchpoint 3 writing 09 to 0000FFDA (PC=480D)
f1=0 f2=3
Stopped at watchpoint 3 writing 00 to 0000FFDA (PC=4801)
Stopped at watchpoint 3 writing 03 to 0000FFDA (PC=480D)
f1=0 f2=6
f1=0 f2=C
f1=0 f2=9
f1=0 f2=3

Code
47F3: AD 5E C0 lda $c05e
47F6: AD DF FF lda $ffdf
47F9: 48       pha
47FA: 09 80    ora #$80         // set the clock to 1mhz
47FC: 8D DF FF sta $ffdf      // store into E environment register
47FF: A5 F1    lda $f1
4801: 8D DA FF sta $ffda     // store the first byte (from $F1) into FFDA
4804: AD DD FF lda $ffdd    // poll the IFR flags until the shift is done
4807: 29 04    and #$04
4809: F0 F9    beq $4804
480B: A5 F2    lda $f2
480D: 8D DA FF sta $ffda   // store the second byte (from $F2) into FFDA
4810: AD DD FF lda $ffdd   // poll the flags until shift is done
4813: 29 04    and #$04
4815: F0 F9    beq $4810
4817: AD 5B C0 lda $c05b     // this part must be to "clock" it into the silentype's internal registers
481A: AD 5F C0 lda $c05f
481D: EA       nop
481E: AD 5E C0 lda $c05e
4821: EA       nop
4822: AD 5A C0 lda $c05a
4825: 68       pla
4826: 8D DF FF sta $ffdf     // restore E register
4829: 60       rts
I edited a bunch of stuff out, but you can see the pattern 6,c,9,3,6,c,9,3 which is pretty clearly the horizontal stepper motor which is bits 0-3. It appears that it writes two bytes in succession to the shift register for the silentype.



Last edited by Golden Child; 08/12/19 01:22 PM.