test for nothing

This commit is contained in:
Antoine Vignau 2023-11-02 19:27:17 +01:00
parent 1a3da1c52f
commit 6f976ef555
13 changed files with 13944 additions and 0 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -0,0 +1 @@
quicktest=Type(06),AuxType(1000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)

567
quicktake/apple/initscc.s Normal file
View File

@ -0,0 +1,567 @@
Z8530 SCC Samples
ref. file Z8530_SCCsamples.zip
After downloading, unzip using WinZIP or a similar
utility.
Resulting file is Z8530ROUTNS.SHK
After transferring Z8530ROUTNS.SHK to your Apple IIgs,
unShrink using GS.ShrinkIt ("GSHK", "ShrinkIt.GS", ...).
The enclosed file will show you how to access the Z8530 Serial Communications
controller in the Apple IIgs, without "breaking" the system in any way. These
routines are taken from a working development version of Warp Six BBS version
9.0, a shareware program. Currently version 8.9.1 is released; version 9.0 is
still under development. Warp Six is copyright, but the enclosed routines are
dedicated to the public domain, so you can use them in any way you wish.
The code is well commented, so read it and enjoy it. It's in Merlin 16+
format.
You will also want a copy of the Zilog Z8030/Z8530 SCC Technical Manual,
published by Zilog. Here are some of their phone numbers from the back of
that same manual. Some of these may have changed, so if you can't get
through, try directory assistance at (area code) 555-1212:
Toronto, Canada (416) 673-0634
Campbell, CA, USA (408) 370-8120
Dallas, TX, USA (214) 987-9987
Munich, Germany 49-89-672-045
Tokyo, Japan 81-3-587-0528
Kowloon, Hong Kong 852-7238979
Maidenhead, UK 44-628-392-00
Note: should you find any problems with the source code, please let me know;
however, take note that I don't warrant they are bullet-proof.
---
GEnie: J.FERR CompuServe: 73057,2455 | Jim Ferr, 26-95 DeCarie Circle
Internet: 73057.2455@compuserve.com | Etobicoke, Ontario M9B 3J5 CANADA
____________
* Sample IIGS source code by Jim Ferr.
* I hereby place this code in the public domain.
* March 19, 1992.
* Apple IIgs Z8530 registers and constants
GSCMDB = $C038
GSCMDA = $C039
GSDATAB = $C03A
GSDATAA = $C03B
WR11A = %11010000 ;init wr11 in Ch A
WR11B = %01010000 ;init wr11 in Ch B
;crystal not used by Ch B
;3.6864MHz external crystal
;Rx/Tx clock source = BRG
;TRxC is an input (tied to cts)
;bits 1 and 0 insignificant
RESETCHA = %11010001 ;constant to reset Ch A
RESETCHB = %01010001 ;constant to reset Ch B
* This little routine intercepts the Interrupt
* Manager vector at $E1/0010 or wherever it may
* be in the future, pointing it to our IRQIN
* routine. We save the original manager's address
* so we can pass interrupts that aren't ours to
* the slow-poke firmware.
XC
XC
ALLOCATE SEI
CLC ;go to native mode
XCE
REP #$30 ;with 16-bit registers
MX %00
PEA $0000 ;push long
PEA $0000
PEA $0004 ;Interrupt Manager refnum
LDX #$1103 ;GetVector
JSL $E10000
PLA ;save orgmgr address
STA ORGMGR
PLA
STA ORGMGR+2
PEA $0004 ;Interrupt Manager refnum
PEA $0000 ;bank zero
PEA #IRQIN ;our manager address
LDX #$1003 ;SetVector
JSL $E10000
SEC ;emulation mode
XCE
SEP #$30 ;with 8-bit registers
MX %11
CLI
RTS
XC OFF
XC
XC ; set to full 65816 opcodes
MX %11 ; set Merlin 16+ to 8-bit mode
* Data carrier detect flag for main program
DCDSTATE DS 1 ;flag. Non-zero means no DCD.
* Default baud rate
BAUD DFB 7 ;1=300, 2=1200, 3=2400
;4=4800, 5=9600, 6=19200
;7=38400, 8=57600.
* Interrupt Manager
*
* Here is where we get the irqs and steal ours from
* the teeth of the firmware, as it were. If the irq
* isn't ours, we exit to the firmware. If it is ours,
* we process it and RTI (Return from interrupt).
LST ON
IRQIN CLC ;emulation or native mode?
LST OFF
XCE ;enter native mode
BCC :NATIVE ;was already in native mode
* Emulation mode entry
SEC ;was in emulation mode, so
XCE ;lets go back to it.
PHP ;save status for firmware
PHA ;save registers
PHX
PHY
LDA #$FF
STA :FIRST ;first time through flag
STA :EMULATE ;emulation mode flag
BRA :IRQTEST ;check if our irq
* Native mode entry
:NATIVE PHP ;save status for firmware
REP #$30 ;16-bit mode
MX %00
PHA ;save all registers
PHX
PHY
PHB ;save DBR
PEA $0000
PLB ;switch in data bank zero
PLB ;pull 16 bits
SEP #$30 ;8-bit mode
MX %11
LDA #$FF
STA :FIRST ;first time through flag
STZ :EMULATE ;kill emulation mode flag
;fall through to :IRQTEST
* Test if irq pending on SCC Channel B
:IRQTEST LDX #3
STX GSCMDA
LDA GSCMDA ;read rr3 ch A ip bits
AND #%00000101 ;check for Rx and ext/stat
;in Ch B only.
BNE :GETINT
JMP :EXIT
:GETINT STZ :FIRST ;is definitely our irq
LDX #2
STX GSCMDB
LDA GSCMDB ;get vector from rr2B
AND #%01110000 ;examine bits 6-5-4
CMP #%00100000 ;Rx?
BEQ :RX
CMP #%01100000 ;special?
BEQ :SPECIAL
;if not, must be exint.
* Handle external status interrupts
:EXINT LDA #%00010000 ;reset exint pending
STA GSCMDB
LDA GSCMDB
* The two lines below are commented out because this
* driver assumes carrier detect is in GPi.
* AND #%00100000 ;get CTS/HSKi bit
* EOR #%00100000 ;flip the CTS/HSKi bit
AND #%00001000 ;get DCD/GPi bit
EOR #%00001000 ;flip the DCD/GPi bit
STA DCDSTATE ;non-zero means offline
BRA :IRQTEST
* Special condition (error)
:SPECIAL LDX #1 ;rr1
STX GSCMDB
LDA GSCMDB
TAX
AND #%01000000 ;framing error?
BNE :BAD
TXA
AND #%00100000 ;overrun? (latched)
BEQ :BAD
LDA #%00110000 ;error reset command
STA GSCMDB ;to clear latched error.
BRA :IRQTEST
:BAD LDA GSDATAB ;eat bad character!
BRA :IRQTEST
* Get received character
:RX LDA GSDATAB ;get good char
*** STUFF DELETED (BUFFER THE CHARACTER)
BRA :IRQTEST ;test for more!
:FIRST DS 1 ;flag for first time thru
:EMULATE DS 1 ;flag/ were we in emulation
;mode or native mode.
* The ONLY exit (from IRQIN)
:EXIT BIT :EMULATE
BPL :EXIT3
* Emulation mode; irq exit routine
:EXIT1 BIT :FIRST ;first time through?
BMI :EXIT2 ;if so, not our irq
PLY
PLX
PLA
PLP ;restore status
RTI ;was ours.
:EXIT2 PLY
PLX
PLA
PLP
BRA :JUMP ;go to the firmware
* Native mode, irq exit routine
:EXIT3 BIT :FIRST ;first time through?
BMI :EXIT4 ;if so, not our irq
REP #$30 ;16-bit mode
MX %00
PLB ;restore data bank register
PLY ;restore Y
PLX ;restore X
PLA ;restore A
PLP ;restore original status
RTI ;return from interrupt
:EXIT4 REP #$30 ;16-bit mode
PLB ;restore data bank register
PLY ;restore Y
PLX ;restore X
PLA ;restore A
PLP ;restore original status
MX %11
* JML to firmware's handler (and let it worry about
* this interrupt.)
:JUMP DFB $5C ;JML
LST ON
ORGMGR DS 4 ;to original manager address
LST OFF
* This routine removes our intercept of the vector
* and restores the original firmware vector.
REMOVE SEI
JSR DISABLE ;disable modem port!
;and put it back in state
;the serial port firmware
;can handle.
CLC
XCE
REP #$30 ;full 16-bit mode
PEA $0004 ;Interrupt Manager refnum
LDA ORGMGR+2
PHA
LDA ORGMGR ;original manager address
PHA
LDX #$1003 ;SetVector
JSL $E10000
SEC ;emulation mode
XCE
SEP #$30
MX %11
CLI
RTS
* INITGS: initialize the Modem Port
* (Channel B is modem port, A is printer port)
INITGS SEI
LDA GSCMDB ;hit rr0 once to sync up
LDX #9 ;wr9
LDA #RESETCHB ;load constant to reset Ch B
;for Ch A, use RESETCHA
STX GSCMDB
STA GSCMDB
NOP ;SCC needs 11 pclck to recover
LDX #4 ;wr4
LDA #%01000100 ;X16 clock mode,
STX GSCMDB ;1 stop bit, no parity
STA GSCMDB ;could be 1.5 or 2 stop bits
;1.5 set bits 3,2 to 1,0
;2 set bits 3,2 to 1,1
LDX #3 ;wr3
LDA #%11000000 ;8 data bits, receiver disabled
STX GSCMDB ;could be 7 or 6 or 5 data bits
STA GSCMDB ;for 8 bits, bits 7,6 = 1,1
LDX #5 ;wr5
LDA #%01100010 ;DTR enabled 0=/HIGH, 8 data bits
STX GSCMDB ;no BRK, xmit disabled, no SDLC
STA GSCMDB ;RTS *MUST* be disabled, no crc
LDX #11 ;wr11
LDA #WR11B ;load constant to write
;use #WR11A for channel A
STX GSCMDB
STA GSCMDB
JSR TIMECON ;set up wr12 and wr13
;to set baud rate.
LDX #14 ;wr14
LDA #%00000000 ;null cmd, no loopback
STX GSCMDB ;no echo, /DTR follows wr5
STA GSCMDB ;BRG source is XTAL or RTxC
* Enables
ORA #%00000001 ;enable baud rate gen
LDX #14 ;wr14
STX GSCMDB
STA GSCMDB ;write value
LDA #%11000001 ;8 data bits, Rx enable
LDX #3
STX GSCMDB
STA GSCMDB ;write value
LDA #%01101010 ;DTR enabled; Tx enable
LDX #5
STX GSCMDB
STA GSCMDB ;write value
* Enable Interrupts
LDX #15 ;wr15
* The next line is commented out. This driver wants
* interrupts when GPi changes state, ie. the user
* on the BBS may have hung up. You can write a 0
* to this register if you don't need any external
* status interrupts. Then in the IRQIN routine you
* won't need handling for overruns; they won't be
* latched. See the Zilog Tech Ref. for details.
* LDA #%00100000 ;allow ext. int. on CTS/HSKi
LDA #%00001000 ;allow ext. int. on DCD/GPi
STX GSCMDB
STA GSCMDB
LDX #0
LDA #%00010000 ;reset ext. stat. ints.
STX GSCMDB
STA GSCMDB ;write it twice
STX GSCMDB
STA GSCMDB
LDX #1 ;wr1
LDA #%00010001 ;Wait Request disabled
STX GSCMDB ;allow IRQs on Rx all & ext. stat
STA GSCMDB ;No transmit interrupts (b1)
LDX #9 ;re-write wr9
LDA #%00011001 ;set Master Interrupt Enable
STX GSCMDB ;this value gives us vector
STA GSCMDB ;information with each irq,
;in vector bits 6-5-4,
;also including status.
* The vector bits are not used by firmware and IIGS
* TechNote #18. But they make irq handling easier.
;(See IRQIN routine.)
CLI
RTS ;we're done!
* DISABLE: ensure serial port IRQ's turned off
* (DTR unaffected; use HANGUP or GSDTR)
* This routine puts the port in normal firmware
* state, with no interrupts possible.
DISABLE SEI
LDA #%00000010 ;disable MIE temporarily
LDX #9
STX GSCMDB
STA GSCMDB
* Interrupt Status
LDX #1 ;wr1
LDA #%00000000 ;no DMA, no interrupts
STX GSCMDB
STA GSCMDB
LDA GSDATAB ;eat any character waiting
LDX #0 ;wr0
LDA #%00010000 ;clear any ext ints
STX GSCMDB
STA GSCMDB
STX GSCMDB ;write it twice
STA GSCMDB
LDA #%00001010 ;reset MIE for firmware use
LDX #9
STX GSCMDB
STA GSCMDB
CLI
RTS
* TIMECON: Set time constant bytes in wr12 & wr13
* (In other words, set the baud rate.)
TIMECON LDY BAUD
LDA #12
STA GSCMDB
LDA BAUDL-1,Y ;load time constant low
STA GSCMDB
LDA #13
STA GSCMDB
LDA BAUDH-1,Y ;load time constant high
STA GSCMDB
RTS
* Table of values for different baud rates. There is
* a low byte and a high byte table.
BAUDL DFB 126 ;300 bps (1)
DFB 94 ;1200 (2)
DFB 46 ;2400 (3)
DFB 22 ;4800 (4)
DFB 10 ;9600 (5)
DFB 4 ;19200 (6)
DFB 1 ;38400 (7)
DFB 0 ;57600 (8)
BAUDH DFB 1 ;300 bps (1)
DFB 0 ;1200 (2)
DFB 0 ;2400 (3)
DFB 0 ;4800 (4)
DFB 0 ;9600 (5)
DFB 0 ;19200 (6)
DFB 0 ;38400 (7)
DFB 0 ;57600 (8)
* DOBAUD: Set baud rate without resetting entire 8530
* (Stop clock, set time constant, restart clock)
DOBAUD SEI
LDA #0 ;disable BRG (stop clock)
LDX #14 ;wr14
STX GSCMDB
STA GSCMDB ;write it
JSR TIMECON ;set time constant bytes
LDA #%00000001 ;re-enable BRG
LDX #14
STX GSCMDB
STA GSCMDB
:EXIT CLI
RTS
* MOUT: send character in A to modem, regardless of
* carrier state. Preserves all registers.
MOUT STA :TEMPA
STX :TEMPX
:SEND LDA GSCMDB ;rr0
TAX
AND #%00000100 ;test bit 2 (hardware handshaking)
BEQ :SEND
TXA
AND #%00100000 ;test bit 5 (ready to send?)
BEQ :SEND
:EXIT0 LDA :TEMPA ;get char to send
STA GSDATAB ;send the character
:EXIT LDX :TEMPX
LDA :TEMPA
RTS
:TEMPA DS 1
:TEMPX DS 1
* Code for checking if data in buffer deleted
* CLRMBUF: clear mbuf.
CLRMBUF SEI
** stuff deleted (fix buffer pointers)
LDA GSDATAB ensure no data in SCC
LDA GSDATAB by reading data 3 times
LDA GSDATAB (it has a 3 byte fifo)
:EXIT CLI
RTS

View File

@ -0,0 +1,639 @@
<!DOCTYPE html>
<html class="" lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="profile" href="https://gmpg.org/xfn/11">
<meta name="twitter:card" content="summary">
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.colino.net/wordpress/en/archives/2023/10/29/the-apple-quicktake-100-serial-communication-protocol/">
<meta property="og:title" content="The Apple Quicktake 100 serial communication protocol">
<meta property="og:description" content="The basics of communicating with a Quicktake 100 camera over the serial port.">
<meta property="og:locale" content="en_US">
<meta name="twitter:url" content="https://www.colino.net/wordpress/en/archives/2023/10/29/the-apple-quicktake-100-serial-communication-protocol/">
<meta name="twitter:title" content="The Apple Quicktake 100 serial communication protocol">
<meta name="twitter:description" content="The basics of communicating with a Quicktake 100 camera over the serial port.">
<meta name="description" content="The basics of communicating with a Quicktake 100 camera over the serial port.">
<link media="all" href="https://www.colino.net/wordpress/wp-content/cache/autoptimize/css/autoptimize_0a58cb847607d91b73cecb41f85fe7ca.css" rel="stylesheet"><title>The Apple Quicktake 100 serial communication protocol &#8211; colin@colino.net</title>
<script>window.koko_analytics = {"url":"https:\/\/www.colino.net\/wordpress\/koko-analytics-collect.php","post_id":5738,"use_cookie":0,"cookie_path":"\/wordpress"};</script><meta name='robots' content='max-image-preview:large' />
<link rel='dns-prefetch' href='//www.colino.net' />
<link rel="alternate" type="application/rss+xml" title="colin@colino.net &raquo; Feed" href="https://www.colino.net/wordpress/en/feed/" />
<link rel="alternate" type="application/rss+xml" title="colin@colino.net &raquo; Comments Feed" href="https://www.colino.net/wordpress/en/comments/feed/" />
<link rel="alternate" type="application/rss+xml" title="colin@colino.net &raquo; The Apple Quicktake 100 serial communication protocol Comments Feed" href="https://www.colino.net/wordpress/en/archives/2023/10/29/the-apple-quicktake-100-serial-communication-protocol/feed/" />
<link rel="https://api.w.org/" href="https://www.colino.net/wordpress/wp-json/" /><link rel="alternate" type="application/json" href="https://www.colino.net/wordpress/wp-json/wp/v2/posts/5738" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://www.colino.net/wordpress/xmlrpc.php?rsd" />
<meta name="generator" content="WordPress 6.3.2" />
<link rel="canonical" href="https://www.colino.net/wordpress/en/archives/2023/10/29/the-apple-quicktake-100-serial-communication-protocol/" />
<link rel='shortlink' href='https://www.colino.net/wordpress/?p=5738' />
<link rel="alternate" type="application/json+oembed" href="https://www.colino.net/wordpress/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.colino.net%2Fwordpress%2Fen%2Farchives%2F2023%2F10%2F29%2Fthe-apple-quicktake-100-serial-communication-protocol%2F" />
<link rel="alternate" type="text/xml+oembed" href="https://www.colino.net/wordpress/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.colino.net%2Fwordpress%2Fen%2Farchives%2F2023%2F10%2F29%2Fthe-apple-quicktake-100-serial-communication-protocol%2F&#038;format=xml" />
</head>
<body class="post-template-default single single-post postid-5738 single-format-standard wp-featherlight-captions col-2cl full-width logged-out" text="#333333" bgcolor="#ffffff" link="#807042" vlink="#b19c5e" alink="#000000">
<a class="skip-link screen-reader-text" href="#page">Skip to content</a>
<div id="wrapper">
<!--bool(false)
--> <div class="site-header" style="background-image: url('/wordpress/wp-content/uploads/header-1.png');">
<h1 class="site-title"><a href="https://www.colino.net/wordpress/" rel="home">colin@colino.net</a></h1>
</div>
<div id="wrapper-inner">
<div class="main" id="page">
<div class="main-inner group">
<div class="content">
<article id="post-5738" class="post-5738 post type-post status-publish format-standard hentry category-computers-en">
<div class="blog-card group">
<div class="blog-card-inner">
<div class="entry-media">
</div>
</div>
<div class="blog-card-bottom">
<div class="entry-meta group">
<span class="entry-date"><i class="far fa-calendar"></i>2023/10/29</span>
<span class="entry-meta-separator"> - </span>
<span class="entry-read-time"><i class="far fa-clock"></i>About 7 minutes read</span>
</div>
<div class="progress-container">
<div id="progress-bar" class="progress-bar"></div>
</div>
</div>
<header class="entry-header group">
<h1 class="entry-title">The Apple Quicktake 100 serial communication protocol</h1>
</header>
<div class="entry-content">
<div class="entry themeform">
<h2 class="wp-block-heading">Connecting</h2>
<p>The Quicktake 100 is connected via serial. Once connected, one has to open the lens cover to power on the camera. Unusually enough, the &#8220;conversation&#8221; is started by the camera, which is the first to send bytes to the computer. The computer signals it is ready to interact by opening the serial port at 9600bps, 8 data bits, 1 stop bit, no parity, and then pulling DTR down. The flow is the following:</p>
<ul>
<li>Camera: sends 7 bytes &#8211; I have not yet found a use for them.</li>
<li>Computer: replies with {0x5A,0xA5,0x55,0x05,0x00,0x00,0x25,0x80,0x00,0x80,0x02,0x00,0x80}</li>
<li>Camera: sends 10 bytes &#8211; I have not yet found a use for them.</li>
</ul>
<p>At this point, the computer is expected to turn Even parity on. It is also at that moment that the computer can renegotiate serial settings like speed, but I have, so far, problems with the exact implementation.</p>
<p>After Even parity is set, a slight delay is needed before continuing:</p>
<ul>
<li>Computer: sends {0x16,0x00,0x00,0x00,0x00,0x00,0x00}. I call it a &#8220;separator&#8221;, it seems to be a way to tell the camera to reset, or prepare, for another command.</li>
<li>Camera: sends {0x00} &#8211; an ack. The camera will ack some commands, and a non-zero response means there was an error processing the command. I mostly got 0x02 in case of problems in my commands. Other commands will be &#8220;acked&#8221; with a direct response.</li>
</ul>
<h2 class="wp-block-heading">Getting camera information</h2>
<p>The flow for getting the camera information is the following:</p>
<ul>
<li>Computer: sends {0x16,0x28,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x80,0x00} </li>
<li>Camera: responds with 128 bytes of data.</li>
</ul>
<p>In the response data, starting from byte 0, are the following:</p>
<ul>
<li>byte 0x04: Number of pictures taken (8-bit value)</li>
<li>byte 0x06: Number of pictures left (in the current quality mode)</li>
<li>byte 0x07: Current quality mode (1: 320&#215;240, 2: 640&#215;480)</li>
<li>byte 0x10: Current month</li>
<li>byte 0x11: Current day of month</li>
<li>byte 0x12: Current year (this is also an 8-bit value, so &#8220;23&#8221; for 2023)</li>
<li>byte 0x13: Current hour</li>
<li>byte 0x14: Current minute</li>
<li>bytes 0x2F to 0x4F: Name of the camera, trailed with spaces to 31 characters, and NULL-terminated</li>
</ul>
<p>(As an aside, in most commands sent by the computer, bytes 7 to 9 (counting from 0) contain the expected response size, in 24 bits, big-endian format)</p>
<h2 class="wp-block-heading">Getting a picture</h2>
<p>There are two commands to get a picture.</p>
<p><strong>Getting the &#8220;header&#8221;, basic information about the picture</strong>:</p>
<p>It will be needed later. The flow for getting the header is the following:</p>
<ul>
<li>Computer: sends {0x16,0x28,0x00,0x21,0x00,0x00,<strong>0x03</strong>,0x00,0x00,0x40,0x00}. Byte 0x06 is the picture number, starting from 1 and up to the number of pictures stored in the camera (picture 3 in this example) .</li>
<li>Camera: acks with {0x00}</li>
<li>Computer: responds with {0x06}</li>
<li>Camera: responds with 64 bytes of data.</li>
</ul>
<p>In the response data, starting from byte 0, are the following:</p>
<ul>
<li>byte 0x04-0x40: the important part of the <em>qtkt</em> header, notably containing:</li>
<li>byte 0x08-0x09: Image width, 16-bits, big-endian</li>
<li>byte 0x0A-0x0B: Image height, 16-bits, big-endian</li>
<li>byte 0x05-0x07: Image size, 24-bytes, big-endian. It will either be 115200 (high quality) or 28800 (standard quality).</li>
</ul>
<p>Before getting the picture, which will be raw ADPCM-compressed data, it might be useful to prepare the header of the output file, so that tools like <em>dcraw</em> can read and decode them. The qtkt file has the following format:</p>
<ul>
<li>starts with {0x71,0x6B,0x74,0x6B,0x00,0x00,0x00,0x04,0x00,0x00,0x73,0xE4,0x00,0x01}</li>
<li>736 bytes long header</li>
<li>byte 0x0E, the last 60 bytes of the camera&#8217;s response: the important part of the qtkt header</li>
<li>bytes 0x220-0x221: height of the picture (again), 16-bit word, big-endian</li>
<li>bytes 0x222-0x223: width of the picture, 16-bit word, big-endian</li>
<li>0x2E0-end of file: the image data</li>
</ul>
<p>The easiest way to build the header is to write 736 NULL bytes to the output file, rewind, seek, and write the relevant parts. I am unsure if the resulting file is valid for the official, vintage Quicktake software, but it is valid enough for <em>dcraw</em> to decode it correctly.</p>
<p><strong>Getting the picture:</strong></p>
<p>The next command will get the data of the photo. The flow is the following:</p>
<ul>
<li>Computer: sends {0x16,0x28,0x00,0x10,0x00,0x00,<strong>0x01,0x00,0x70,0x80</strong>,0x00}. Byte 0x06 is the number of the picture, and bytes 0x07-0x09 are the size of the answer we expect, as a 24-bit, big-endian number. It has to match the size of the picture that we learnt in the previous command. (Picture 1 in this example, 0x007080 bytes long)</li>
<li>Camera: sends {0x00}</li>
<li>Computer: sends {0x06}</li>
<li>Camera: send N bytes of data, depending on the picture&#8217;s quality (0x7080 or 0x01C200). The data is sent by blocks of 512 bytes, and the computer acks each block by sending {0x06}. At the end of the transfer, the last block will be shorter than 512 bytes (it will be <em>size modulo 512</em> bytes), and the computer must not send a {0x06} ack at the end of it.</li>
</ul>
<p><strong>Getting a thumbnail: </strong></p>
<p>It is possible to get a thumbnail version of the picture, but I didn&#8217;t make use of them yet, I didn&#8217;t investigate the format. It&#8217;s a thumbnail of 80&#215;60 pixels and we receive 2400 bytes of data, so I suppose it&#8217;s encoded at 4-bits per pixel and should be easy to decode, but I didn&#8217;t do it yet. The flow is the same as getting the full picture, and the command is {0x16,0x28,0x00,0x00,0x00,0x00,0x01,0x00,0x09,0x60,0x00}. Byte 0x03 is different, and bytes 0x07-0x09 are 0x000960, which is 2400 bytes.</p>
<h2 class="wp-block-heading">Deleting all photos on the camera</h2>
<p>It is only possible to delete all pictures, but not possible to delete a single one. The flow for deleting all pictures is:</p>
<ul>
<li>Computer: sends {0x16,0x00,0x00,0x00,0x00,0x00,0x00}</li>
<li>Computer: sends {0x16,0x00,0x00,0x00,0x00,0x00,0x00} again</li>
<li>Computer: sends {0x16,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}</li>
<li>Camera: sends {0x00}</li>
</ul>
<p>The computer does not answer that {0x00} ack.</p>
<h2 class="wp-block-heading">Setting the camera name</h2>
<p>It is possible to change the camera&#8217;s name in the following way:</p>
<ul>
<li>Computer: sends {0x16,0x2a,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x22,0x00,0x02,0x20,<strong>0x43,0x6F,0x6C,0x69,0x6E,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20</strong>}</li>
<li>Camera: acks with {0x00}</li>
</ul>
<p>The computer does not answer that ack. The new camera name is at byte 0x0D, and must be precisely 32 bytes long (padded with trailing spaces). In this example, the camera name is &#8220;Colin &#8220;.</p>
<h2 class="wp-block-heading">Setting the camera time</h2>
<p>It is possible to set the camera&#8217;s time in the following way:</p>
<ul>
<li>Computer: sends {0x16,0x2A,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x01,0x06,<strong>0x00,0x00,0x00,0x00,0x00,0x00</strong>}</li>
<li>Camera: acks with {0x00}</li>
</ul>
<p>The computer does not answer that ack. The date and time are encoded in one 8-bit value per field:</p>
<ul>
<li>byte 0x0D: month (1 to 12)</li>
<li>byte 0x0E: day</li>
<li>byte 0x0F: year (23 for 2023)</li>
<li>byte 0x10: hour</li>
<li>byte 0x11: minute</li>
<li>byte 0x12: second</li>
</ul>
<h2 class="wp-block-heading">Final words</h2>
<p>There may be errors or omissions in this document. It has been derived from my implementation of the Quicktake 100 serial protocol, so in case of doubts, please check the source code. I will gladly correct this document if needed, and will complete it with other findings, like when I&#8217;ll have figured how to negociate the speed.</p>
<div class="msb-container"> <p>
<a href="https://facebook.com/sharer.php?u=https%3A%2F%2Fwww.colino.net%2Fwordpress%2Fen%2Farchives%2F2023%2F10%2F29%2Fthe-apple-quicktake-100-serial-communication-protocol%2F&#038;t=The%20Apple%20Quicktake%20100%20serial%20communication%20protocol" target="_blank" class="minimal-share-button msb-facebook" aria-label="Share on Facebook" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true"><use xlink:href="https://www.colino.net/wordpress/wp-content/plugins/minimal-share-buttons/assets/images/icons.svg#icon-facebook-square"></use></svg></a><a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.colino.net%2Fwordpress%2Fen%2Farchives%2F2023%2F10%2F29%2Fthe-apple-quicktake-100-serial-communication-protocol%2F&#038;text=The%20Apple%20Quicktake%20100%20serial%20communication%20protocol" target="_blank" class="minimal-share-button msb-twitter" aria-label="Share on Twitter" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true"><use xlink:href="https://www.colino.net/wordpress/wp-content/plugins/minimal-share-buttons/assets/images/icons.svg#icon-twitter-square"></use></svg></a><a href="https://toot.kytta.dev/?text=The%20Apple%20Quicktake%20100%20serial%20communication%20protocol%20-%20https%3A%2F%2Fwww.colino.net%2Fwordpress%2Fen%2Farchives%2F2023%2F10%2F29%2Fthe-apple-quicktake-100-serial-communication-protocol%2F" target="_blank" class="minimal-share-button msb-mastodon" aria-label="Share on Mastodon" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true"><use xlink:href="https://www.colino.net/wordpress/wp-content/plugins/minimal-share-buttons/assets/images/icons.svg#icon-mastodon-square"></use></svg></a><a href="https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fwww.colino.net%2Fwordpress%2Fen%2Farchives%2F2023%2F10%2F29%2Fthe-apple-quicktake-100-serial-communication-protocol%2F&#038;description=The%20Apple%20Quicktake%20100%20serial%20communication%20protocol" target="_blank" class="minimal-share-button msb-pinterest" aria-label="Share on Pinterest" rel="noopener"><svg xmlns="http://www.w3.org/2000/svg" class="icon" aria-hidden="true"><use xlink:href="https://www.colino.net/wordpress/wp-content/plugins/minimal-share-buttons/assets/images/icons.svg#icon-pinterest-square"></use></svg></a> </p>
</div> <div class="clear"></div>
</div><!--/.entry-->
</div>
<div class="entry-footer group">
<div class="clear"></div>
<h4 class="heading">
<i class="fas fa-hand-point-right"></i>You may also like...</h4>
<ul class="related-posts group">
<li class="related">
<article class="related-post">
<div class="related-thumbnail">
<a href="https://www.colino.net/wordpress/en/archives/2017/12/17/strava-auto-start-stop-an-android-app-to-automatically-start-strava-rides/">
<h4 class="related-title">Stravomatic: an Android app to automatically start Strava rides</h4>
<div class="related-img-wrapper">
<img src="https://www.colino.net/wordpress/wp-content/themes/fast-boxcard/img/thumb-small.png" alt="Stravomatic: an Android app to automatically start Strava rides" />
</div>
</a>
</div><!--/.post-thumbnail-->
</article>
</li><!--/.related-->
<li class="related">
<article class="related-post">
<div class="related-thumbnail">
<a href="https://www.colino.net/wordpress/en/archives/2009/06/07/webkit2pdf/">
<h4 class="related-title">Webkit2pdf</h4>
<div class="related-img-wrapper">
<img src="https://www.colino.net/wordpress/wp-content/themes/fast-boxcard/img/thumb-small.png" alt="Webkit2pdf" />
</div>
</a>
</div><!--/.post-thumbnail-->
</article>
</li><!--/.related-->
<li class="related">
<article class="related-post">
<div class="related-thumbnail">
<a href="https://www.colino.net/wordpress/en/archives/2022/11/27/wordpress-fix-thumbnail-on-mastodons-preview-cards/">
<h4 class="related-title">WordPress: Fix thumbnail on Mastodon&#8217;s preview cards</h4>
<div class="related-img-wrapper">
<img width="113" height="113" src="https://www.colino.net/wordpress/wp-content/uploads/image-63-200x200.png" class="attachment-fast_boxcard-small size-fast_boxcard-small wp-post-image" alt="" decoding="async" /> </div>
</a>
</div><!--/.post-thumbnail-->
</article>
</li><!--/.related-->
</ul><!--/.post-related-->
<h3 class="post-nav-header"> Articles</h3>
<ul class="post-nav group">
<li class="next"></li>
<li class="previous"><a href="https://www.colino.net/wordpress/en/archives/2022/11/27/wordpress-fix-thumbnail-on-mastodons-preview-cards/" rel="prev"><i class="fas fa-chevron-left"></i><strong>Previous</strong> <span>WordPress: Fix thumbnail on Mastodon&#8217;s preview cards</span></a></li>
</ul>
<div id="comments" class="themeform">
<!-- comments open, no comments -->
<div id="respond" class="comment-respond">
<h3 id="reply-title" class="comment-reply-title">Leave a Reply</h3><form action="https://www.colino.net/wordpress/wp-comments-post.php" method="post" id="commentform" class="comment-form"><p class="comment-notes"><span id="email-notes">Your email address will not be published.</span> <span class="required-field-message">Required fields are marked <span class="required">*</span></span></p><p class="comment-form-comment"><label for="comment">Comment <span class="required">*</span></label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p><p class="comment-form-author"><label for="author">Name <span class="required">*</span></label> <input id="author" name="author" type="text" value="" size="30" maxlength="245" autocomplete="name" required="required" /></p>
<p class="comment-form-email"><label for="email">Email <span class="required">*</span></label> <input id="email" name="email" type="text" value="" size="30" maxlength="100" aria-describedby="email-notes" autocomplete="email" required="required" /></p>
<p class="comment-form-url"><label for="url">Website</label> <input id="url" name="url" type="text" value="" size="30" maxlength="200" autocomplete="url" /></p>
<p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="Post Comment" /> <input type='hidden' name='comment_post_ID' value='5738' id='comment_post_ID' />
<input type='hidden' name='comment_parent' id='comment_parent' value='0' />
</p><p style="display: none;"><input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="68488b5a04" /></p><p style="display: none !important;"><label>&#916;<textarea name="ak_hp_textarea" cols="45" rows="8" maxlength="100"></textarea></label><input type="hidden" id="ak_js_1" name="ak_js" value="91"/><script>document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() );</script></p></form> </div><!-- #respond -->
<p class="akismet_comment_form_privacy_notice">This site uses Akismet to reduce spam. <a href="https://akismet.com/privacy/" target="_blank" rel="nofollow noopener">Learn how your comment data is processed</a>.</p>
</div><!--/#comments-->
</div>
</div>
</article><!--/.post-->
</div><!--/.content-->
<div id="move-sidebar-content"></div>
</div><!--/.main-inner-->
<footer id="footer">
<div id="footer-bottom">
<a id="back-to-top" href="#"><i class="fas fa-angle-up"></i></a>
<div class="pad group">
<div class="grid one-full">
<div id="copyright">
<p>colin@colino.net &copy; 2023. All Rights Reserved.</p>
</div><!--/#copyright-->
<div id="credit">
<p>Powered by <a href="http://wordpress.org" rel="nofollow">WordPress</a>, Theme derived from <a href="http://alx.media" rel="nofollow">Alx Boxcard</a>, <a href="https://status.colino.net/">Status page</a> by <a href="https://updown.io">Updown</a>. </p>
</div><!--/#credit-->
<div id="fediverse">
<p><a rel="me" href="https://www.colino.net/wordpress/archives/author/colin/"></a></p>
</div>
</div>
<div class="grid one-full">
</div>
</div><!--/.pad-->
</div><!--/#footer-bottom-->
</footer><!--/#footer-->
</div><!--/.main-->
<header id="header">
<p class="site-description">News for few, stuff no-one cares about</p>
<div class="header-search">
<form method="get" class="searchform themeform" action="https://www.colino.net/wordpress/en/">
<div>
<input type="text" class="search" name="s" onBlur="if(this.value=='')this.value='To search type and hit enter';" onFocus="if(this.value=='To search type and hit enter')this.value='';" value="To search type and hit enter" />
</div>
</form>
</div>
<div id="wrap-nav-header" class="wrap-nav">
<nav id="nav-header-nav" class="main-navigation nav-menu"><button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><div class="menu-toggle-icon"><span></span><span></span><span></span></div></button><div class="menu-header-en-container"><ul id="nav-header" class="menu"><li id="menu-item-5249" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-5249"><span class="menu-item-wrapper"><a href="https://www.colino.net/wordpress/en/welcome/">Welcome</a></span></li>
<li id="menu-item-1919" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item menu-item-home menu-item-1919"><span class="menu-item-wrapper"><a href="https://www.colino.net/wordpress"><span class="screen-reader-text">Current Page: </span>Blog</a></span></li>
<li id="menu-item-1920" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1920"><span class="menu-item-wrapper"><a href="https://www.colino.net/wordpress/en/contact-en/">Contact</a></span></li>
<li id="menu-item-1921" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1921"><span class="menu-item-wrapper"><a href="https://www.colino.net/wordpress/cv-administrateur-systeme-reseau-clusters/">CV</a></span></li>
<li id="menu-item-1931" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-1931"><span class="menu-item-wrapper"><a href="/jeput">JEPUT</a></span></li>
<li id="menu-item-1932" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1932"><span class="menu-item-wrapper"><a href="https://www.colino.net/wordpress/en/stravomatic-an-app-to-start-strava-automatically/">Stravomatic</a></span></li>
<li id="menu-item-5591" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-5591"><span class="menu-item-wrapper"><a title="A Mastodon client for the Apple 2" href="https://www.colino.net/wordpress/en/mastodon-for-apple-ii/">Mastodon for Apple II</a></span></li>
<li id="menu-item-5770" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-5770"><span class="menu-item-wrapper"><a href="https://www.colino.net/wordpress/en/quicktake-100-for-apple-ii/">Quicktake for Apple II</a></span></li>
<li id="menu-item-5672" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-5672"><span class="menu-item-wrapper"><a href="https://www.colino.net/wordpress/a2trace-debug-and-profile-cc65-apple2-programs-with-mame/">a2trace debugger</a></span></li>
</ul></div></nav> </div>
<div id="move-sidebar-header"></div>
<div class="sidebar s1">
<div class="sidebar-content">
<div id="polylang-4" class="widget widget_polylang"><ul>
<li class="lang-item lang-item-15 lang-item-en current-lang lang-item-first"><a lang="en-US" hreflang="en-US" href="https://www.colino.net/wordpress/en/archives/2023/10/29/the-apple-quicktake-100-serial-communication-protocol/"><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><img src="/wordpress/wp-content/polylang/en_US.png" alt="English" border="0"><script defer src="https://www.colino.net/wordpress/wp-content/cache/autoptimize/js/autoptimize_13e7529fa7fb11c156543adac1a7d511.js"></script></body></html>
<span style="margin-left:0.3em;">English</span></a></li>
</ul>
</div><div id="categories-2" class="widget widget_categories"><h3 class="group"><span>Categories</span></h3>
<ul>
<li class="cat-item cat-item-33"><a href="https://www.colino.net/wordpress/en/archives/category/velo-en/">Bicycles</a>
</li>
<li class="cat-item cat-item-40"><a href="https://www.colino.net/wordpress/en/archives/category/claws-mail-en/">Claws Mail</a>
</li>
<li class="cat-item cat-item-29"><a href="https://www.colino.net/wordpress/en/archives/category/computers-en/">Computers</a>
</li>
<li class="cat-item cat-item-35"><a href="https://www.colino.net/wordpress/en/archives/category/bricolage-en/">DIY</a>
</li>
<li class="cat-item cat-item-45"><a href="https://www.colino.net/wordpress/en/archives/category/environnement-en/">Environment</a>
</li>
<li class="cat-item cat-item-31"><a href="https://www.colino.net/wordpress/en/archives/category/personal-en/">Personal</a>
</li>
<li class="cat-item cat-item-42"><a href="https://www.colino.net/wordpress/en/archives/category/photo-en/">Pictures</a>
</li>
<li class="cat-item cat-item-38"><a href="https://www.colino.net/wordpress/en/archives/category/sysadmin-en/">Sysadmin</a>
</li>
<li class="cat-item cat-item-17"><a href="https://www.colino.net/wordpress/en/archives/category/uncategorized-en/">Uncategorized</a>
</li>
</ul>
</div><div id="custom_html-5" class="widget_text widget widget_custom_html"><h3 class="group"><span>RSS</span></h3><div class="textwidget custom-html-widget"><ul>
<li>
<a href="/wordpress/feed/">
<i class="fa fa-rss" aria-hidden="true"></i>&nbsp;Articles RSS feed
</a>
</li>
</ul></div></div><div id="custom_html-6" class="widget_text widget widget_custom_html"><h3 class="group"><span>Social</span></h3><div class="textwidget custom-html-widget"><div style="text-align: center">
<a rel="me" href="https://piaille.fr/@colin_mcmillen"><img src="/wordpress/wp-content/themes/fast-boxcard/img/mstdn.png" alt="Mastodon" width=32 height=32/></a>
</div></div></div>
</div><!--/.sidebar-content-->
</div><!--/.sidebar-->
</header><!--/#header-->
</div><!--/#wrapper-inner-->
</div><!--/#wrapper-->
</body>
</html>
<!--
Performance optimized by Redis Object Cache. Learn more: https://wprediscache.com
Retrieved 1083 objects (386 KB) from Redis using PhpRedis (v5.3.7).
-->

View File

@ -0,0 +1,544 @@
#!/usr/bin/env python
# coding: utf-8
# deux trucs à installer (pip install serial)
import serial
import time
from hexbyte import *
def readbytes(number):
buf = ''
for i in range(number):
byte = ser.read()
buf += byte
return buf
# Ouvrir le port série à 960 bauds, 8 bits, 1 stop bit, parity even
# Remplacez /dev/tty.USA28X23P1.1 par le nom de votre adaptateur série
ser = serial.Serial('/dev/tty.USA28X23P1.1', 9600, bytesize=serial.EIGHTBITS, parity=serial.PARITY_EVEN, timeout=4)
# Envoyer un 05. Si l'appareil fonctionne il répond 06 (sinon le programme quitte)
ser.write(HexToByte('05'))
response1 = ByteToHex(readbytes(1))
assert response1 == '06'
print ("Réponse de l'appareil photo")
# -- Passage à 57600 --------------------------------------------------------------
# La commande force la liaison vers un débit plus élevé.
# 10 02 01 07 01 00 07 10 03 03 (57600)
# 10 02 01 07 01 00 06 10 03 02 (38400)
# 10 02 01 07 01 00 04 10 03 00 (19200)
init2 = '10 02 01 07 01 00 07 10 03 03'
ser.write(HexToByte(init2))
# Le 04 indique à l'appareil qu'on a terminé. On attend 0,3 secondes, on passe la liaison à 57600 bauds.
# Une fois que c'est fait, on envoie 05, on attend le 06 de l'appareil photo
ser.write(HexToByte('04'))
time.sleep (0.3)
ser.baudrate = 57600
ser.write(HexToByte('05'))
response1 = ByteToHex(readbytes(1))
assert response1 == '06'
print ("Passage à 57600 : OK")
# -- Modèle de l'appareil --------------------------------------------------------------
print ("\nModèle de l'appareil photo : ")
# La commande demande une info à l'appareil photo.
# Il répond avec une chaîne qui termine par 10 03 (suivi du checksum ignoré ici)
# La réponse (dans data) est une chaîne avec des infos sur le modèle.
init2 = '10 02 00 09 00 00 10 03 0A'
ser.write(HexToByte(init2))
data=''
while data[-4:] != '1003':
testvalue = ByteToHex(readbytes(1))
data = data + testvalue
data=data[2:]
print (data.decode("hex"))
# -- Récupération du nombre de photos----------------------------------------------------
# La commande demande le nombre de photos
print ("\nNombre de photos :")
init2 = '10 02 00 0B 00 00 10 03 08'
ser.write(HexToByte(init2))
# La réponse commence par 10 02, se termine par 10 03 (et le checksum) et contient le nombre de photos en hexadécimal.
# On l'affiche simplement en décimal après conversion
data=''
while data[-4:] != '1003':
testvalue = ByteToHex(readbytes(1))
data = data + testvalue
# Récupérer juste le nombre de photos
data = data[16:18]
print (int(data, 16))
# --- Récupération des miniatures ------------------------------------------------------
# La boucle commence à 1 et va jusqu'au nombre de photos
CompteurImage=1
CompteurImageMax=int(data,16)
print ("\nRécupération des miniatures en cours")
while CompteurImage <= CompteurImageMax:
# la commande pour récupérer le nom du fichier est 10 02 00 0A 02 00 xx 00 10 03 yy
# xx est le numéro de la photo en hexa. Si c'est la photo 10 (en hexa) faut doubler le 10
# yy est le checksum. C'est un xor de toutes les valeurs de la commande sauf le 10 02 du début et le 10 de la fin.
# Pour 10 02 00 0A 02 00 01 00 10 03, il faut donc xor 0A + xor 02 + xor 01 + xor 03 (0A)
init2 = '10 02 00 0A 02 00 '
init3=''
CompteurImageHex=hex(CompteurImage)
if CompteurImage < 16:
init3='0'
init3 = init3 + str(CompteurImageHex[2:])
if str(CompteurImageHex[2:]) == '10':
init2 = init2 + '10 '
init2 = init2 + init3
init2 = init2 + ' 00 10 03 '
Xor01='8'
Xor04='3'
CalculXor = int(Xor01) ^ int(CompteurImage)
CalculXor = int(CalculXor) ^ int(Xor04)
if CalculXor < 16:
CalculXor0 = '0'
else:
CalculXor0 = ''
CalculXor = hex(CalculXor)
CalculXor = CalculXor[2:]
CalculXor = CalculXor0 + CalculXor
init2 = init2 + CalculXor
# L'appareil renvoie une commande avec le nom du fichier complet.
ser.write(HexToByte(init2))
data=''
while data[-4:] != '1003' :
testvalue = ByteToHex(readbytes(1))
data = data + testvalue
# Récupérer juste la partie avec le nom de fichiers en 8.3. remplacement du JPG par TIF
# J'ouvre le fichier à écrire.
data=data[16:34]
ImageName=HexToByte(data)
ImageName=ImageName + 'TIF'
Image=open(ImageName, "w")
Image.close
# Récupération de la miniature. 10 02 00 00 02 00 xx 00 10 03 yy
init2 = '10 02 00 00 02 00 '
init3=''
CompteurImageHex=hex(CompteurImage)
if CompteurImage < 16:
init3='0'
init3 = init3 + str(CompteurImageHex[2:])
if str(CompteurImageHex[2:]) == '10':
init2 = init2 + '10 '
init2 = init2 + init3
init2 = init2 + ' 00 10 03 '
Xor01='2'
Xor04='3'
CalculXor = int(Xor01) ^ int(CompteurImage)
CalculXor = int(CalculXor) ^ int(Xor04)
if CalculXor < 16:
CalculXor0 = '0'
else:
CalculXor0 = ''
CalculXor = hex(CalculXor)
CalculXor = CalculXor[2:]
CalculXor = CalculXor0 + CalculXor
init2 = init2 + CalculXor
print ("Début du téléchargement de " + ImageName)
ser.write(HexToByte(init2))
data=''
fichierjpg=''
CompteurDoublonFin=0
# L'appareil va envoyer les données en plusieurs fois. Chaque fin de bloc contient 10 17 et doit être suivie d'un 06 (qui indique que tout va bien) par le client
# Le code ne vérifie pas le checksum et assume que tout va bien
# La fin de la transmission se termine par 10 03
# Attention, les données peuvent contenir 10 17 ou 10 03. L'appareil double donc les 10 pour l'indiquer. Une donnée 10 03 va donc être encodée 10 10 03. Il faut enlever les doublons avant d'enregistrer.
while True:
testvalue = ByteToHex(readbytes(1))
data = data + testvalue
# Truc tordu pour détecter la présence de doublon
# Compte le nombre de 10 *avant* le 1017
DetectDoublon=6
DetectDoublon2=4
CompteurDoublon=0
if data[-4:] == '1017':
while data[-DetectDoublon:-DetectDoublon2] == '10':
CompteurDoublon += 1
DetectDoublon2 += 2
DetectDoublon += 2
# Truc tordu pour détecter la présence de doublon
# Compte le nombre de 10 *avant* le 1003
DetectDoublonFin=6
DetectDoublonFin2=4
CompteurDoublonFin=0
if data[-4:] == '1003':
while data[-DetectDoublonFin:-DetectDoublonFin2] == '10':
CompteurDoublonFin += 1
DetectDoublonFin2 += 2
DetectDoublonFin += 2
# Si un doublon : pas 1017. Si deux doublons : 1017
if data[-4:] == '1017' and CompteurDoublon%2 == 0:
#if CompteurImage == 3:
data=data[14:]
data=data[:-4]
fichierjpg = fichierjpg + data
data=''
ser.write(HexToByte('06'))
# Si un doublon : pas 1003. Si deux doublons : 1003, on quitte
if data[-4:] == '1003' and CompteurDoublonFin%2 == 0:
#if CompteurImage == 3:
break
data=data[14:]
fichierjpg = fichierjpg + data
fichierjpg = fichierjpg[2:]
# Enlever 24 octets : un TIFF commence par 49h 49h 2Ah 00h
# La structure du QuickTake 200 est basique : 24 octets de données, puis un TIFF.
fichierjpg = fichierjpg[24:]
ser.write(HexToByte('06'))
# Une boucle qui va supprimer les doublons 10 10 pour les transformer en 10
LongueurString=len(fichierjpg)
CompteurString=0
while CompteurString <= LongueurString:
#print (CompteurString)
#print (LongueurString)
CompteurString1=CompteurString+4
CompteurString2=CompteurString+2
CompteurString3=CompteurString+8
if fichierjpg[CompteurString:CompteurString1] == ('1010'):
#print (fichierjpg[CompteurString:CompteurString3])
fichierjpg2 = fichierjpg[:CompteurString2]
fichierjpg2 = fichierjpg2 + fichierjpg[CompteurString1:LongueurString]
fichierjpg = fichierjpg2
#print (fichierjpg[CompteurString:CompteurString1])
CompteurString = CompteurString + 2
# Le fichier est rempli, on passe à la photo suivante
Image=open(ImageName, "w")
fichierjpg=HexToByte(fichierjpg)
Image.write(fichierjpg)
Image.close
CompteurImage += 1
ChoixUser='0'
while ChoixUser != 'o' and ChoixUser != 'n':
print ("Miniatures récupérées. Voulez-vous récupérer les JPG de l'appareil ?")
ChoixUser = raw_input("(o/n)")
if ChoixUser == 'n':
print ("Au revoir !")
# --- Récupération des miniatures ------------------------------------------------------
if ChoixUser == 'o':
CompteurImage=1
print ("\nRécupération des fichiers en cours")
while CompteurImage <= CompteurImageMax:
# idem plus haut, récupération du nom de fichier
init2 = '10 02 00 0A 02 00 '
init3=''
CompteurImageHex=hex(CompteurImage)
if CompteurImage < 16:
init3='0'
init3 = init3 + str(CompteurImageHex[2:])
if str(CompteurImageHex[2:]) == '10':
init2 = init2 + '10 '
init2 = init2 + init3
init2 = init2 + ' 00 10 03 '
Xor01='8'
Xor04='3'
CalculXor = int(Xor01) ^ int(CompteurImage)
CalculXor = int(CalculXor) ^ int(Xor04)
if CalculXor < 16:
CalculXor0 = '0'
else:
CalculXor0 = ''
CalculXor = hex(CalculXor)
CalculXor = CalculXor[2:]
CalculXor = CalculXor0 + CalculXor
init2 = init2 + CalculXor
ser.write(HexToByte(init2))
data=''
while data[-4:] != '1003' :
testvalue = ByteToHex(readbytes(1))
data = data + testvalue
# Récupérer juste la partie avec le nom de fichiers en 8.3
data=data[16:40]
ImageName=HexToByte(data)
Image=open(ImageName, "w")
Image.close
# Mesure du temps. A 57 600, Comptez 20 secondes par photo
# La commande pour lire une image précise est 10 02 00 02 02 00 xx 00 10 03
start = time.time()
init2 = '10 02 00 02 02 00 '
init3=''
CompteurImageHex=hex(CompteurImage)
if CompteurImage < 16:
init3='0'
init3 = init3 + str(CompteurImageHex[2:])
if str(CompteurImageHex[2:]) == '10':
init2 = init2 + '10 '
init2 = init2 + init3
init2 = init2 + ' 00 10 03 '
Xor01='0'
Xor04='3'
CalculXor = int(Xor01) ^ int(CompteurImage)
CalculXor = int(CalculXor) ^ int(Xor04)
if CalculXor < 16:
CalculXor0 = '0'
else:
CalculXor0 = ''
CalculXor = hex(CalculXor)
CalculXor = CalculXor[2:]
CalculXor = CalculXor0 + CalculXor
init2 = init2 + CalculXor
print ("Début du téléchargement de " + ImageName)
ser.write(HexToByte(init2))
data=''
fichierjpg=''
# Pour éviter de gérer les doublons, on lit tant qu'on n'a pas la fin d'un fichier JPEG (FFD9)
# Le code va enlever directement la signalisation sur le bus série
while data[-4:] != 'FFD9' :
testvalue = ByteToHex(readbytes(1))
data = data + testvalue
# Truc tordu pour détecter la présence de doublon
# Compte le nombre de 10 *avant* le 1017
DetectDoublon=6
DetectDoublon2=4
CompteurDoublon=0
if data[-4:] == '1017':
while data[-DetectDoublon:-DetectDoublon2] == '10':
CompteurDoublon += 1
DetectDoublon2 += 2
DetectDoublon += 2
# Si un doublon : pas 1017. Si deux doublons : 1017
if data[-4:] == '1017' and CompteurDoublon%2 == 0:
#if CompteurImage == 3:
# print (data)
data=data[14:]
data=data[:-4]
fichierjpg = fichierjpg + data
data=''
ser.write(HexToByte('06'))
data=data[14:]
fichierjpg = fichierjpg + data
fichierjpg = fichierjpg[2:]
ser.write(HexToByte('06'))
# Juste pour éviter de faire une boucle reloue
data=''
while data[-4:] != '1003' :
testvalue = ByteToHex(readbytes(1))
data = data + testvalue
# Suppression des 10 10
LongueurString=len(fichierjpg)
CompteurString=0
while CompteurString <= LongueurString:
#print (CompteurString)
#print (LongueurString)
CompteurString1=CompteurString+4
CompteurString2=CompteurString+2
CompteurString3=CompteurString+8
if fichierjpg[CompteurString:CompteurString1] == ('1010'):
#print (fichierjpg[CompteurString:CompteurString3])
fichierjpg2 = fichierjpg[:CompteurString2]
fichierjpg2 = fichierjpg2 + fichierjpg[CompteurString1:LongueurString]
fichierjpg = fichierjpg2
#print (fichierjpg[CompteurString:CompteurString1])
CompteurString = CompteurString + 2
# Le fichier est enregistré
Image=open(ImageName, "w")
fichierjpg=HexToByte(fichierjpg)
Image.write(fichierjpg)
Image.close
# Affichage du temps
print ("Temps de chargement de l'image")
end = time.time()
start=int(start)
end=int(end)
print(end - start)
CompteurImage += 1
# --- Effacement des images -------------------------------------------------------------
ChoixUser='0'
while ChoixUser != 'o' and ChoixUser != 'n':
print ("Images récupérées. Voulez-vous effacer les images de l'appareil ?")
ChoixUser = raw_input("(o/n)")
if ChoixUser == 'n':
print ("Au revoir !")
if ChoixUser == 'o':
CompteurImage=1
ImageDelete=CompteurImageMax
# Commencer par effacer la dernière et ensuite descendre vers zero
print ("\nEffacement des fichiers en cours")
while CompteurImage <= CompteurImageMax:
# On affiche le nom de la photo effacée (par utile, mais visuellement plus sympa)
init2 = '10 02 00 0A 02 00 '
init3=''
ImageDeleteHex=hex(ImageDelete)
if ImageDelete < 16:
init3='0'
init3 = init3 + str(ImageDeleteHex[2:])
if str(ImageDeleteHex[2:]) == '10':
init2 = init2 + '10 '
init2 = init2 + init3
init2 = init2 + ' 00 10 03 '
Xor01='8'
Xor04='3'
CalculXor = int(Xor01) ^ int(ImageDelete)
CalculXor = int(CalculXor) ^ int(Xor04)
if CalculXor < 16:
CalculXor0 = '0'
else:
CalculXor0 = ''
CalculXor = hex(CalculXor)
CalculXor = CalculXor[2:]
CalculXor = CalculXor0 + CalculXor
init2 = init2 + CalculXor
ser.write(HexToByte(init2))
data=''
while data[-4:] != '1003' :
testvalue = ByteToHex(readbytes(1))
data = data + testvalue
data=data[16:40]
ImageName=HexToByte(data)
print ("Effacement de " + ImageName)
# Effacement 10 02 00 19 00 xx 00 10 03 yy
init2 = '10 02 00 19 02 00 '
init3=''
ImageDeleteHex=hex(ImageDelete)
if ImageDelete < 16:
init3='0'
init3 = init3 + str(ImageDeleteHex[2:])
if str(ImageDeleteHex[2:]) == '10':
init2 = init2 + '10 '
init2 = init2 + init3
init2 = init2 + ' 00 10 03 '
Xor01='1B'
Xor04='3'
CalculXor = int(Xor01,16) ^ int(ImageDelete)
CalculXor = int(CalculXor) ^ int(Xor04)
if CalculXor < 16:
CalculXor0 = '0'
else:
CalculXor0 = ''
CalculXor = hex(CalculXor)
CalculXor = CalculXor[2:]
CalculXor = CalculXor0 + CalculXor
init2 = init2 + CalculXor
ser.write(HexToByte(init2))
ser.write(HexToByte('06'))
# Juste pour éviter de faire une boucle reloue
data=''
while data[-4:] != '1003' :
testvalue = ByteToHex(readbytes(1))
data = data + testvalue
ImageDelete -= 1
CompteurImage += 1

View File

@ -0,0 +1,15 @@
# QuickTake200
Un programme basique en Python pour récupérer les photos d'un QuickTake 200
ce petit programme en Python peut récupérer les images d'un Apple QuickTake 200, un appareil photo des années 90 qui se connecte sur un bus série.
Le code a été testé sous macOS avec un adaptateur série vers USB (https://amzn.to/2XRSdva) et un câble DE9 vers mini jack pour l'appareil photo.
Le programme en Python, très basique, se connecte à l'appareil, passe la connexion à 57 600 bauds, récupère le nombre de photos, sauve les miniatures en TIFF et demande s'il doit sauver les versions JPEG. Si oui, il récupère les fichiers JPEG - en série, c'est lent, comptez 20 secondes par image - et demande ensuite s'il doit effacer les photos.
Le code est commenté, et mon site web contient quelques explications sur le protocole.
Le code fonctionne aussi avec un Fujifilm DX-7 et sûrement d'autres appareils.
L'usage est basique : python QuickTake.py
Les images sont sauvées dans le dossier courant

10505
quicktake/dandumontp/dcraw.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,66 @@
"""HexByteConversion
Convert a byte string to it's hex representation for output or visa versa.
ByteToHex converts byte string "\xFF\xFE\x00\x01" to the string "FF FE 00 01"
HexToByte converts string "FF FE 00 01" to the byte string "\xFF\xFE\x00\x01"
"""
#-------------------------------------------------------------------------------
def ByteToHex( byteStr ):
"""
Convert a byte string to it's hex string representation e.g. for output.
"""
# Uses list comprehension which is a fractionally faster implementation than
# the alternative, more readable, implementation below
#
# hex = []
# for aChar in byteStr:
# hex.append( "%02X " % ord( aChar ) )
#
# return ''.join( hex ).strip()
return ''.join( [ "%02X " % ord( x ) for x in byteStr ] ).strip()
#-------------------------------------------------------------------------------
def HexToByte( hexStr ):
"""
Convert a string hex byte values into a byte string. The Hex Byte values may
or may not be space separated.
"""
# The list comprehension implementation is fractionally slower in this case
#
# hexStr = ''.join( hexStr.split(" ") )
# return ''.join( ["%c" % chr( int ( hexStr[i:i+2],16 ) ) \
# for i in range(0, len( hexStr ), 2) ] )
bytes = []
hexStr = ''.join( hexStr.split(" ") )
for i in range(0, len(hexStr), 2):
bytes.append( chr( int (hexStr[i:i+2], 16 ) ) )
return ''.join( bytes )
#-------------------------------------------------------------------------------
# test data - different formats but equivalent data
__hexStr1 = "FFFFFF5F8121070C0000FFFFFFFF5F8129010B"
__hexStr2 = "FF FF FF 5F 81 21 07 0C 00 00 FF FF FF FF 5F 81 29 01 0B"
__byteStr = "\xFF\xFF\xFF\x5F\x81\x21\x07\x0C\x00\x00\xFF\xFF\xFF\xFF\x5F\x81\x29\x01\x0B"
if __name__ == "__main__":
print ("\nHex To Byte and Byte To Hex Conversion")
print ("Test 1 - ByteToHex - Passed: ", ByteToHex( __byteStr ) == __hexStr2)
print ("Test 2 - HexToByte - Passed: ", HexToByte( __hexStr1 ) == __byteStr)
print ("Test 3 - HexToByte - Passed: ", HexToByte( __hexStr2 ) == __byteStr)
# turn a non-space separated hex string into a space separated hex string!
print ("Test 4 - Combined - Passed: ", \
ByteToHex( HexToByte( __hexStr1 ) ) == __hexStr2)

BIN
quicktake/quicktake.2mg Normal file

Binary file not shown.

BIN
quicktake/quicktest Normal file

Binary file not shown.

778
quicktake/quicktest.s Normal file
View File

@ -0,0 +1,778 @@
*
* QuickTake Protocol Test
*
mx %00
org $1000
lst off
*-------------------------------------------------
use 4/Mem.Macs
use 4/Misc.Macs
use 4/Util.Macs
*-------------------------------------------------
clc
xce
rep #$30
lda #0
tax
tay
sep #$30
jsr call0 ; init all
bit call1 ; say hello
bit call2 ; turn even parity on before calling
bit call3 ; get information
bit call4 ; à la manière de dandumontp
bit shutDown
sec
xce
sep #$20
rts
*----------- Init me
call0 jsr init
jsr raisedtr
ldy #4
jsr setspeed
lda #0
jmp wait
*----------- Say hello
call1 ldx #0
]lp jsr receive
sta response1,x
inx
cpx #response1end-response1
bne ]lp
ldx #0
]lp lda answer1,x
jsr send
inx
cpx #answer1end-answer1
bne ]lp
ldx #0
]lp jsr receive
sta response2,x
inx
cpx #response2end-response2
bne ]lp
rts
*---
response1 ds 7
response1end
answer1 hex 5A,A5,55,05,00,00,25,80,00,80,02,00,80
answer1end
response2 ds 10
response2end
*----------- Separator (change parity in the control panel before call)
call2 ldx #0
]lp lda str3,x
jsr send
inx
cpx #str3end-str3
bne ]lp
jsr receive
jsr $fdda
rts
*---
str3 hex 16,00,00,00,00,00,00
str3end
*----------- Get camera information
call3 ldx #0
]lp lda str4,x
jsr send
inx
cpx #str4end-str4
bne ]lp
ldx #0
]lp jsr receive
sta response3,x
inx
cpx #response3end-response3
bne ]lp
rts
*---
str4 hex 16,28,00,30,00,00,00,00,00,80,00
str4end
response3 ds 128
response3end
*----------- A la manière de dandumontp (parité paire)
call4 lda #5
jsr send
jsr receive
jmp $fdda
*-------------------------------------------------
* GS Port Driver Bios -- Slot #2
*
* written by Andy Nicholas on July 26, 1987
*
* History:
*
* Modified to use an 16k buffer May, 1991 by andy
*-------------------------------------------------
cr equ $0d
lf equ $0a
initstr equ $11d0
ansstr equ $11c0
cdbyte equ $11bf
*--------
hex 20 ;serial card slot * 16
initspd dfb 5
callspd dfb 0 ; speed of call
bytcnt dfb 0,0,0
jmp init
jmp ringset
jmp ring
jmp answerRing
jmp hangup
jmp inp
jmp out
jmp getcarr
jmp setspeed
jmp raisedtr
jmp flush ;mdmFlush
jmp shutDown ;shutdown
*-------------------------------------------------
* init the serial port pascal locations
init lda $c20d ;get init address
sta doinit+1
lda $c20e ;get read address
sta doread+1
lda $c20f ;get write address
sta dowrite+1
lda $c210 ;get status address
sta dostatus+1
lda $c212
sta doext+1
lda #<GetOutBuffer
ldx #>GetOutBuffer
ldy #0
jsr doext
lda #<GetInBuffer
ldx #>GetInBuffer
ldy #0
jsr doext
clc
xce
rep #$30
mx %00
pha
pea $1000 ;type 1, application, auxID = 0
_GetNewID
pla
sta OurID
pha
pha
pea 0
pea $4000 ;want 16k
pha ;our user id
pea $c018 ;locked, fixed, NO special memory, noCross
pea 0 ;(if we use special memory, acos gets clobbered)
pea 0 ;no fixed location
_NewHandle
bcc :good
pla
pla
lda #$eaea ;put no-ops over the input buffer change
sta patchIn ;JSR if we couldn't get any memory
sta patchIn+1
bra :done
:good pla
sta 0 ;get the handle
sta OurHandle
pla
sta 2
sta OurHandle+2
lda [0] ;deref the handle and put the address
tax
ldy #2
lda [0],y
sta In_Buf+4+2
stx In_Buf+4
lda #$4000 ;how big, 16k
sta In_Buf+8
mx %11
:done sec
xce
rts
*-------------------------------------------------
* shutDown -- reset the port buffer to its old buffer size and
* address, and kill the memory we allocated for the 16k
* buffer which we used.
*
* We do this for both the input and output buffers
shutDown
ldx #5 ;move 6 bytes
:loop lda GetOutBuffer+4,x
sta Out_Buf+4,x
dex
bpl :loop
ldx #5 ;move 6 bytes
:loop2 lda GetInBuffer+4,x
sta In_Buf+4,x
dex
bpl :loop2
lda patchIn ;did the allocate succeed?
cmp #$ea ;if this is patched out, it didn't so don't
beq :noInputBuffer ;reset the input buffer and dispose memory
lda #<In_Buf ;reset the input buffer
ldx #>In_Buf
ldy #0
jsr doext
clc
xce
rep #$30
mx %00
lda OurHandle+2
pha
lda OurHandle
pha
_DisposeHandle
mx %11
sec
xce
:noInputBuffer
lda #<Out_Buf ;reset the input buffer
ldx #>Out_Buf
ldy #0
jmp doext
*-------------------------------------------------
* input data
receive
inp phx ;save x
phy
ldx #$c2 ;are we ready?
ldy #$20
lda #1
jsr dostatus
bcc inp2 ;nope, exit
ldx #$c2 ;yes, read
ldy #$20
jsr doread
sec
ply
plx ;restore & return
rts
inp2 lda #0
clc
ply
plx ;restore & return
rts
*-------------------------------------------------
* Check for carrier using Get_Port_Stat routine
getcarr phx
phy
lda #Carrlist
ldx #>Carrlist
ldy #0
jsr doext
lda carrbits
and cdbyte
beq inp2 ;do a dirty and use common exit routines
sec
ply
plx ;restore & return
rts
*-------------------------------------------------
* raise dtr
raisedtr lda #0
phx
phy
jsr gsdtr
ply
plx ;restore & return
rts
*-------------------------------------------------
* output data
send
out phx ;save x
phy ;save y
pha ;save a
out1 ldx #$c2 ;ready for send?
ldy #$20
lda #$00
jsr dostatus
bcc out1 ;nope
pla ;get a
ldx #$c2
ldy #$20
jsr dowrite ;send it
ply
plx ;restore & return
rts
*-------------------------------------------------
* setup for call
ringset jsr hangup
lda #0 ;let modem reset
jsr wait
jsr wait
lda #$00
jsr gsdtr
ldy initspd ;set init speed
jsr setspeed
lda #0 ;slight delay (let modem do init)
jsr wait
ldx #$FF
rset2 inx ;do pre-inc
lda initstr,x ;get modem init string
beq rset3 ;we are done
jsr out ;output
bra rset2 ;loop (Z-bit set after wait)
rset3 ldx #6
stx count
rset4 ldy #$FF
rset5 dey
beq decount
jsr inp
bcc rset5
and #$7f
cmp #'0' ;check for "0" result
beq leave
jmp rset5
decount dex
bne rset4
dec count
bne rset4
jmp ringset
leave jsr inp ;grab the <cr> off the tail end of the "0"
bcc leave
jsr flush
lda #0
sta bytcnt ;reset byte counter
sta bytcnt+1
sta bytcnt+2
clc
rts ;return
*-------------------------------
* test for a ring and handle it
ring jsr inp ;check for a char
bcc noRing ;nope...
and #$7f ;strip high
cmp #'2' ;is it a 'ring'? (numeric)
bne notRing ;nope, check for connect messages
********************************
grabCR jsr inp ;grab the <cr> off the tail end of the "2"
bcc grabCR
answerRing jsr answer ;the phone rang, so send 'ATA'
noRing clc
rts
********************************
notRing
cmp #'1' ;is it a '1' or '10' or '11' or '12' or '14'?
beq gotCode ;yes, save it
cmp #'5' ;is it connect 1200?
bne noRing ;nope
gotCode sta code
secondChar jsr inp ;second character will ALWAYS be there
bcc secondChar
and #$7f ;strip high
cmp #cr ;but might be a <cr>
bne multiCode
********************************
singleCode ldy #0 ;connect 300?
lda code
cmp #'1'
beq ring3
iny
cmp #'5' ;connect 1200?
beq ring3 ;nope, unknown code, keep checking
jmp noRing
********************************
multiCode
sta code+1
lda code ;get the first code char
cmp #'1' ;must be a one
bne noRing ;if not, then keep trying
ldx #rCodesEnd-rCodes-1
lda code+1
:loop cmp rCodes,x
beq :bingo
dex
bpl :loop
jmp noRing
:bingo lda sCodes,x
tay
ring3 jsr setspeed ;set the correct speed
ldy #5
ring4 lda #0 ;let carrier's settle
jsr wait
dey
bne ring4
jsr flush ;remove any garbage
sec ;we have a connection!
rts
*-------------------------------
* clear the input buffer
flush
phx
phy
lda #Flush_List
ldx #>Flush_List
ldy #0
jsr doext
ply
plx
rts
*-------------------------------------------------
* set DTR on GS Serial Port, and hangup if needed
hangup lda #$80 ;blow 'em off (hangup)
gsdtr sta DTRstate
lda #DTR_List
ldx #>DTR_List
ldy #0
jmp doext
*-------------------------------------------------
* wait routine
wait sec ;from apple ][+ ref man - pg 147
wait2 pha
wait3 sbc #1
bne wait3
pla
sbc #1
bne wait2
rts
*-------------------------------------------------
* send ata to phone
answer lda #$80
jsr wait
ldx #$ff
answer2 inx
lda ansstr,x ;get text
beq answer3 ;we are done
jsr out ;send it
bra answer2
answer3 rts
*-------------------------------------------------
* set the rs-232 speed, speed offset in Y
*
* 0 = 300 baud
* 1 = 1200 baud
* 2 = 2400 baud
* 3 = 4800 baud
* 4 = 9600 baud
* 5 = 19200 baud
*-------------------------------------------------
setspeed phx
phy
lda #1 ;find caller speed (x300)
sta callspd
cpy #0 ;at 300?
beq Do_Baud ;yep
asl callspd ;speed = speed * 2
setspeed2 asl callspd ;speed = speed * 2
dey
bne setspeed2 ;loop until correct speed found
Do_Baud pla ;get y-reg
asl a
tay
lda baudAddresses,y
sta Baudread+1
lda baudAddresses+1,y
sta Baudread+2
SetBaud ldx #$c2
ldy #$20
jsr doinit
lda #$01 ;firmware attention character
jsr out
ldx #0
Baudread lda $ffff,x
pha
jsr out
pla
cmp #'B' ;finish -after- we get a 'B'
beq Fin_Init
inx
bra Baudread
Fin_Init ldx #0
Init_Loop lda Port_Init,x
beq doneBaud
jsr out
inx
bra Init_Loop
doneBaud
ldx #5
:loop lda OutDefaults,x
sta Out_Buf+4,x
dex
bpl :loop
lda #<Out_Buf
ldx #>Out_Buf
ldy #0
jsr doext
patchIn jsr inbuff ;set the input buffer, can be self-modified
plx
rts
********************************
baudAddresses
da Baud300
da Baud1200
da Baud2400
da Baud4800
da Baud9600
da Baud19200
inbuff
lda #<In_Buf ;reset the input buffer
ldx #>In_Buf
ldy #0
jmp doext
*-------------------------------------------------
* globals
doinit jmp $c200
doread jmp $c200
dowrite jmp $c200
dostatus jmp $c200
doext jmp $c200
rCodes asc '0' ;2400
asc '1' ;4800
asc '2' ;9600
asc '4' ;19200
asc '5' ;1200/ARQ
asc '6' ;2400/ARQ
asc '7' ;9600/ARQ
rCodesEnd
sCodes dfb 2 ;2400
dfb 3 ;4800
dfb 4 ;9600
dfb 5 ;19200
dfb 1 ;1200/ARQ
dfb 2 ;2400/ARQ
dfb 4 ;9600/ARQ
OurID ds 2
OurHandle ds 4
count db 0
code ds 2 ;2 byte code returned by modem
Baud300 asc '6B'
Baud1200 asc '8B'
Baud2400 asc '10B'
Baud4800 asc '12B'
Baud9600 asc '14B'
Baud19200 asc '15B'
Port_Init
hex 01
asc '0D' ;8 bits
hex 01
asc '2P' ;no parity
hex 01
asc 'AD' ;auto-tabbing
hex 01
asc 'XD' ;no xoff recognition
hex 01
asc 'FD' ;no find keyboard
hex 01
asc 'CD' ;no column overflow
hex 01
asc 'ED' ;echo disabled
hex 01
asc 'MD' ;no lf masking
hex 01
asc 'BE' ;buffering enabled
hex 01
asc 'Z'
hex 00
*-------------------------------------------------
* These get copied to Out_Buf
OutDefaults
adrl buffer
dw 3
*-------------------------------------------------
GetOutBuffer
hex 04
hex 11
dw 0 ;result
ds 4 ;address
dw 0 ;length
*-------------------------------------------------
Out_Buf hex 04 ;Parameters to set the
hex 13 ;Output buffer
da 0
adrl buffer ;Buffer it where
dw 3 ;buffer 3 bytes
*-------------------------------------------------
GetInBuffer
hex 04
hex 10
dw 0 ;result
ds 4 ;address
dw 0 ;length
*-------------------------------------------------
In_Buf hex 04 ;Parameters to set the
hex 12 ;Output buffer
da 0
adrl buffer ;Buffer it where (modified later)
dw $4000 ;buffer 16k
*-------------------------------------------------
Carrlist hex 03 ;Parameter list for
hex 06 ;detecting carrier drop
da 0
carrbits da 0 ;Carrier
*-------------------------------------------------
DTR_List hex 03 ;Parameter list for
hex 0b ;setting DTR
da 0
DTRstate da 0 ;bit
*-------------------------------------------------
Flush_List hex 02 ;parameter list for flushing input queue
hex 14
da 0
buffer ds 3

View File

@ -0,0 +1,829 @@
------+-----------------------+-------------+----+---------+------+-----------------------+-------------------------------------------------------------------
Line | # File Line | Line Type | MX | Reloc | Size | Address Object Code | Source Code
------+-----------------------+-------------+----+---------+------+-----------------------+-------------------------------------------------------------------
1 | 1 quicktest.s 1 | Comment | 11 | | 0 | 00/8000 | *
2 | 1 quicktest.s 2 | Comment | 11 | | 0 | 00/8000 | * QuickTake Protocol Test
3 | 1 quicktest.s 3 | Comment | 11 | | 0 | 00/8000 | *
4 | 1 quicktest.s 4 | Empty | 11 | | 0 | 00/8000 |
5 | 1 quicktest.s 5 | Directive | 00 | | 0 | 00/8000 | mx %00
6 | 1 quicktest.s 6 | Directive | 00 | | 0 | 00/8000 | org $1000
7 | 1 quicktest.s 7 | Directive | 00 | | 0 | 00/1000 | lst off
8 | 1 quicktest.s 8 | Empty | 00 | | 0 | 00/1000 |
9 | 1 quicktest.s 9 | Comment | 00 | | 0 | 00/1000 | *-------------------------------------------------
10 | 1 quicktest.s 10 | Empty | 00 | | 0 | 00/1000 |
11 | 1 quicktest.s 11 | Directive | 00 | | 0 | 00/1000 | use 4/Mem.Macs
12 | 1 quicktest.s 12 | Directive | 00 | | 0 | 00/1000 | use 4/Misc.Macs
13 | 1 quicktest.s 13 | Directive | 00 | | 0 | 00/1000 | use 4/Util.Macs
14 | 1 quicktest.s 14 | Empty | 00 | | 0 | 00/1000 |
15 | 1 quicktest.s 15 | Comment | 00 | | 0 | 00/1000 | *-------------------------------------------------
16 | 1 quicktest.s 16 | Empty | 00 | | 0 | 00/1000 |
17 | 1 quicktest.s 17 | Code | 00 | | 1 | 00/1000 : 18 | clc
18 | 1 quicktest.s 18 | Code | 00 | | 1 | 00/1001 : FB | xce
19 | 1 quicktest.s 19 | Code | 00 | | 2 | 00/1002 : C2 30 | rep #$30
20 | 1 quicktest.s 20 | Empty | 00 | | 0 | 00/1004 |
21 | 1 quicktest.s 21 | Code | 00 | | 3 | 00/1004 : A9 00 00 | lda #0
22 | 1 quicktest.s 22 | Code | 00 | | 1 | 00/1007 : AA | tax
23 | 1 quicktest.s 23 | Code | 00 | | 1 | 00/1008 : A8 | tay
24 | 1 quicktest.s 24 | Code | 11 | | 2 | 00/1009 : E2 30 | sep #$30
25 | 1 quicktest.s 25 | Empty | 11 | | 0 | 00/100B |
26 | 1 quicktest.s 26 | Code | 11 | | 3 | 00/100B : 20 22 10 | jsr call0 ; init all
27 | 1 quicktest.s 27 | Empty | 11 | | 0 | 00/100E |
28 | 1 quicktest.s 28 | Code | 11 | | 3 | 00/100E : 2C 32 10 | bit call1 ; say hello
29 | 1 quicktest.s 29 | Code | 11 | | 3 | 00/1011 : 2C 78 10 | bit call2 ; turn even parity on before calling
30 | 1 quicktest.s 30 | Code | 11 | | 3 | 00/1014 : 2C 93 10 | bit call3 ; get information
31 | 1 quicktest.s 31 | Empty | 11 | | 0 | 00/1017 |
32 | 1 quicktest.s 32 | Code | 11 | | 3 | 00/1017 : 2C 39 11 | bit call4 ; à la manière de dandumontp
33 | 1 quicktest.s 33 | Code | 11 | | 3 | 00/101A : 2C FC 11 | bit shutDown
34 | 1 quicktest.s 34 | Empty | 11 | | 0 | 00/101D |
35 | 1 quicktest.s 35 | Code | 11 | | 1 | 00/101D : 38 | sec
36 | 1 quicktest.s 36 | Code | 11 | | 1 | 00/101E : FB | xce
37 | 1 quicktest.s 37 | Code | 11 | | 2 | 00/101F : E2 20 | sep #$20
38 | 1 quicktest.s 38 | Code | 11 | | 1 | 00/1021 : 60 | rts
39 | 1 quicktest.s 39 | Empty | 11 | | 0 | 00/1022 |
40 | 1 quicktest.s 40 | Comment | 11 | | 0 | 00/1022 | *----------- Init me
41 | 1 quicktest.s 41 | Empty | 11 | | 0 | 00/1022 |
42 | 1 quicktest.s 42 | Code | 11 | | 3 | 00/1022 : 20 6E 11 | call0 jsr init
43 | 1 quicktest.s 43 | Code | 11 | | 3 | 00/1025 : 20 75 12 | jsr raisedtr
44 | 1 quicktest.s 44 | Empty | 11 | | 0 | 00/1028 |
45 | 1 quicktest.s 45 | Code | 11 | | 2 | 00/1028 : A0 04 | ldy #4
46 | 1 quicktest.s 46 | Code | 11 | | 3 | 00/102A : 20 9F 13 | jsr setspeed
47 | 1 quicktest.s 47 | Empty | 11 | | 0 | 00/102D |
48 | 1 quicktest.s 48 | Code | 11 | | 2 | 00/102D : A9 00 | lda #0
49 | 1 quicktest.s 49 | Code | 11 | | 3 | 00/102F : 4C 80 13 | jmp wait
50 | 1 quicktest.s 50 | Empty | 11 | | 0 | 00/1032 |
51 | 1 quicktest.s 51 | Comment | 11 | | 0 | 00/1032 | *----------- Say hello
52 | 1 quicktest.s 52 | Empty | 11 | | 0 | 00/1032 |
53 | 1 quicktest.s 53 | Code | 11 | | 2 | 00/1032 : A2 00 | call1 ldx #0
54 | 1 quicktest.s 54 | Code | 11 | | 3 | 00/1034 : 20 40 12 | ozunid_4 jsr receive
55 | 1 quicktest.s 55 | Code | 11 | | 3 | 00/1037 : 9D 5A 10 | sta response1,x
56 | 1 quicktest.s 56 | Code | 11 | | 1 | 00/103A : E8 | inx
57 | 1 quicktest.s 57 | Code | 11 | | 2 | 00/103B : E0 07 | cpx #response1end-response1
58 | 1 quicktest.s 58 | Code | 11 | | 2 | 00/103D : D0 F5 | bne ozunid_4
59 | 1 quicktest.s 59 | Empty | 11 | | 0 | 00/103F |
60 | 1 quicktest.s 60 | Code | 11 | | 2 | 00/103F : A2 00 | ldx #0
61 | 1 quicktest.s 61 | Code | 11 | | 3 | 00/1041 : BD 61 10 | ozunid_5 lda answer1,x
62 | 1 quicktest.s 62 | Code | 11 | | 3 | 00/1044 : 20 7F 12 | jsr send
63 | 1 quicktest.s 63 | Code | 11 | | 1 | 00/1047 : E8 | inx
64 | 1 quicktest.s 64 | Code | 11 | | 2 | 00/1048 : E0 0D | cpx #answer1end-answer1
65 | 1 quicktest.s 65 | Code | 11 | | 2 | 00/104A : D0 F5 | bne ozunid_5
66 | 1 quicktest.s 66 | Empty | 11 | | 0 | 00/104C |
67 | 1 quicktest.s 67 | Code | 11 | | 2 | 00/104C : A2 00 | ldx #0
68 | 1 quicktest.s 68 | Code | 11 | | 3 | 00/104E : 20 40 12 | ozunid_6 jsr receive
69 | 1 quicktest.s 69 | Code | 11 | | 3 | 00/1051 : 9D 6E 10 | sta response2,x
70 | 1 quicktest.s 70 | Code | 11 | | 1 | 00/1054 : E8 | inx
71 | 1 quicktest.s 71 | Code | 11 | | 2 | 00/1055 : E0 0A | cpx #response2end-response2
72 | 1 quicktest.s 72 | Code | 11 | | 2 | 00/1057 : D0 F5 | bne ozunid_6
73 | 1 quicktest.s 73 | Code | 11 | | 1 | 00/1059 : 60 | rts
74 | 1 quicktest.s 74 | Empty | 11 | | 0 | 00/105A |
75 | 1 quicktest.s 75 | Comment | 11 | | 0 | 00/105A | *---
76 | 1 quicktest.s 76 | Empty | 11 | | 0 | 00/105A |
77 | 1 quicktest.s 77 | Data | 11 | | 7 | 00/105A : 00 00 00 00 | response1 ds 7
| | | | | | 00 00 00 |
78 | 1 quicktest.s 78 | Empty | 11 | | 0 | 00/1061 | response1end
79 | 1 quicktest.s 79 | Empty | 11 | | 0 | 00/1061 |
80 | 1 quicktest.s 80 | Data | 11 | | 13 | 00/1061 : 5A A5 55 05 | answer1 hex 5A,A5,55,05,00,00,25,80,00,80,02,00,80
| | | | | | 00 00 25 80 |
| | | | | | 00 80 02 00 |
| | | | | | 80 |
81 | 1 quicktest.s 81 | Empty | 11 | | 0 | 00/106E | answer1end
82 | 1 quicktest.s 82 | Empty | 11 | | 0 | 00/106E |
83 | 1 quicktest.s 83 | Data | 11 | | 10 | 00/106E : 00 00 00 00 | response2 ds 10
| | | | | | 00 00 00 00 |
| | | | | | 00 00 |
84 | 1 quicktest.s 84 | Empty | 11 | | 0 | 00/1078 | response2end
85 | 1 quicktest.s 85 | Empty | 11 | | 0 | 00/1078 |
86 | 1 quicktest.s 86 | Comment | 11 | | 0 | 00/1078 | *----------- Separator (change parity in the control panel before call)
87 | 1 quicktest.s 87 | Empty | 11 | | 0 | 00/1078 |
88 | 1 quicktest.s 88 | Code | 11 | | 2 | 00/1078 : A2 00 | call2 ldx #0
89 | 1 quicktest.s 89 | Code | 11 | | 3 | 00/107A : BD 8C 10 | ozunid_7 lda str3,x
90 | 1 quicktest.s 90 | Code | 11 | | 3 | 00/107D : 20 7F 12 | jsr send
91 | 1 quicktest.s 91 | Code | 11 | | 1 | 00/1080 : E8 | inx
92 | 1 quicktest.s 92 | Code | 11 | | 2 | 00/1081 : E0 07 | cpx #str3end-str3
93 | 1 quicktest.s 93 | Code | 11 | | 2 | 00/1083 : D0 F5 | bne ozunid_7
94 | 1 quicktest.s 94 | Empty | 11 | | 0 | 00/1085 |
95 | 1 quicktest.s 95 | Code | 11 | | 3 | 00/1085 : 20 40 12 | jsr receive
96 | 1 quicktest.s 96 | Code | 11 | | 3 | 00/1088 : 20 DA FD | jsr $fdda
97 | 1 quicktest.s 97 | Code | 11 | | 1 | 00/108B : 60 | rts
98 | 1 quicktest.s 98 | Empty | 11 | | 0 | 00/108C |
99 | 1 quicktest.s 99 | Comment | 11 | | 0 | 00/108C | *---
100 | 1 quicktest.s 100 | Empty | 11 | | 0 | 00/108C |
101 | 1 quicktest.s 101 | Data | 11 | | 7 | 00/108C : 16 00 00 00 | str3 hex 16,00,00,00,00,00,00
| | | | | | 00 00 00 |
102 | 1 quicktest.s 102 | Empty | 11 | | 0 | 00/1093 | str3end
103 | 1 quicktest.s 103 | Empty | 11 | | 0 | 00/1093 |
104 | 1 quicktest.s 104 | Comment | 11 | | 0 | 00/1093 | *----------- Get camera information
105 | 1 quicktest.s 105 | Empty | 11 | | 0 | 00/1093 |
106 | 1 quicktest.s 106 | Code | 11 | | 2 | 00/1093 : A2 00 | call3 ldx #0
107 | 1 quicktest.s 107 | Code | 11 | | 3 | 00/1095 : BD AE 10 | ozunid_8 lda str4,x
108 | 1 quicktest.s 108 | Code | 11 | | 3 | 00/1098 : 20 7F 12 | jsr send
109 | 1 quicktest.s 109 | Code | 11 | | 1 | 00/109B : E8 | inx
110 | 1 quicktest.s 110 | Code | 11 | | 2 | 00/109C : E0 0B | cpx #str4end-str4
111 | 1 quicktest.s 111 | Code | 11 | | 2 | 00/109E : D0 F5 | bne ozunid_8
112 | 1 quicktest.s 112 | Empty | 11 | | 0 | 00/10A0 |
113 | 1 quicktest.s 113 | Code | 11 | | 2 | 00/10A0 : A2 00 | ldx #0
114 | 1 quicktest.s 114 | Code | 11 | | 3 | 00/10A2 : 20 40 12 | ozunid_9 jsr receive
115 | 1 quicktest.s 115 | Code | 11 | | 3 | 00/10A5 : 9D B9 10 | sta response3,x
116 | 1 quicktest.s 116 | Code | 11 | | 1 | 00/10A8 : E8 | inx
117 | 1 quicktest.s 117 | Code | 11 | | 2 | 00/10A9 : E0 80 | cpx #response3end-response3
118 | 1 quicktest.s 118 | Code | 11 | | 2 | 00/10AB : D0 F5 | bne ozunid_9
119 | 1 quicktest.s 119 | Code | 11 | | 1 | 00/10AD : 60 | rts
120 | 1 quicktest.s 120 | Empty | 11 | | 0 | 00/10AE |
121 | 1 quicktest.s 121 | Comment | 11 | | 0 | 00/10AE | *---
122 | 1 quicktest.s 122 | Empty | 11 | | 0 | 00/10AE |
123 | 1 quicktest.s 123 | Data | 11 | | 11 | 00/10AE : 16 28 00 30 | str4 hex 16,28,00,30,00,00,00,00,00,80,00
| | | | | | 00 00 00 00 |
| | | | | | 00 80 00 |
124 | 1 quicktest.s 124 | Empty | 11 | | 0 | 00/10B9 | str4end
125 | 1 quicktest.s 125 | Empty | 11 | | 0 | 00/10B9 |
126 | 1 quicktest.s 126 | Data | 11 | | 128 | 00/10B9 : 00 00 00 00 | response3 ds 128
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
| | | | | | 00 00 00 00 |
127 | 1 quicktest.s 127 | Empty | 11 | | 0 | 00/1139 | response3end
128 | 1 quicktest.s 128 | Empty | 11 | | 0 | 00/1139 |
129 | 1 quicktest.s 129 | Comment | 11 | | 0 | 00/1139 | *----------- A la manière de dandumontp (parité paire)
130 | 1 quicktest.s 130 | Empty | 11 | | 0 | 00/1139 |
131 | 1 quicktest.s 131 | Code | 11 | | 2 | 00/1139 : A9 05 | call4 lda #5
132 | 1 quicktest.s 132 | Code | 11 | | 3 | 00/113B : 20 7F 12 | jsr send
133 | 1 quicktest.s 133 | Empty | 11 | | 0 | 00/113E |
134 | 1 quicktest.s 134 | Code | 11 | | 3 | 00/113E : 20 40 12 | jsr receive
135 | 1 quicktest.s 135 | Code | 11 | | 3 | 00/1141 : 4C DA FD | jmp $fdda
136 | 1 quicktest.s 136 | Empty | 11 | | 0 | 00/1144 |
137 | 1 quicktest.s 137 | Comment | 11 | | 0 | 00/1144 | *-------------------------------------------------
138 | 1 quicktest.s 138 | Comment | 11 | | 0 | 00/1144 | * GS Port Driver Bios -- Slot #2
139 | 1 quicktest.s 139 | Comment | 11 | | 0 | 00/1144 | *
140 | 1 quicktest.s 140 | Comment | 11 | | 0 | 00/1144 | * written by Andy Nicholas on July 26, 1987
141 | 1 quicktest.s 141 | Comment | 11 | | 0 | 00/1144 | *
142 | 1 quicktest.s 142 | Comment | 11 | | 0 | 00/1144 | * History:
143 | 1 quicktest.s 143 | Comment | 11 | | 0 | 00/1144 | *
144 | 1 quicktest.s 144 | Comment | 11 | | 0 | 00/1144 | * Modified to use an 16k buffer May, 1991 by andy
145 | 1 quicktest.s 145 | Comment | 11 | | 0 | 00/1144 | *-------------------------------------------------
146 | 1 quicktest.s 146 | Empty | 11 | | 0 | 00/1144 |
147 | 1 quicktest.s 147 | Equivalence | 11 | | 0 | 00/1144 | cr equ $0d
148 | 1 quicktest.s 148 | Equivalence | 11 | | 0 | 00/1144 | lf equ $0a
149 | 1 quicktest.s 149 | Empty | 11 | | 0 | 00/1144 |
150 | 1 quicktest.s 150 | Equivalence | 11 | | 0 | 00/1144 | initstr equ $11d0
151 | 1 quicktest.s 151 | Equivalence | 11 | | 0 | 00/1144 | ansstr equ $11c0
152 | 1 quicktest.s 152 | Equivalence | 11 | | 0 | 00/1144 | cdbyte equ $11bf
153 | 1 quicktest.s 153 | Empty | 11 | | 0 | 00/1144 |
154 | 1 quicktest.s 154 | Comment | 11 | | 0 | 00/1144 | *--------
155 | 1 quicktest.s 155 | Empty | 11 | | 0 | 00/1144 |
156 | 1 quicktest.s 156 | Data | 11 | | 1 | 00/1144 : 20 | hex 20 ;serial card slot * 16
157 | 1 quicktest.s 157 | Data | 11 | | 1 | 00/1145 : 05 | initspd dfb 5
158 | 1 quicktest.s 158 | Data | 11 | | 1 | 00/1146 : 00 | callspd dfb 0 ; speed of call
159 | 1 quicktest.s 159 | Empty | 11 | | 0 | 00/1147 |
160 | 1 quicktest.s 160 | Data | 11 | | 3 | 00/1147 : 00 00 00 | bytcnt dfb 0,0,0
161 | 1 quicktest.s 161 | Empty | 11 | | 0 | 00/114A |
162 | 1 quicktest.s 162 | Code | 11 | | 3 | 00/114A : 4C 6E 11 | jmp init
163 | 1 quicktest.s 163 | Code | 11 | | 3 | 00/114D : 4C 98 12 | jmp ringset
164 | 1 quicktest.s 164 | Code | 11 | | 3 | 00/1150 : 4C F8 12 | jmp ring
165 | 1 quicktest.s 165 | Code | 11 | | 3 | 00/1153 : 4C 08 13 | jmp answerRing
166 | 1 quicktest.s 166 | Code | 11 | | 3 | 00/1156 : 4C 72 13 | jmp hangup
167 | 1 quicktest.s 167 | Code | 11 | | 3 | 00/1159 : 4C 40 12 | jmp inp
168 | 1 quicktest.s 168 | Code | 11 | | 3 | 00/115C : 4C 7F 12 | jmp out
169 | 1 quicktest.s 169 | Code | 11 | | 3 | 00/115F : 4C 5E 12 | jmp getcarr
170 | 1 quicktest.s 170 | Code | 11 | | 3 | 00/1162 : 4C 9F 13 | jmp setspeed
171 | 1 quicktest.s 171 | Code | 11 | | 3 | 00/1165 : 4C 75 12 | jmp raisedtr
172 | 1 quicktest.s 172 | Code | 11 | | 3 | 00/1168 : 4C 64 13 | jmp flush ;mdmFlush
173 | 1 quicktest.s 173 | Code | 11 | | 3 | 00/116B : 4C FC 11 | jmp shutDown ;shutdown
174 | 1 quicktest.s 174 | Empty | 11 | | 0 | 00/116E |
175 | 1 quicktest.s 175 | Comment | 11 | | 0 | 00/116E | *-------------------------------------------------
176 | 1 quicktest.s 176 | Comment | 11 | | 0 | 00/116E | * init the serial port pascal locations
177 | 1 quicktest.s 177 | Empty | 11 | | 0 | 00/116E |
178 | 1 quicktest.s 178 | Code | 11 | | 3 | 00/116E : AD 0D C2 | init lda $c20d ;get init address
179 | 1 quicktest.s 179 | Code | 11 | | 3 | 00/1171 : 8D 1B 14 | sta doinit+1
180 | 1 quicktest.s 180 | Code | 11 | | 3 | 00/1174 : AD 0E C2 | lda $c20e ;get read address
181 | 1 quicktest.s 181 | Code | 11 | | 3 | 00/1177 : 8D 1E 14 | sta doread+1
182 | 1 quicktest.s 182 | Code | 11 | | 3 | 00/117A : AD 0F C2 | lda $c20f ;get write address
183 | 1 quicktest.s 183 | Code | 11 | | 3 | 00/117D : 8D 21 14 | sta dowrite+1
184 | 1 quicktest.s 184 | Code | 11 | | 3 | 00/1180 : AD 10 C2 | lda $c210 ;get status address
185 | 1 quicktest.s 185 | Code | 11 | | 3 | 00/1183 : 8D 24 14 | sta dostatus+1
186 | 1 quicktest.s 186 | Code | 11 | | 3 | 00/1186 : AD 12 C2 | lda $c212
187 | 1 quicktest.s 187 | Code | 11 | | 3 | 00/1189 : 8D 27 14 | sta doext+1
188 | 1 quicktest.s 188 | Empty | 11 | | 0 | 00/118C |
189 | 1 quicktest.s 189 | Code | 11 | | 2 | 00/118C : A9 74 | lda #<GetOutBuffer
190 | 1 quicktest.s 190 | Code | 11 | | 2 | 00/118E : A2 14 | ldx #>GetOutBuffer
191 | 1 quicktest.s 191 | Code | 11 | | 2 | 00/1190 : A0 00 | ldy #0
192 | 1 quicktest.s 192 | Code | 11 | | 3 | 00/1192 : 20 26 14 | jsr doext
193 | 1 quicktest.s 193 | Empty | 11 | | 0 | 00/1195 |
194 | 1 quicktest.s 194 | Code | 11 | | 2 | 00/1195 : A9 88 | lda #<GetInBuffer
195 | 1 quicktest.s 195 | Code | 11 | | 2 | 00/1197 : A2 14 | ldx #>GetInBuffer
196 | 1 quicktest.s 196 | Code | 11 | | 2 | 00/1199 : A0 00 | ldy #0
197 | 1 quicktest.s 197 | Code | 11 | | 3 | 00/119B : 20 26 14 | jsr doext
198 | 1 quicktest.s 198 | Empty | 11 | | 0 | 00/119E |
199 | 1 quicktest.s 199 | Code | 11 | | 1 | 00/119E : 18 | clc
200 | 1 quicktest.s 200 | Code | 11 | | 1 | 00/119F : FB | xce
201 | 1 quicktest.s 201 | Code | 00 | | 2 | 00/11A0 : C2 30 | rep #$30
202 | 1 quicktest.s 202 | Directive | 00 | | 0 | 00/11A2 | mx %00
203 | 1 quicktest.s 203 | Empty | 00 | | 0 | 00/11A2 |
204 | 1 quicktest.s 204 | Code | 00 | | 1 | 00/11A2 : 48 | pha
205 | 1 quicktest.s 205 | Code | 00 | | 3 | 00/11A3 : F4 00 10 | pea $1000 ;type 1, application, auxID = 0
206 | 1 quicktest.s 206 | Macro | 00 | | 0 | 00/11A6 | _GetNewID
208 | 1 quicktest.s 206 | Code | 00 | | 3 | 00/11A6 : A2 03 20 | LDX #$2003 ; load tool call #
209 | 1 quicktest.s 206 | Code | 00 | | 4 | 00/11A9 : 22 00 00 E1 | JSL $E10000 ; go to dispatcher
210 | 1 quicktest.s 207 | Code | 00 | | 1 | 00/11AD : 68 | pla
211 | 1 quicktest.s 208 | Code | 00 | | 3 | 00/11AE : 8D 37 14 | sta OurID
212 | 1 quicktest.s 209 | Empty | 00 | | 0 | 00/11B1 |
213 | 1 quicktest.s 210 | Code | 00 | | 1 | 00/11B1 : 48 | pha
214 | 1 quicktest.s 211 | Code | 00 | | 1 | 00/11B2 : 48 | pha
215 | 1 quicktest.s 212 | Code | 00 | | 3 | 00/11B3 : F4 00 00 | pea 0
216 | 1 quicktest.s 213 | Code | 00 | | 3 | 00/11B6 : F4 00 40 | pea $4000 ;want 16k
217 | 1 quicktest.s 214 | Code | 00 | | 1 | 00/11B9 : 48 | pha ;our user id
218 | 1 quicktest.s 215 | Code | 00 | | 3 | 00/11BA : F4 18 C0 | pea $c018 ;locked, fixed, NO special memory, noCross
219 | 1 quicktest.s 216 | Code | 00 | | 3 | 00/11BD : F4 00 00 | pea 0 ;(if we use special memory, acos gets clobbered)
220 | 1 quicktest.s 217 | Code | 00 | | 3 | 00/11C0 : F4 00 00 | pea 0 ;no fixed location
221 | 1 quicktest.s 218 | Macro | 00 | | 0 | 00/11C3 | _NewHandle
223 | 1 quicktest.s 218 | Code | 00 | | 3 | 00/11C3 : A2 02 09 | LDX #$902 ; load tool call #
224 | 1 quicktest.s 218 | Code | 00 | | 4 | 00/11C6 : 22 00 00 E1 | JSL $E10000 ; go to dispatcher
225 | 1 quicktest.s 219 | Code | 00 | | 2 | 00/11CA : 90 0D | bcc _good
226 | 1 quicktest.s 220 | Empty | 00 | | 0 | 00/11CC |
227 | 1 quicktest.s 221 | Code | 00 | | 1 | 00/11CC : 68 | pla
228 | 1 quicktest.s 222 | Code | 00 | | 1 | 00/11CD : 68 | pla
229 | 1 quicktest.s 223 | Code | 00 | | 3 | 00/11CE : A9 EA EA | lda #$eaea ;put no-ops over the input buffer change
230 | 1 quicktest.s 224 | Code | 00 | | 3 | 00/11D1 : 8D 00 14 | sta patchIn ;JSR if we couldn't get any memory
231 | 1 quicktest.s 225 | Code | 00 | | 3 | 00/11D4 : 8D 01 14 | sta patchIn+1
232 | 1 quicktest.s 226 | Code | 00 | | 2 | 00/11D7 : 80 20 | bra _done
233 | 1 quicktest.s 227 | Empty | 00 | | 0 | 00/11D9 |
234 | 1 quicktest.s 228 | Code | 00 | | 1 | 00/11D9 : 68 | _good pla
235 | 1 quicktest.s 229 | Code | 00 | | 2 | 00/11DA : 85 00 | sta 0 ;get the handle
236 | 1 quicktest.s 230 | Code | 00 | | 3 | 00/11DC : 8D 39 14 | sta OurHandle
237 | 1 quicktest.s 231 | Code | 00 | | 1 | 00/11DF : 68 | pla
238 | 1 quicktest.s 232 | Code | 00 | | 2 | 00/11E0 : 85 02 | sta 2
239 | 1 quicktest.s 233 | Code | 00 | | 3 | 00/11E2 : 8D 3B 14 | sta OurHandle+2
240 | 1 quicktest.s 234 | Empty | 00 | | 0 | 00/11E5 |
241 | 1 quicktest.s 235 | Code | 00 | | 2 | 00/11E5 : A7 00 | lda [0] ;deref the handle and put the address
242 | 1 quicktest.s 236 | Code | 00 | | 1 | 00/11E7 : AA | tax
243 | 1 quicktest.s 237 | Code | 00 | | 3 | 00/11E8 : A0 02 00 | ldy #2
244 | 1 quicktest.s 238 | Code | 00 | | 2 | 00/11EB : B7 00 | lda [0],y
245 | 1 quicktest.s 239 | Code | 00 | | 3 | 00/11ED : 8D 98 14 | sta In_Buf+4+2
246 | 1 quicktest.s 240 | Code | 00 | | 3 | 00/11F0 : 8E 96 14 | stx In_Buf+4
247 | 1 quicktest.s 241 | Empty | 00 | | 0 | 00/11F3 |
248 | 1 quicktest.s 242 | Code | 00 | | 3 | 00/11F3 : A9 00 40 | lda #$4000 ;how big, 16k
249 | 1 quicktest.s 243 | Code | 00 | | 3 | 00/11F6 : 8D 9A 14 | sta In_Buf+8
250 | 1 quicktest.s 244 | Empty | 00 | | 0 | 00/11F9 |
251 | 1 quicktest.s 245 | Directive | 11 | | 0 | 00/11F9 | mx %11
252 | 1 quicktest.s 246 | Code | 11 | | 1 | 00/11F9 : 38 | _done sec
253 | 1 quicktest.s 247 | Code | 11 | | 1 | 00/11FA : FB | xce
254 | 1 quicktest.s 248 | Code | 11 | | 1 | 00/11FB : 60 | rts
255 | 1 quicktest.s 249 | Empty | 11 | | 0 | 00/11FC |
256 | 1 quicktest.s 250 | Comment | 11 | | 0 | 00/11FC | *-------------------------------------------------
257 | 1 quicktest.s 251 | Comment | 11 | | 0 | 00/11FC | * shutDown -- reset the port buffer to its old buffer size and
258 | 1 quicktest.s 252 | Comment | 11 | | 0 | 00/11FC | * address, and kill the memory we allocated for the 16k
259 | 1 quicktest.s 253 | Comment | 11 | | 0 | 00/11FC | * buffer which we used.
260 | 1 quicktest.s 254 | Comment | 11 | | 0 | 00/11FC | *
261 | 1 quicktest.s 255 | Comment | 11 | | 0 | 00/11FC | * We do this for both the input and output buffers
262 | 1 quicktest.s 256 | Empty | 11 | | 0 | 00/11FC |
263 | 1 quicktest.s 257 | Empty | 11 | | 0 | 00/11FC | shutDown
264 | 1 quicktest.s 258 | Code | 11 | | 2 | 00/11FC : A2 05 | ldx #5 ;move 6 bytes
265 | 1 quicktest.s 259 | Code | 11 | | 3 | 00/11FE : BD 78 14 | ozunid_1 lda GetOutBuffer+4,x
266 | 1 quicktest.s 260 | Code | 11 | | 3 | 00/1201 : 9D 82 14 | sta Out_Buf+4,x
267 | 1 quicktest.s 261 | Code | 11 | | 1 | 00/1204 : CA | dex
268 | 1 quicktest.s 262 | Code | 11 | | 2 | 00/1205 : 10 F7 | bpl ozunid_1
269 | 1 quicktest.s 263 | Empty | 11 | | 0 | 00/1207 |
270 | 1 quicktest.s 264 | Code | 11 | | 2 | 00/1207 : A2 05 | ldx #5 ;move 6 bytes
271 | 1 quicktest.s 265 | Code | 11 | | 3 | 00/1209 : BD 8C 14 | _loop2 lda GetInBuffer+4,x
272 | 1 quicktest.s 266 | Code | 11 | | 3 | 00/120C : 9D 96 14 | sta In_Buf+4,x
273 | 1 quicktest.s 267 | Code | 11 | | 1 | 00/120F : CA | dex
274 | 1 quicktest.s 268 | Code | 11 | | 2 | 00/1210 : 10 F7 | bpl _loop2
275 | 1 quicktest.s 269 | Empty | 11 | | 0 | 00/1212 |
276 | 1 quicktest.s 270 | Code | 11 | | 3 | 00/1212 : AD 00 14 | lda patchIn ;did the allocate succeed?
277 | 1 quicktest.s 271 | Code | 11 | | 2 | 00/1215 : C9 EA | cmp #$ea ;if this is patched out, it didn't so don't
278 | 1 quicktest.s 272 | Code | 11 | | 2 | 00/1217 : F0 1E | beq _noInputBuffer ;reset the input buffer and dispose memory
279 | 1 quicktest.s 273 | Empty | 11 | | 0 | 00/1219 |
280 | 1 quicktest.s 274 | Code | 11 | | 2 | 00/1219 : A9 92 | lda #<In_Buf ;reset the input buffer
281 | 1 quicktest.s 275 | Code | 11 | | 2 | 00/121B : A2 14 | ldx #>In_Buf
282 | 1 quicktest.s 276 | Code | 11 | | 2 | 00/121D : A0 00 | ldy #0
283 | 1 quicktest.s 277 | Code | 11 | | 3 | 00/121F : 20 26 14 | jsr doext
284 | 1 quicktest.s 278 | Empty | 11 | | 0 | 00/1222 |
285 | 1 quicktest.s 279 | Code | 11 | | 1 | 00/1222 : 18 | clc
286 | 1 quicktest.s 280 | Code | 11 | | 1 | 00/1223 : FB | xce
287 | 1 quicktest.s 281 | Code | 00 | | 2 | 00/1224 : C2 30 | rep #$30
288 | 1 quicktest.s 282 | Directive | 00 | | 0 | 00/1226 | mx %00
289 | 1 quicktest.s 283 | Empty | 00 | | 0 | 00/1226 |
290 | 1 quicktest.s 284 | Code | 00 | | 3 | 00/1226 : AD 3B 14 | lda OurHandle+2
291 | 1 quicktest.s 285 | Code | 00 | | 1 | 00/1229 : 48 | pha
292 | 1 quicktest.s 286 | Code | 00 | | 3 | 00/122A : AD 39 14 | lda OurHandle
293 | 1 quicktest.s 287 | Code | 00 | | 1 | 00/122D : 48 | pha
294 | 1 quicktest.s 288 | Macro | 00 | | 0 | 00/122E | _DisposeHandle
296 | 1 quicktest.s 288 | Code | 00 | | 3 | 00/122E : A2 02 10 | LDX #$1002 ; load tool call #
297 | 1 quicktest.s 288 | Code | 00 | | 4 | 00/1231 : 22 00 00 E1 | JSL $E10000 ; go to dispatcher
298 | 1 quicktest.s 289 | Empty | 00 | | 0 | 00/1235 |
299 | 1 quicktest.s 290 | Directive | 11 | | 0 | 00/1235 | mx %11
300 | 1 quicktest.s 291 | Code | 11 | | 1 | 00/1235 : 38 | sec
301 | 1 quicktest.s 292 | Code | 11 | | 1 | 00/1236 : FB | xce
302 | 1 quicktest.s 293 | Empty | 11 | | 0 | 00/1237 |
303 | 1 quicktest.s 294 | Empty | 11 | | 0 | 00/1237 | _noInputBuffer
304 | 1 quicktest.s 295 | Empty | 11 | | 0 | 00/1237 |
305 | 1 quicktest.s 296 | Code | 11 | | 2 | 00/1237 : A9 7E | lda #<Out_Buf ;reset the input buffer
306 | 1 quicktest.s 297 | Code | 11 | | 2 | 00/1239 : A2 14 | ldx #>Out_Buf
307 | 1 quicktest.s 298 | Code | 11 | | 2 | 00/123B : A0 00 | ldy #0
308 | 1 quicktest.s 299 | Code | 11 | | 3 | 00/123D : 4C 26 14 | jmp doext
309 | 1 quicktest.s 300 | Empty | 11 | | 0 | 00/1240 |
310 | 1 quicktest.s 301 | Comment | 11 | | 0 | 00/1240 | *-------------------------------------------------
311 | 1 quicktest.s 302 | Comment | 11 | | 0 | 00/1240 | * input data
312 | 1 quicktest.s 303 | Empty | 11 | | 0 | 00/1240 |
313 | 1 quicktest.s 304 | Empty | 11 | | 0 | 00/1240 | receive
314 | 1 quicktest.s 305 | Code | 11 | | 1 | 00/1240 : DA | inp phx ;save x
315 | 1 quicktest.s 306 | Code | 11 | | 1 | 00/1241 : 5A | phy
316 | 1 quicktest.s 307 | Code | 11 | | 2 | 00/1242 : A2 C2 | ldx #$c2 ;are we ready?
317 | 1 quicktest.s 308 | Code | 11 | | 2 | 00/1244 : A0 20 | ldy #$20
318 | 1 quicktest.s 309 | Code | 11 | | 2 | 00/1246 : A9 01 | lda #1
319 | 1 quicktest.s 310 | Code | 11 | | 3 | 00/1248 : 20 23 14 | jsr dostatus
320 | 1 quicktest.s 311 | Code | 11 | | 2 | 00/124B : 90 0B | bcc inp2 ;nope, exit
321 | 1 quicktest.s 312 | Empty | 11 | | 0 | 00/124D |
322 | 1 quicktest.s 313 | Code | 11 | | 2 | 00/124D : A2 C2 | ldx #$c2 ;yes, read
323 | 1 quicktest.s 314 | Code | 11 | | 2 | 00/124F : A0 20 | ldy #$20
324 | 1 quicktest.s 315 | Code | 11 | | 3 | 00/1251 : 20 1D 14 | jsr doread
325 | 1 quicktest.s 316 | Empty | 11 | | 0 | 00/1254 |
326 | 1 quicktest.s 317 | Code | 11 | | 1 | 00/1254 : 38 | sec
327 | 1 quicktest.s 318 | Code | 11 | | 1 | 00/1255 : 7A | ply
328 | 1 quicktest.s 319 | Code | 11 | | 1 | 00/1256 : FA | plx ;restore & return
329 | 1 quicktest.s 320 | Code | 11 | | 1 | 00/1257 : 60 | rts
330 | 1 quicktest.s 321 | Empty | 11 | | 0 | 00/1258 |
331 | 1 quicktest.s 322 | Code | 11 | | 2 | 00/1258 : A9 00 | inp2 lda #0
332 | 1 quicktest.s 323 | Code | 11 | | 1 | 00/125A : 18 | clc
333 | 1 quicktest.s 324 | Code | 11 | | 1 | 00/125B : 7A | ply
334 | 1 quicktest.s 325 | Code | 11 | | 1 | 00/125C : FA | plx ;restore & return
335 | 1 quicktest.s 326 | Code | 11 | | 1 | 00/125D : 60 | rts
336 | 1 quicktest.s 327 | Empty | 11 | | 0 | 00/125E |
337 | 1 quicktest.s 328 | Comment | 11 | | 0 | 00/125E | *-------------------------------------------------
338 | 1 quicktest.s 329 | Comment | 11 | | 0 | 00/125E | * Check for carrier using Get_Port_Stat routine
339 | 1 quicktest.s 330 | Empty | 11 | | 0 | 00/125E |
340 | 1 quicktest.s 331 | Code | 11 | | 1 | 00/125E : DA | getcarr phx
341 | 1 quicktest.s 332 | Code | 11 | | 1 | 00/125F : 5A | phy
342 | 1 quicktest.s 333 | Empty | 11 | | 0 | 00/1260 |
343 | 1 quicktest.s 334 | Code | 11 | | 2 | 00/1260 : A9 9C | lda #Carrlist
344 | 1 quicktest.s 335 | Code | 11 | | 2 | 00/1262 : A2 14 | ldx #>Carrlist
345 | 1 quicktest.s 336 | Code | 11 | | 2 | 00/1264 : A0 00 | ldy #0
346 | 1 quicktest.s 337 | Code | 11 | | 3 | 00/1266 : 20 26 14 | jsr doext
347 | 1 quicktest.s 338 | Empty | 11 | | 0 | 00/1269 |
348 | 1 quicktest.s 339 | Code | 11 | | 3 | 00/1269 : AD A0 14 | lda carrbits
349 | 1 quicktest.s 340 | Code | 11 | | 3 | 00/126C : 2D BF 11 | and {$11bf}
350 | 1 quicktest.s 341 | Code | 11 | | 2 | 00/126F : F0 E7 | beq inp2 ;do a dirty and use common exit routines
351 | 1 quicktest.s 342 | Empty | 11 | | 0 | 00/1271 |
352 | 1 quicktest.s 343 | Code | 11 | | 1 | 00/1271 : 38 | sec
353 | 1 quicktest.s 344 | Code | 11 | | 1 | 00/1272 : 7A | ply
354 | 1 quicktest.s 345 | Code | 11 | | 1 | 00/1273 : FA | plx ;restore & return
355 | 1 quicktest.s 346 | Code | 11 | | 1 | 00/1274 : 60 | rts
356 | 1 quicktest.s 347 | Empty | 11 | | 0 | 00/1275 |
357 | 1 quicktest.s 348 | Comment | 11 | | 0 | 00/1275 | *-------------------------------------------------
358 | 1 quicktest.s 349 | Comment | 11 | | 0 | 00/1275 | * raise dtr
359 | 1 quicktest.s 350 | Empty | 11 | | 0 | 00/1275 |
360 | 1 quicktest.s 351 | Code | 11 | | 2 | 00/1275 : A9 00 | raisedtr lda #0
361 | 1 quicktest.s 352 | Code | 11 | | 1 | 00/1277 : DA | phx
362 | 1 quicktest.s 353 | Code | 11 | | 1 | 00/1278 : 5A | phy
363 | 1 quicktest.s 354 | Empty | 11 | | 0 | 00/1279 |
364 | 1 quicktest.s 355 | Code | 11 | | 3 | 00/1279 : 20 74 13 | jsr gsdtr
365 | 1 quicktest.s 356 | Empty | 11 | | 0 | 00/127C |
366 | 1 quicktest.s 357 | Code | 11 | | 1 | 00/127C : 7A | ply
367 | 1 quicktest.s 358 | Code | 11 | | 1 | 00/127D : FA | plx ;restore & return
368 | 1 quicktest.s 359 | Code | 11 | | 1 | 00/127E : 60 | rts
369 | 1 quicktest.s 360 | Empty | 11 | | 0 | 00/127F |
370 | 1 quicktest.s 361 | Comment | 11 | | 0 | 00/127F | *-------------------------------------------------
371 | 1 quicktest.s 362 | Comment | 11 | | 0 | 00/127F | * output data
372 | 1 quicktest.s 363 | Empty | 11 | | 0 | 00/127F |
373 | 1 quicktest.s 364 | Empty | 11 | | 0 | 00/127F | send
374 | 1 quicktest.s 365 | Code | 11 | | 1 | 00/127F : DA | out phx ;save x
375 | 1 quicktest.s 366 | Code | 11 | | 1 | 00/1280 : 5A | phy ;save y
376 | 1 quicktest.s 367 | Code | 11 | | 1 | 00/1281 : 48 | pha ;save a
377 | 1 quicktest.s 368 | Empty | 11 | | 0 | 00/1282 |
378 | 1 quicktest.s 369 | Code | 11 | | 2 | 00/1282 : A2 C2 | out1 ldx #$c2 ;ready for send?
379 | 1 quicktest.s 370 | Code | 11 | | 2 | 00/1284 : A0 20 | ldy #$20
380 | 1 quicktest.s 371 | Code | 11 | | 2 | 00/1286 : A9 00 | lda #$00
381 | 1 quicktest.s 372 | Code | 11 | | 3 | 00/1288 : 20 23 14 | jsr dostatus
382 | 1 quicktest.s 373 | Code | 11 | | 2 | 00/128B : 90 F5 | bcc out1 ;nope
383 | 1 quicktest.s 374 | Empty | 11 | | 0 | 00/128D |
384 | 1 quicktest.s 375 | Code | 11 | | 1 | 00/128D : 68 | pla ;get a
385 | 1 quicktest.s 376 | Code | 11 | | 2 | 00/128E : A2 C2 | ldx #$c2
386 | 1 quicktest.s 377 | Code | 11 | | 2 | 00/1290 : A0 20 | ldy #$20
387 | 1 quicktest.s 378 | Code | 11 | | 3 | 00/1292 : 20 20 14 | jsr dowrite ;send it
388 | 1 quicktest.s 379 | Empty | 11 | | 0 | 00/1295 |
389 | 1 quicktest.s 380 | Code | 11 | | 1 | 00/1295 : 7A | ply
390 | 1 quicktest.s 381 | Code | 11 | | 1 | 00/1296 : FA | plx ;restore & return
391 | 1 quicktest.s 382 | Code | 11 | | 1 | 00/1297 : 60 | rts
392 | 1 quicktest.s 383 | Empty | 11 | | 0 | 00/1298 |
393 | 1 quicktest.s 384 | Comment | 11 | | 0 | 00/1298 | *-------------------------------------------------
394 | 1 quicktest.s 385 | Comment | 11 | | 0 | 00/1298 | * setup for call
395 | 1 quicktest.s 386 | Empty | 11 | | 0 | 00/1298 |
396 | 1 quicktest.s 387 | Code | 11 | | 3 | 00/1298 : 20 72 13 | ringset jsr hangup
397 | 1 quicktest.s 388 | Empty | 11 | | 0 | 00/129B |
398 | 1 quicktest.s 389 | Code | 11 | | 2 | 00/129B : A9 00 | lda #0 ;let modem reset
399 | 1 quicktest.s 390 | Code | 11 | | 3 | 00/129D : 20 80 13 | jsr wait
400 | 1 quicktest.s 391 | Code | 11 | | 3 | 00/12A0 : 20 80 13 | jsr wait
401 | 1 quicktest.s 392 | Empty | 11 | | 0 | 00/12A3 |
402 | 1 quicktest.s 393 | Code | 11 | | 2 | 00/12A3 : A9 00 | lda #$00
403 | 1 quicktest.s 394 | Code | 11 | | 3 | 00/12A5 : 20 74 13 | jsr gsdtr
404 | 1 quicktest.s 395 | Empty | 11 | | 0 | 00/12A8 |
405 | 1 quicktest.s 396 | Code | 11 | | 3 | 00/12A8 : AC 45 11 | ldy initspd ;set init speed
406 | 1 quicktest.s 397 | Code | 11 | | 3 | 00/12AB : 20 9F 13 | jsr setspeed
407 | 1 quicktest.s 398 | Empty | 11 | | 0 | 00/12AE |
408 | 1 quicktest.s 399 | Code | 11 | | 2 | 00/12AE : A9 00 | lda #0 ;slight delay (let modem do init)
409 | 1 quicktest.s 400 | Code | 11 | | 3 | 00/12B0 : 20 80 13 | jsr wait
410 | 1 quicktest.s 401 | Empty | 11 | | 0 | 00/12B3 |
411 | 1 quicktest.s 402 | Code | 11 | | 2 | 00/12B3 : A2 FF | ldx #$FF
412 | 1 quicktest.s 403 | Code | 11 | | 1 | 00/12B5 : E8 | rset2 inx ;do pre-inc
413 | 1 quicktest.s 404 | Code | 11 | | 3 | 00/12B6 : BD D0 11 | lda {$11d0},x ;get modem init string
414 | 1 quicktest.s 405 | Code | 11 | | 2 | 00/12B9 : F0 05 | beq rset3 ;we are done
415 | 1 quicktest.s 406 | Empty | 11 | | 0 | 00/12BB |
416 | 1 quicktest.s 407 | Code | 11 | | 3 | 00/12BB : 20 7F 12 | jsr out ;output
417 | 1 quicktest.s 408 | Code | 11 | | 2 | 00/12BE : 80 F5 | bra rset2 ;loop (Z-bit set after wait)
418 | 1 quicktest.s 409 | Empty | 11 | | 0 | 00/12C0 |
419 | 1 quicktest.s 410 | Code | 11 | | 2 | 00/12C0 : A2 06 | rset3 ldx #6
420 | 1 quicktest.s 411 | Code | 11 | | 3 | 00/12C2 : 8E 3D 14 | stx count
421 | 1 quicktest.s 412 | Empty | 11 | | 0 | 00/12C5 |
422 | 1 quicktest.s 413 | Code | 11 | | 2 | 00/12C5 : A0 FF | rset4 ldy #$FF
423 | 1 quicktest.s 414 | Code | 11 | | 1 | 00/12C7 : 88 | rset5 dey
424 | 1 quicktest.s 415 | Code | 11 | | 2 | 00/12C8 : F0 0E | beq decount
425 | 1 quicktest.s 416 | Empty | 11 | | 0 | 00/12CA |
426 | 1 quicktest.s 417 | Code | 11 | | 3 | 00/12CA : 20 40 12 | jsr inp
427 | 1 quicktest.s 418 | Code | 11 | | 2 | 00/12CD : 90 F8 | bcc rset5
428 | 1 quicktest.s 419 | Code | 11 | | 2 | 00/12CF : 29 7F | and #$7f
429 | 1 quicktest.s 420 | Code | 11 | | 2 | 00/12D1 : C9 30 | cmp #'0' ;check for "0" result
430 | 1 quicktest.s 421 | Code | 11 | | 2 | 00/12D3 : F0 0E | beq leave
431 | 1 quicktest.s 422 | Code | 11 | | 3 | 00/12D5 : 4C C7 12 | jmp rset5
432 | 1 quicktest.s 423 | Empty | 11 | | 0 | 00/12D8 |
433 | 1 quicktest.s 424 | Code | 11 | | 1 | 00/12D8 : CA | decount dex
434 | 1 quicktest.s 425 | Code | 11 | | 2 | 00/12D9 : D0 EA | bne rset4
435 | 1 quicktest.s 426 | Code | 11 | | 3 | 00/12DB : CE 3D 14 | dec count
436 | 1 quicktest.s 427 | Code | 11 | | 2 | 00/12DE : D0 E5 | bne rset4
437 | 1 quicktest.s 428 | Code | 11 | | 3 | 00/12E0 : 4C 98 12 | jmp ringset
438 | 1 quicktest.s 429 | Empty | 11 | | 0 | 00/12E3 |
439 | 1 quicktest.s 430 | Code | 11 | | 3 | 00/12E3 : 20 40 12 | leave jsr inp ;grab the <cr> off the tail end of the "0"
440 | 1 quicktest.s 431 | Code | 11 | | 2 | 00/12E6 : 90 FB | bcc leave
441 | 1 quicktest.s 432 | Empty | 11 | | 0 | 00/12E8 |
442 | 1 quicktest.s 433 | Code | 11 | | 3 | 00/12E8 : 20 64 13 | jsr flush
443 | 1 quicktest.s 434 | Empty | 11 | | 0 | 00/12EB |
444 | 1 quicktest.s 435 | Code | 11 | | 2 | 00/12EB : A9 00 | lda #0
445 | 1 quicktest.s 436 | Code | 11 | | 3 | 00/12ED : 8D 47 11 | sta bytcnt ;reset byte counter
446 | 1 quicktest.s 437 | Code | 11 | | 3 | 00/12F0 : 8D 48 11 | sta bytcnt+1
447 | 1 quicktest.s 438 | Code | 11 | | 3 | 00/12F3 : 8D 49 11 | sta bytcnt+2
448 | 1 quicktest.s 439 | Code | 11 | | 1 | 00/12F6 : 18 | clc
449 | 1 quicktest.s 440 | Code | 11 | | 1 | 00/12F7 : 60 | rts ;return
450 | 1 quicktest.s 441 | Empty | 11 | | 0 | 00/12F8 |
451 | 1 quicktest.s 442 | Comment | 11 | | 0 | 00/12F8 | *-------------------------------
452 | 1 quicktest.s 443 | Comment | 11 | | 0 | 00/12F8 | * test for a ring and handle it
453 | 1 quicktest.s 444 | Empty | 11 | | 0 | 00/12F8 |
454 | 1 quicktest.s 445 | Code | 11 | | 3 | 00/12F8 : 20 40 12 | ring jsr inp ;check for a char
455 | 1 quicktest.s 446 | Code | 11 | | 2 | 00/12FB : 90 0E | bcc noRing ;nope...
456 | 1 quicktest.s 447 | Empty | 11 | | 0 | 00/12FD |
457 | 1 quicktest.s 448 | Code | 11 | | 2 | 00/12FD : 29 7F | and #$7f ;strip high
458 | 1 quicktest.s 449 | Code | 11 | | 2 | 00/12FF : C9 32 | cmp #'2' ;is it a 'ring'? (numeric)
459 | 1 quicktest.s 450 | Code | 11 | | 2 | 00/1301 : D0 0A | bne notRing ;nope, check for connect messages
460 | 1 quicktest.s 451 | Empty | 11 | | 0 | 00/1303 |
461 | 1 quicktest.s 452 | Comment | 11 | | 0 | 00/1303 | ********************************
462 | 1 quicktest.s 453 | Code | 11 | | 3 | 00/1303 : 20 40 12 | grabCR jsr inp ;grab the <cr> off the tail end of the "2"
463 | 1 quicktest.s 454 | Code | 11 | | 2 | 00/1306 : 90 FB | bcc grabCR
464 | 1 quicktest.s 455 | Empty | 11 | | 0 | 00/1308 |
465 | 1 quicktest.s 456 | Code | 11 | | 3 | 00/1308 : 20 8C 13 | answerRing jsr answer ;the phone rang, so send 'ATA'
466 | 1 quicktest.s 457 | Empty | 11 | | 0 | 00/130B |
467 | 1 quicktest.s 458 | Code | 11 | | 1 | 00/130B : 18 | noRing clc
468 | 1 quicktest.s 459 | Code | 11 | | 1 | 00/130C : 60 | rts
469 | 1 quicktest.s 460 | Empty | 11 | | 0 | 00/130D |
470 | 1 quicktest.s 461 | Comment | 11 | | 0 | 00/130D | ********************************
471 | 1 quicktest.s 462 | Empty | 11 | | 0 | 00/130D | notRing
472 | 1 quicktest.s 463 | Code | 11 | | 2 | 00/130D : C9 31 | cmp #'1' ;is it a '1' or '10' or '11' or '12' or '14'?
473 | 1 quicktest.s 464 | Code | 11 | | 2 | 00/130F : F0 04 | beq gotCode ;yes, save it
474 | 1 quicktest.s 465 | Code | 11 | | 2 | 00/1311 : C9 35 | cmp #'5' ;is it connect 1200?
475 | 1 quicktest.s 466 | Code | 11 | | 2 | 00/1313 : D0 F6 | bne noRing ;nope
476 | 1 quicktest.s 467 | Empty | 11 | | 0 | 00/1315 |
477 | 1 quicktest.s 468 | Code | 11 | | 3 | 00/1315 : 8D 3E 14 | gotCode sta code
478 | 1 quicktest.s 469 | Empty | 11 | | 0 | 00/1318 |
479 | 1 quicktest.s 470 | Code | 11 | | 3 | 00/1318 : 20 40 12 | secondChar jsr inp ;second character will ALWAYS be there
480 | 1 quicktest.s 471 | Code | 11 | | 2 | 00/131B : 90 FB | bcc secondChar
481 | 1 quicktest.s 472 | Empty | 11 | | 0 | 00/131D |
482 | 1 quicktest.s 473 | Code | 11 | | 2 | 00/131D : 29 7F | and #$7f ;strip high
483 | 1 quicktest.s 474 | Code | 11 | | 2 | 00/131F : C9 0D | cmp #{$0d} ;but might be a <cr>
484 | 1 quicktest.s 475 | Code | 11 | | 2 | 00/1321 : D0 11 | bne multiCode
485 | 1 quicktest.s 476 | Empty | 11 | | 0 | 00/1323 |
486 | 1 quicktest.s 477 | Comment | 11 | | 0 | 00/1323 | ********************************
487 | 1 quicktest.s 478 | Code | 11 | | 2 | 00/1323 : A0 00 | singleCode ldy #0 ;connect 300?
488 | 1 quicktest.s 479 | Code | 11 | | 3 | 00/1325 : AD 3E 14 | lda code
489 | 1 quicktest.s 480 | Code | 11 | | 2 | 00/1328 : C9 31 | cmp #'1'
490 | 1 quicktest.s 481 | Code | 11 | | 2 | 00/132A : F0 26 | beq ring3
491 | 1 quicktest.s 482 | Empty | 11 | | 0 | 00/132C |
492 | 1 quicktest.s 483 | Code | 11 | | 1 | 00/132C : C8 | iny
493 | 1 quicktest.s 484 | Code | 11 | | 2 | 00/132D : C9 35 | cmp #'5' ;connect 1200?
494 | 1 quicktest.s 485 | Code | 11 | | 2 | 00/132F : F0 21 | beq ring3 ;nope, unknown code, keep checking
495 | 1 quicktest.s 486 | Code | 11 | | 3 | 00/1331 : 4C 0B 13 | jmp noRing
496 | 1 quicktest.s 487 | Empty | 11 | | 0 | 00/1334 |
497 | 1 quicktest.s 488 | Comment | 11 | | 0 | 00/1334 | ********************************
498 | 1 quicktest.s 489 | Empty | 11 | | 0 | 00/1334 | multiCode
499 | 1 quicktest.s 490 | Code | 11 | | 3 | 00/1334 : 8D 3F 14 | sta code+1
500 | 1 quicktest.s 491 | Empty | 11 | | 0 | 00/1337 |
501 | 1 quicktest.s 492 | Code | 11 | | 3 | 00/1337 : AD 3E 14 | lda code ;get the first code char
502 | 1 quicktest.s 493 | Code | 11 | | 2 | 00/133A : C9 31 | cmp #'1' ;must be a one
503 | 1 quicktest.s 494 | Code | 11 | | 2 | 00/133C : D0 CD | bne noRing ;if not, then keep trying
504 | 1 quicktest.s 495 | Empty | 11 | | 0 | 00/133E |
505 | 1 quicktest.s 496 | Code | 11 | | 2 | 00/133E : A2 06 | ldx #rCodesEnd-rCodes-1
506 | 1 quicktest.s 497 | Code | 11 | | 3 | 00/1340 : AD 3F 14 | lda code+1
507 | 1 quicktest.s 498 | Code | 11 | | 3 | 00/1343 : DD 29 14 | ozunid_2 cmp rCodes,x
508 | 1 quicktest.s 499 | Code | 11 | | 2 | 00/1346 : F0 06 | beq _bingo
509 | 1 quicktest.s 500 | Code | 11 | | 1 | 00/1348 : CA | dex
510 | 1 quicktest.s 501 | Code | 11 | | 2 | 00/1349 : 10 F8 | bpl ozunid_2
511 | 1 quicktest.s 502 | Code | 11 | | 3 | 00/134B : 4C 0B 13 | jmp noRing
512 | 1 quicktest.s 503 | Empty | 11 | | 0 | 00/134E |
513 | 1 quicktest.s 504 | Code | 11 | | 3 | 00/134E : BD 30 14 | _bingo lda sCodes,x
514 | 1 quicktest.s 505 | Code | 11 | | 1 | 00/1351 : A8 | tay
515 | 1 quicktest.s 506 | Code | 11 | | 3 | 00/1352 : 20 9F 13 | ring3 jsr setspeed ;set the correct speed
516 | 1 quicktest.s 507 | Empty | 11 | | 0 | 00/1355 |
517 | 1 quicktest.s 508 | Code | 11 | | 2 | 00/1355 : A0 05 | ldy #5
518 | 1 quicktest.s 509 | Code | 11 | | 2 | 00/1357 : A9 00 | ring4 lda #0 ;let carrier's settle
519 | 1 quicktest.s 510 | Code | 11 | | 3 | 00/1359 : 20 80 13 | jsr wait
520 | 1 quicktest.s 511 | Code | 11 | | 1 | 00/135C : 88 | dey
521 | 1 quicktest.s 512 | Code | 11 | | 2 | 00/135D : D0 F8 | bne ring4
522 | 1 quicktest.s 513 | Empty | 11 | | 0 | 00/135F |
523 | 1 quicktest.s 514 | Code | 11 | | 3 | 00/135F : 20 64 13 | jsr flush ;remove any garbage
524 | 1 quicktest.s 515 | Code | 11 | | 1 | 00/1362 : 38 | sec ;we have a connection!
525 | 1 quicktest.s 516 | Code | 11 | | 1 | 00/1363 : 60 | rts
526 | 1 quicktest.s 517 | Empty | 11 | | 0 | 00/1364 |
527 | 1 quicktest.s 518 | Comment | 11 | | 0 | 00/1364 | *-------------------------------
528 | 1 quicktest.s 519 | Comment | 11 | | 0 | 00/1364 | * clear the input buffer
529 | 1 quicktest.s 520 | Empty | 11 | | 0 | 00/1364 |
530 | 1 quicktest.s 521 | Empty | 11 | | 0 | 00/1364 | flush
531 | 1 quicktest.s 522 | Code | 11 | | 1 | 00/1364 : DA | phx
532 | 1 quicktest.s 523 | Code | 11 | | 1 | 00/1365 : 5A | phy
533 | 1 quicktest.s 524 | Empty | 11 | | 0 | 00/1366 |
534 | 1 quicktest.s 525 | Code | 11 | | 2 | 00/1366 : A9 A8 | lda #Flush_List
535 | 1 quicktest.s 526 | Code | 11 | | 2 | 00/1368 : A2 14 | ldx #>Flush_List
536 | 1 quicktest.s 527 | Code | 11 | | 2 | 00/136A : A0 00 | ldy #0
537 | 1 quicktest.s 528 | Code | 11 | | 3 | 00/136C : 20 26 14 | jsr doext
538 | 1 quicktest.s 529 | Empty | 11 | | 0 | 00/136F |
539 | 1 quicktest.s 530 | Code | 11 | | 1 | 00/136F : 7A | ply
540 | 1 quicktest.s 531 | Code | 11 | | 1 | 00/1370 : FA | plx
541 | 1 quicktest.s 532 | Code | 11 | | 1 | 00/1371 : 60 | rts
542 | 1 quicktest.s 533 | Empty | 11 | | 0 | 00/1372 |
543 | 1 quicktest.s 534 | Comment | 11 | | 0 | 00/1372 | *-------------------------------------------------
544 | 1 quicktest.s 535 | Comment | 11 | | 0 | 00/1372 | * set DTR on GS Serial Port, and hangup if needed
545 | 1 quicktest.s 536 | Empty | 11 | | 0 | 00/1372 |
546 | 1 quicktest.s 537 | Code | 11 | | 2 | 00/1372 : A9 80 | hangup lda #$80 ;blow 'em off (hangup)
547 | 1 quicktest.s 538 | Code | 11 | | 3 | 00/1374 : 8D A6 14 | gsdtr sta DTRstate
548 | 1 quicktest.s 539 | Empty | 11 | | 0 | 00/1377 |
549 | 1 quicktest.s 540 | Code | 11 | | 2 | 00/1377 : A9 A2 | lda #DTR_List
550 | 1 quicktest.s 541 | Code | 11 | | 2 | 00/1379 : A2 14 | ldx #>DTR_List
551 | 1 quicktest.s 542 | Code | 11 | | 2 | 00/137B : A0 00 | ldy #0
552 | 1 quicktest.s 543 | Code | 11 | | 3 | 00/137D : 4C 26 14 | jmp doext
553 | 1 quicktest.s 544 | Empty | 11 | | 0 | 00/1380 |
554 | 1 quicktest.s 545 | Comment | 11 | | 0 | 00/1380 | *-------------------------------------------------
555 | 1 quicktest.s 546 | Comment | 11 | | 0 | 00/1380 | * wait routine
556 | 1 quicktest.s 547 | Empty | 11 | | 0 | 00/1380 |
557 | 1 quicktest.s 548 | Code | 11 | | 1 | 00/1380 : 38 | wait sec ;from apple ][+ ref man - pg 147
558 | 1 quicktest.s 549 | Code | 11 | | 1 | 00/1381 : 48 | wait2 pha
559 | 1 quicktest.s 550 | Code | 11 | | 2 | 00/1382 : E9 01 | wait3 sbc #1
560 | 1 quicktest.s 551 | Code | 11 | | 2 | 00/1384 : D0 FC | bne wait3
561 | 1 quicktest.s 552 | Code | 11 | | 1 | 00/1386 : 68 | pla
562 | 1 quicktest.s 553 | Code | 11 | | 2 | 00/1387 : E9 01 | sbc #1
563 | 1 quicktest.s 554 | Code | 11 | | 2 | 00/1389 : D0 F6 | bne wait2
564 | 1 quicktest.s 555 | Code | 11 | | 1 | 00/138B : 60 | rts
565 | 1 quicktest.s 556 | Empty | 11 | | 0 | 00/138C |
566 | 1 quicktest.s 557 | Comment | 11 | | 0 | 00/138C | *-------------------------------------------------
567 | 1 quicktest.s 558 | Comment | 11 | | 0 | 00/138C | * send ata to phone
568 | 1 quicktest.s 559 | Empty | 11 | | 0 | 00/138C |
569 | 1 quicktest.s 560 | Code | 11 | | 2 | 00/138C : A9 80 | answer lda #$80
570 | 1 quicktest.s 561 | Code | 11 | | 3 | 00/138E : 20 80 13 | jsr wait
571 | 1 quicktest.s 562 | Empty | 11 | | 0 | 00/1391 |
572 | 1 quicktest.s 563 | Code | 11 | | 2 | 00/1391 : A2 FF | ldx #$ff
573 | 1 quicktest.s 564 | Code | 11 | | 1 | 00/1393 : E8 | answer2 inx
574 | 1 quicktest.s 565 | Code | 11 | | 3 | 00/1394 : BD C0 11 | lda {$11c0},x ;get text
575 | 1 quicktest.s 566 | Code | 11 | | 2 | 00/1397 : F0 05 | beq answer3 ;we are done
576 | 1 quicktest.s 567 | Empty | 11 | | 0 | 00/1399 |
577 | 1 quicktest.s 568 | Code | 11 | | 3 | 00/1399 : 20 7F 12 | jsr out ;send it
578 | 1 quicktest.s 569 | Code | 11 | | 2 | 00/139C : 80 F5 | bra answer2
579 | 1 quicktest.s 570 | Empty | 11 | | 0 | 00/139E |
580 | 1 quicktest.s 571 | Code | 11 | | 1 | 00/139E : 60 | answer3 rts
581 | 1 quicktest.s 572 | Empty | 11 | | 0 | 00/139F |
582 | 1 quicktest.s 573 | Comment | 11 | | 0 | 00/139F | *-------------------------------------------------
583 | 1 quicktest.s 574 | Comment | 11 | | 0 | 00/139F | * set the rs-232 speed, speed offset in Y
584 | 1 quicktest.s 575 | Comment | 11 | | 0 | 00/139F | *
585 | 1 quicktest.s 576 | Comment | 11 | | 0 | 00/139F | * 0 = 300 baud
586 | 1 quicktest.s 577 | Comment | 11 | | 0 | 00/139F | * 1 = 1200 baud
587 | 1 quicktest.s 578 | Comment | 11 | | 0 | 00/139F | * 2 = 2400 baud
588 | 1 quicktest.s 579 | Comment | 11 | | 0 | 00/139F | * 3 = 4800 baud
589 | 1 quicktest.s 580 | Comment | 11 | | 0 | 00/139F | * 4 = 9600 baud
590 | 1 quicktest.s 581 | Comment | 11 | | 0 | 00/139F | * 5 = 19200 baud
591 | 1 quicktest.s 582 | Comment | 11 | | 0 | 00/139F | *-------------------------------------------------
592 | 1 quicktest.s 583 | Empty | 11 | | 0 | 00/139F |
593 | 1 quicktest.s 584 | Code | 11 | | 1 | 00/139F : DA | setspeed phx
594 | 1 quicktest.s 585 | Code | 11 | | 1 | 00/13A0 : 5A | phy
595 | 1 quicktest.s 586 | Empty | 11 | | 0 | 00/13A1 |
596 | 1 quicktest.s 587 | Code | 11 | | 2 | 00/13A1 : A9 01 | lda #1 ;find caller speed (x300)
597 | 1 quicktest.s 588 | Code | 11 | | 3 | 00/13A3 : 8D 46 11 | sta callspd
598 | 1 quicktest.s 589 | Code | 11 | | 2 | 00/13A6 : C0 00 | cpy #0 ;at 300?
599 | 1 quicktest.s 590 | Code | 11 | | 2 | 00/13A8 : F0 09 | beq Do_Baud ;yep
600 | 1 quicktest.s 591 | Empty | 11 | | 0 | 00/13AA |
601 | 1 quicktest.s 592 | Code | 11 | | 3 | 00/13AA : 0E 46 11 | asl callspd ;speed = speed * 2
602 | 1 quicktest.s 593 | Code | 11 | | 3 | 00/13AD : 0E 46 11 | setspeed2 asl callspd ;speed = speed * 2
603 | 1 quicktest.s 594 | Code | 11 | | 1 | 00/13B0 : 88 | dey
604 | 1 quicktest.s 595 | Code | 11 | | 2 | 00/13B1 : D0 FA | bne setspeed2 ;loop until correct speed found
605 | 1 quicktest.s 596 | Empty | 11 | | 0 | 00/13B3 |
606 | 1 quicktest.s 597 | Code | 11 | | 1 | 00/13B3 : 68 | Do_Baud pla ;get y-reg
607 | 1 quicktest.s 598 | Code | 11 | | 1 | 00/13B4 : 0A | asl a
608 | 1 quicktest.s 599 | Code | 11 | | 1 | 00/13B5 : A8 | tay
609 | 1 quicktest.s 600 | Code | 11 | | 3 | 00/13B6 : B9 05 14 | lda baudAddresses,y
610 | 1 quicktest.s 601 | Code | 11 | | 3 | 00/13B9 : 8D D1 13 | sta Baudread+1
611 | 1 quicktest.s 602 | Code | 11 | | 3 | 00/13BC : B9 06 14 | lda baudAddresses+1,y
612 | 1 quicktest.s 603 | Code | 11 | | 3 | 00/13BF : 8D D2 13 | sta Baudread+2
613 | 1 quicktest.s 604 | Empty | 11 | | 0 | 00/13C2 |
614 | 1 quicktest.s 605 | Code | 11 | | 2 | 00/13C2 : A2 C2 | SetBaud ldx #$c2
615 | 1 quicktest.s 606 | Code | 11 | | 2 | 00/13C4 : A0 20 | ldy #$20
616 | 1 quicktest.s 607 | Code | 11 | | 3 | 00/13C6 : 20 1A 14 | jsr doinit
617 | 1 quicktest.s 608 | Empty | 11 | | 0 | 00/13C9 |
618 | 1 quicktest.s 609 | Code | 11 | | 2 | 00/13C9 : A9 01 | lda #$01 ;firmware attention character
619 | 1 quicktest.s 610 | Code | 11 | | 3 | 00/13CB : 20 7F 12 | jsr out
620 | 1 quicktest.s 611 | Empty | 11 | | 0 | 00/13CE |
621 | 1 quicktest.s 612 | Code | 11 | | 2 | 00/13CE : A2 00 | ldx #0
622 | 1 quicktest.s 613 | Code | 11 | | 3 | 00/13D0 : BD FF FF | Baudread lda $ffff,x
623 | 1 quicktest.s 614 | Code | 11 | | 1 | 00/13D3 : 48 | pha
624 | 1 quicktest.s 615 | Code | 11 | | 3 | 00/13D4 : 20 7F 12 | jsr out
625 | 1 quicktest.s 616 | Code | 11 | | 1 | 00/13D7 : 68 | pla
626 | 1 quicktest.s 617 | Code | 11 | | 2 | 00/13D8 : C9 42 | cmp #'B' ;finish -after- we get a 'B'
627 | 1 quicktest.s 618 | Code | 11 | | 2 | 00/13DA : F0 03 | beq Fin_Init
628 | 1 quicktest.s 619 | Code | 11 | | 1 | 00/13DC : E8 | inx
629 | 1 quicktest.s 620 | Code | 11 | | 2 | 00/13DD : 80 F1 | bra Baudread
630 | 1 quicktest.s 621 | Empty | 11 | | 0 | 00/13DF |
631 | 1 quicktest.s 622 | Code | 11 | | 2 | 00/13DF : A2 00 | Fin_Init ldx #0
632 | 1 quicktest.s 623 | Code | 11 | | 3 | 00/13E1 : BD 50 14 | Init_Loop lda Port_Init,x
633 | 1 quicktest.s 624 | Code | 11 | | 2 | 00/13E4 : F0 06 | beq doneBaud
634 | 1 quicktest.s 625 | Code | 11 | | 3 | 00/13E6 : 20 7F 12 | jsr out
635 | 1 quicktest.s 626 | Code | 11 | | 1 | 00/13E9 : E8 | inx
636 | 1 quicktest.s 627 | Code | 11 | | 2 | 00/13EA : 80 F5 | bra Init_Loop
637 | 1 quicktest.s 628 | Empty | 11 | | 0 | 00/13EC |
638 | 1 quicktest.s 629 | Empty | 11 | | 0 | 00/13EC | doneBaud
639 | 1 quicktest.s 630 | Code | 11 | | 2 | 00/13EC : A2 05 | ldx #5
640 | 1 quicktest.s 631 | Code | 11 | | 3 | 00/13EE : BD 6E 14 | ozunid_3 lda OutDefaults,x
641 | 1 quicktest.s 632 | Code | 11 | | 3 | 00/13F1 : 9D 82 14 | sta Out_Buf+4,x
642 | 1 quicktest.s 633 | Code | 11 | | 1 | 00/13F4 : CA | dex
643 | 1 quicktest.s 634 | Code | 11 | | 2 | 00/13F5 : 10 F7 | bpl ozunid_3
644 | 1 quicktest.s 635 | Empty | 11 | | 0 | 00/13F7 |
645 | 1 quicktest.s 636 | Code | 11 | | 2 | 00/13F7 : A9 7E | lda #<Out_Buf
646 | 1 quicktest.s 637 | Code | 11 | | 2 | 00/13F9 : A2 14 | ldx #>Out_Buf
647 | 1 quicktest.s 638 | Code | 11 | | 2 | 00/13FB : A0 00 | ldy #0
648 | 1 quicktest.s 639 | Code | 11 | | 3 | 00/13FD : 20 26 14 | jsr doext
649 | 1 quicktest.s 640 | Empty | 11 | | 0 | 00/1400 |
650 | 1 quicktest.s 641 | Code | 11 | | 3 | 00/1400 : 20 11 14 | patchIn jsr inbuff ;set the input buffer, can be self-modified
651 | 1 quicktest.s 642 | Empty | 11 | | 0 | 00/1403 |
652 | 1 quicktest.s 643 | Code | 11 | | 1 | 00/1403 : FA | plx
653 | 1 quicktest.s 644 | Code | 11 | | 1 | 00/1404 : 60 | rts
654 | 1 quicktest.s 645 | Empty | 11 | | 0 | 00/1405 |
655 | 1 quicktest.s 646 | Comment | 11 | | 0 | 00/1405 | ********************************
656 | 1 quicktest.s 647 | Empty | 11 | | 0 | 00/1405 | baudAddresses
657 | 1 quicktest.s 648 | Data | 11 | | 2 | 00/1405 : 40 14 | da Baud300
658 | 1 quicktest.s 649 | Data | 11 | | 2 | 00/1407 : 42 14 | da Baud1200
659 | 1 quicktest.s 650 | Data | 11 | | 2 | 00/1409 : 44 14 | da Baud2400
660 | 1 quicktest.s 651 | Data | 11 | | 2 | 00/140B : 47 14 | da Baud4800
661 | 1 quicktest.s 652 | Data | 11 | | 2 | 00/140D : 4A 14 | da Baud9600
662 | 1 quicktest.s 653 | Data | 11 | | 2 | 00/140F : 4D 14 | da Baud19200
663 | 1 quicktest.s 654 | Empty | 11 | | 0 | 00/1411 |
664 | 1 quicktest.s 655 | Empty | 11 | | 0 | 00/1411 | inbuff
665 | 1 quicktest.s 656 | Code | 11 | | 2 | 00/1411 : A9 92 | lda #<In_Buf ;reset the input buffer
666 | 1 quicktest.s 657 | Code | 11 | | 2 | 00/1413 : A2 14 | ldx #>In_Buf
667 | 1 quicktest.s 658 | Code | 11 | | 2 | 00/1415 : A0 00 | ldy #0
668 | 1 quicktest.s 659 | Code | 11 | | 3 | 00/1417 : 4C 26 14 | jmp doext
669 | 1 quicktest.s 660 | Empty | 11 | | 0 | 00/141A |
670 | 1 quicktest.s 661 | Comment | 11 | | 0 | 00/141A | *-------------------------------------------------
671 | 1 quicktest.s 662 | Comment | 11 | | 0 | 00/141A | * globals
672 | 1 quicktest.s 663 | Empty | 11 | | 0 | 00/141A |
673 | 1 quicktest.s 664 | Code | 11 | | 3 | 00/141A : 4C 00 C2 | doinit jmp $c200
674 | 1 quicktest.s 665 | Code | 11 | | 3 | 00/141D : 4C 00 C2 | doread jmp $c200
675 | 1 quicktest.s 666 | Code | 11 | | 3 | 00/1420 : 4C 00 C2 | dowrite jmp $c200
676 | 1 quicktest.s 667 | Code | 11 | | 3 | 00/1423 : 4C 00 C2 | dostatus jmp $c200
677 | 1 quicktest.s 668 | Code | 11 | | 3 | 00/1426 : 4C 00 C2 | doext jmp $c200
678 | 1 quicktest.s 669 | Empty | 11 | | 0 | 00/1429 |
679 | 1 quicktest.s 670 | Data | 11 | | 1 | 00/1429 : 30 | rCodes asc '0' ;2400
680 | 1 quicktest.s 671 | Data | 11 | | 1 | 00/142A : 31 | asc '1' ;4800
681 | 1 quicktest.s 672 | Data | 11 | | 1 | 00/142B : 32 | asc '2' ;9600
682 | 1 quicktest.s 673 | Data | 11 | | 1 | 00/142C : 34 | asc '4' ;19200
683 | 1 quicktest.s 674 | Data | 11 | | 1 | 00/142D : 35 | asc '5' ;1200/ARQ
684 | 1 quicktest.s 675 | Data | 11 | | 1 | 00/142E : 36 | asc '6' ;2400/ARQ
685 | 1 quicktest.s 676 | Data | 11 | | 1 | 00/142F : 37 | asc '7' ;9600/ARQ
686 | 1 quicktest.s 677 | Empty | 11 | | 0 | 00/1430 | rCodesEnd
687 | 1 quicktest.s 678 | Empty | 11 | | 0 | 00/1430 |
688 | 1 quicktest.s 679 | Data | 11 | | 1 | 00/1430 : 02 | sCodes dfb 2 ;2400
689 | 1 quicktest.s 680 | Data | 11 | | 1 | 00/1431 : 03 | dfb 3 ;4800
690 | 1 quicktest.s 681 | Data | 11 | | 1 | 00/1432 : 04 | dfb 4 ;9600
691 | 1 quicktest.s 682 | Data | 11 | | 1 | 00/1433 : 05 | dfb 5 ;19200
692 | 1 quicktest.s 683 | Data | 11 | | 1 | 00/1434 : 01 | dfb 1 ;1200/ARQ
693 | 1 quicktest.s 684 | Data | 11 | | 1 | 00/1435 : 02 | dfb 2 ;2400/ARQ
694 | 1 quicktest.s 685 | Data | 11 | | 1 | 00/1436 : 04 | dfb 4 ;9600/ARQ
695 | 1 quicktest.s 686 | Empty | 11 | | 0 | 00/1437 |
696 | 1 quicktest.s 687 | Data | 11 | | 2 | 00/1437 : 00 00 | OurID ds 2
697 | 1 quicktest.s 688 | Data | 11 | | 4 | 00/1439 : 00 00 00 00 | OurHandle ds 4
698 | 1 quicktest.s 689 | Data | 11 | | 1 | 00/143D : 00 | count db 0
699 | 1 quicktest.s 690 | Data | 11 | | 2 | 00/143E : 00 00 | code ds 2 ;2 byte code returned by modem
700 | 1 quicktest.s 691 | Empty | 11 | | 0 | 00/1440 |
701 | 1 quicktest.s 692 | Data | 11 | | 2 | 00/1440 : 36 42 | Baud300 asc '6B'
702 | 1 quicktest.s 693 | Data | 11 | | 2 | 00/1442 : 38 42 | Baud1200 asc '8B'
703 | 1 quicktest.s 694 | Data | 11 | | 3 | 00/1444 : 31 30 42 | Baud2400 asc '10B'
704 | 1 quicktest.s 695 | Data | 11 | | 3 | 00/1447 : 31 32 42 | Baud4800 asc '12B'
705 | 1 quicktest.s 696 | Data | 11 | | 3 | 00/144A : 31 34 42 | Baud9600 asc '14B'
706 | 1 quicktest.s 697 | Data | 11 | | 3 | 00/144D : 31 35 42 | Baud19200 asc '15B'
707 | 1 quicktest.s 698 | Empty | 11 | | 0 | 00/1450 |
708 | 1 quicktest.s 699 | Empty | 11 | | 0 | 00/1450 | Port_Init
709 | 1 quicktest.s 700 | Data | 11 | | 1 | 00/1450 : 01 | hex 01
710 | 1 quicktest.s 701 | Data | 11 | | 2 | 00/1451 : 30 44 | asc '0D' ;8 bits
711 | 1 quicktest.s 702 | Data | 11 | | 1 | 00/1453 : 01 | hex 01
712 | 1 quicktest.s 703 | Data | 11 | | 2 | 00/1454 : 32 50 | asc '2P' ;no parity
713 | 1 quicktest.s 704 | Data | 11 | | 1 | 00/1456 : 01 | hex 01
714 | 1 quicktest.s 705 | Data | 11 | | 2 | 00/1457 : 41 44 | asc 'AD' ;auto-tabbing
715 | 1 quicktest.s 706 | Data | 11 | | 1 | 00/1459 : 01 | hex 01
716 | 1 quicktest.s 707 | Data | 11 | | 2 | 00/145A : 58 44 | asc 'XD' ;no xoff recognition
717 | 1 quicktest.s 708 | Data | 11 | | 1 | 00/145C : 01 | hex 01
718 | 1 quicktest.s 709 | Data | 11 | | 2 | 00/145D : 46 44 | asc 'FD' ;no find keyboard
719 | 1 quicktest.s 710 | Data | 11 | | 1 | 00/145F : 01 | hex 01
720 | 1 quicktest.s 711 | Data | 11 | | 2 | 00/1460 : 43 44 | asc 'CD' ;no column overflow
721 | 1 quicktest.s 712 | Data | 11 | | 1 | 00/1462 : 01 | hex 01
722 | 1 quicktest.s 713 | Data | 11 | | 2 | 00/1463 : 45 44 | asc 'ED' ;echo disabled
723 | 1 quicktest.s 714 | Data | 11 | | 1 | 00/1465 : 01 | hex 01
724 | 1 quicktest.s 715 | Data | 11 | | 2 | 00/1466 : 4D 44 | asc 'MD' ;no lf masking
725 | 1 quicktest.s 716 | Data | 11 | | 1 | 00/1468 : 01 | hex 01
726 | 1 quicktest.s 717 | Data | 11 | | 2 | 00/1469 : 42 45 | asc 'BE' ;buffering enabled
727 | 1 quicktest.s 718 | Data | 11 | | 1 | 00/146B : 01 | hex 01
728 | 1 quicktest.s 719 | Data | 11 | | 1 | 00/146C : 5A | asc 'Z'
729 | 1 quicktest.s 720 | Data | 11 | | 1 | 00/146D : 00 | hex 00
730 | 1 quicktest.s 721 | Empty | 11 | | 0 | 00/146E |
731 | 1 quicktest.s 722 | Comment | 11 | | 0 | 00/146E | *-------------------------------------------------
732 | 1 quicktest.s 723 | Comment | 11 | | 0 | 00/146E | * These get copied to Out_Buf
733 | 1 quicktest.s 724 | Empty | 11 | | 0 | 00/146E |
734 | 1 quicktest.s 725 | Empty | 11 | | 0 | 00/146E | OutDefaults
735 | 1 quicktest.s 726 | Data | 11 | | 4 | 00/146E : AC 14 00 00 | adrl buffer
736 | 1 quicktest.s 727 | Data | 11 | | 2 | 00/1472 : 03 00 | dw 3
737 | 1 quicktest.s 728 | Empty | 11 | | 0 | 00/1474 |
738 | 1 quicktest.s 729 | Comment | 11 | | 0 | 00/1474 | *-------------------------------------------------
739 | 1 quicktest.s 730 | Empty | 11 | | 0 | 00/1474 | GetOutBuffer
740 | 1 quicktest.s 731 | Data | 11 | | 1 | 00/1474 : 04 | hex 04
741 | 1 quicktest.s 732 | Data | 11 | | 1 | 00/1475 : 11 | hex 11
742 | 1 quicktest.s 733 | Data | 11 | | 2 | 00/1476 : 00 00 | dw 0 ;result
743 | 1 quicktest.s 734 | Data | 11 | | 4 | 00/1478 : 00 00 00 00 | ds 4 ;address
744 | 1 quicktest.s 735 | Data | 11 | | 2 | 00/147C : 00 00 | dw 0 ;length
745 | 1 quicktest.s 736 | Empty | 11 | | 0 | 00/147E |
746 | 1 quicktest.s 737 | Comment | 11 | | 0 | 00/147E | *-------------------------------------------------
747 | 1 quicktest.s 738 | Data | 11 | | 1 | 00/147E : 04 | Out_Buf hex 04 ;Parameters to set the
748 | 1 quicktest.s 739 | Data | 11 | | 1 | 00/147F : 13 | hex 13 ;Output buffer
749 | 1 quicktest.s 740 | Data | 11 | | 2 | 00/1480 : 00 00 | da 0
750 | 1 quicktest.s 741 | Data | 11 | | 4 | 00/1482 : AC 14 00 00 | adrl buffer ;Buffer it where
751 | 1 quicktest.s 742 | Data | 11 | | 2 | 00/1486 : 03 00 | dw 3 ;buffer 3 bytes
752 | 1 quicktest.s 743 | Empty | 11 | | 0 | 00/1488 |
753 | 1 quicktest.s 744 | Comment | 11 | | 0 | 00/1488 | *-------------------------------------------------
754 | 1 quicktest.s 745 | Empty | 11 | | 0 | 00/1488 | GetInBuffer
755 | 1 quicktest.s 746 | Data | 11 | | 1 | 00/1488 : 04 | hex 04
756 | 1 quicktest.s 747 | Data | 11 | | 1 | 00/1489 : 10 | hex 10
757 | 1 quicktest.s 748 | Data | 11 | | 2 | 00/148A : 00 00 | dw 0 ;result
758 | 1 quicktest.s 749 | Data | 11 | | 4 | 00/148C : 00 00 00 00 | ds 4 ;address
759 | 1 quicktest.s 750 | Data | 11 | | 2 | 00/1490 : 00 00 | dw 0 ;length
760 | 1 quicktest.s 751 | Empty | 11 | | 0 | 00/1492 |
761 | 1 quicktest.s 752 | Comment | 11 | | 0 | 00/1492 | *-------------------------------------------------
762 | 1 quicktest.s 753 | Data | 11 | | 1 | 00/1492 : 04 | In_Buf hex 04 ;Parameters to set the
763 | 1 quicktest.s 754 | Data | 11 | | 1 | 00/1493 : 12 | hex 12 ;Output buffer
764 | 1 quicktest.s 755 | Data | 11 | | 2 | 00/1494 : 00 00 | da 0
765 | 1 quicktest.s 756 | Data | 11 | | 4 | 00/1496 : AC 14 00 00 | adrl buffer ;Buffer it where (modified later)
766 | 1 quicktest.s 757 | Data | 11 | | 2 | 00/149A : 00 40 | dw $4000 ;buffer 16k
767 | 1 quicktest.s 758 | Empty | 11 | | 0 | 00/149C |
768 | 1 quicktest.s 759 | Comment | 11 | | 0 | 00/149C | *-------------------------------------------------
769 | 1 quicktest.s 760 | Data | 11 | | 1 | 00/149C : 03 | Carrlist hex 03 ;Parameter list for
770 | 1 quicktest.s 761 | Data | 11 | | 1 | 00/149D : 06 | hex 06 ;detecting carrier drop
771 | 1 quicktest.s 762 | Data | 11 | | 2 | 00/149E : 00 00 | da 0
772 | 1 quicktest.s 763 | Data | 11 | | 2 | 00/14A0 : 00 00 | carrbits da 0 ;Carrier
773 | 1 quicktest.s 764 | Empty | 11 | | 0 | 00/14A2 |
774 | 1 quicktest.s 765 | Comment | 11 | | 0 | 00/14A2 | *-------------------------------------------------
775 | 1 quicktest.s 766 | Data | 11 | | 1 | 00/14A2 : 03 | DTR_List hex 03 ;Parameter list for
776 | 1 quicktest.s 767 | Data | 11 | | 1 | 00/14A3 : 0B | hex 0b ;setting DTR
777 | 1 quicktest.s 768 | Data | 11 | | 2 | 00/14A4 : 00 00 | da 0
778 | 1 quicktest.s 769 | Data | 11 | | 2 | 00/14A6 : 00 00 | DTRstate da 0 ;bit
779 | 1 quicktest.s 770 | Empty | 11 | | 0 | 00/14A8 |
780 | 1 quicktest.s 771 | Comment | 11 | | 0 | 00/14A8 | *-------------------------------------------------
781 | 1 quicktest.s 772 | Data | 11 | | 1 | 00/14A8 : 02 | Flush_List hex 02 ;parameter list for flushing input queue
782 | 1 quicktest.s 773 | Data | 11 | | 1 | 00/14A9 : 14 | hex 14
783 | 1 quicktest.s 774 | Data | 11 | | 2 | 00/14AA : 00 00 | da 0
784 | 1 quicktest.s 775 | Empty | 11 | | 0 | 00/14AC |
785 | 1 quicktest.s 776 | Data | 11 | | 3 | 00/14AC : 00 00 00 | buffer ds 3
786 | 1 quicktest.s 777 | Empty | 11 | | 0 | 00/14AF |
787 | 1 quicktest.s 778 | Empty | 11 | | 0 | 00/14AF |
788 | 1 quicktest.s 779 | Empty | 11 | | 0 | 00/14AF |
------+-----------------------+-------------+----+---------+------+-----------------------+-------------------------------------------------------------------

BIN
quicktake/zilog/Z8530UM.pdf Normal file

Binary file not shown.