This document is under constraction......
This document is obosolute....(Sorry)

*QV-10 player "QVplay" Ver. 0.10a      1996.7.31?

*What's this?

CASIO QV-10 digital camera is cool product. But, PC link software
provided by CASIO works on Windows PC or Machintosh.

To download image data, and convert it to TIFF image file format
you should to use CASIO's PC link software on Windows/Machintosh
environment.
For Unix environment user, it is horrible.

Furtunately, for Unix user, converting software to CAM format
image file  (CASIO's original image data format) to JPEG(JFIF)
image file is available. 
(Thank's for Mr.Iwama's CAM format document.)

'cam2jpeg'  (Auther Jun-ichiro "itojun" Itoh<itojun@csl.sony.co.jp>)
'camtoppm.pl'  (Auther Shuji Senda <senda@kuis.kyoto-u.ac.jp>)

Now, you can download image data from QV-10 at Unix(and Windows NT,
Windows 95) environment, by 'qvplay'.

'qvplay' has many functions.
- downlod image data from QV-10 and save into files.
- show images on QV-10's LCD.
- delete image data on QV-10.
- report how many images in QV-10.
- press the shutter of QV-10.

And, You can upload 'PPM', 'RGB', 'CAM' format image files
to QV-10, by 'qvrec'.


*Auther 

Ken-ichi HAYASHI <xg2k-hys@asahi-net.or.jp>
Jun-ichiro "itojun" Itoh <itojun@csl.sony.co.jp>

*Attension
- The auther assumes no respnsibility for the results for the useage of
  this software(qvplay, qvrec, qvalldel), and documents.
- There is a possibility of this software(qvplay, qvrec, qvalldel)
  can cause parmanent damage to QV-10's hardware and image data
  in QV-10. 
  Use at your own risk.
- Sometimes, You must do small hardware hack to PC-QV10 connection
  cable. (On FreeBSD and NEXTSTEP, this hardware hack is needed)
- This software(qvplay, qvrec, qvalldel) is 'FreeWare'.
  You man freely redistribute this archive.
- You can use whole source code of this archive in your software,
  but I assume no resuponsibilitiy for the results of the usage
  of the source code.
  Use at your own risk.
  It is great presure you describe at README file of your software,
  "This software has QVplay's source code.".

*Tested environment
Unix system
-PC/AT clone Linux 1.2.13, 1.3.20
-PC/AT clone BSD/OS 2.0
-Sony NEWS-3150U2 NEWS-OS 4.2.1RN
-Sony NEWS-1860 NEWS-OS 4.2C
-Sony NEWS-4000 NEWS-OS 6.1.1
-NEC EWS4800 Rel.4.4 Rev01
-Sun Sparc Station 20 Solaris2.3(SunOS 5.3)
-Sparc clone SunOS 4.1.4
-Apple Macintosh SE/30 NetBSD 1.0
-PC/AT clone FreeBSD 2.0.5R(*)
-PC/AT clone FreeBSD 2.1.0R(*)
-NeXT NeXTcube(M68040-25) NEXTSTEP 3.3J(*)

Not Unix system
-SHARP X68030 + Human68k 3.02
-PC/AT clone Windows NT 3.51(Intel)(work on DOS prompt)
-PC/AT clone Windows 95(work on DOS prompt)

(*) Need hardware hack.(describe below)

*Table of contents
 README     README file(JIS code, Japanese)
 README.eng this file
 PROTOCOL.txt document of serial protocol(JIS code, Japanese)
 Protocol.eng document of serial protocol(English)
 HISTORY    HISTORY file(JIS code, Japanese)
 FAQ.txt    FAQ(JIS code, Japanese)
 install-sh
 setup
 obj/
    Win32/
        config.h
        getopt.c (GNU getopt)
        getopt.h (GNU getopt)
        tty_w32.c
        tty_w32.h
     X68k/
         Makefile
         config.h
         siochk.c (Thanks for Masuda-san)
         tty_x68.c
         tty_x68.h
         x68k.c
  src/
     qvplay.c
     qvrec.c
     qvalldel.c
     common.h
     command.h
     command.c    
     command1.h
     command1.c    
     command2.h
     command2.c    
     command3.h
     command3.c    
     getuint.c
     getuint.h
     tty.h
     tty.c   
     jpeg.h     
     jpeg.c
     ppm.h
     ppm.c
     bmp.h
     bmp.c
     cam2jpgtab.h (Thanks for itojun-san)
     configure*
     Makefile.in
     configure.in
     config.h.in

*Installation(Unix system)
1. ./setup OSname   (OSname is your operating system's name.
                     c.f. linux, newsos4 ...
                     If your environment can use 'uname', 'OSname'
                     is not need.)
2. cd obj/OSname
3. ./configure
4. Edit 'common.h' at directory 'obj/OSname', 
   set your operating system's tty device to '#define RSPORT'
   definition.
5. make

*Installation(X680x0)
Use the source code at 'obj/X68k' and 'src'. 
You should comple it by 'gcc', 'gmake', 'libc'.
extract source archive on X680x0.
cd QVplay\obj\X68k
copy ..\..\src\*.c .
copy ..\..\src\*.h .
gmake -f Makefile

*Installation(Windows NT/Windows 95)
Use the source code at 'obj/Win32' and 'src/'. 
You should comple it by 'VisualC++4.0'.
extract source archive on Windows NT.
cd QVplay\obj\Win32
copy ..\..\src\*.c .
copy ..\..\src\*.h .
Start VisualC++.
Select [File][New][ProjectWorkspace] menu item.
Select [Console Application] at [New ProjectWorkspace]Dialog Box.
make ProjectWorkspace named 'qvplay'.
Select [Insert][Add File to Project] menu item.
Add files(qvplay.c command.c command1.c jpeg.c ppm.c
bmp.c getopt.c getuint.c tty_w32.c) to project.
Do build.

To build 'qvrec', make ProjectWorkspace named 'qvrec'.
Add files(qvrec.c command.c command2.c getopt.c getuint.c
tty_w32.c) to project. And do build.

To build 'qvalldel', make ProjectWorkspace named 'qvrec'.
Add files(qvalldel.c command.c command3.c getopt.c tty_w32.c)
to project. And do build.

Default serial port is defined in 'common.h'.
Please change '#define RSPORT "COM2"', to your 
default serial port.

*Equipment for qvplay, qvrec, qvalldel.
- CASIO QV-10, QV-10a, QV-30
- PC link cable (included CASIO PC link kit for Windows)

Connect QV-10 and PC/WS by PC link cable.
And execute 'qvplay', 'qvrec', 'qvdeleteall'.
But, some operating system environment, 'qvplay', 'qvrec',
'qvdeleteall', not work well. Because, PC link cable has
electrical circuits (may be level converter), and it works
by PC/WS's serial terminal voltage. The circit in PC link cable
use CTS,DTR terminal as Vdd(+ side), and RTS terminal as
Vss(- side). So 'qvplay', 'qvrec', 'qvdeleteall' change 
CTS,DTR terminal to on, RTS terminal to off and hold 
those status. But, some operating system environment,
change RTS terminal to off, cause stop serial communicaton.
If your environment cannot use serial terminal without hold
RTS terminal to off, you must to do small hardware hack to
PC link cable.
- connect RTS signal pin to GND pin.
This small hardware hack made voltage difference from CTS,DSR 
to RTS, so the circit in PC link cable works any time.
If you don't hove to hack PC link cable, you should to provide
 RS-232c jumper box and made it to describe below.
                  JUMPER BOX
(PC/WS side)  male          female    (PC link cable side)  
         (RTS) 4        +------ 4(RTS)
                        |
         (GND) 7 -------+-------7(GND)
And connect like below.
[PC/WS serial port]--[JUMPER BOX]--[PC link cable]--[QV10]

*How to use 'qvplay'

QV-10 has three state.(may be).
1. reseted mode.
2. command mode.
3. processing mode.

'Reseted mode' is the state of directly after power on.
In this mode, you can operate QV-10's buttons .
On 'reseted mode' QV-10 can accept commands from PC/WS.

'Command mode' is the state, QV-10 can accept commands from PC/WS's
serial port. In this mode, QV-10's buttons are not work.
(If you want to be reseted mode, send reset command from PC/WS or
 reboot QV-10, by toggle the power SW OFF and ON.)

'Processing mode' is the state , QV-10 processing the commands
from PC/WS's serial port. In this mode, QV-10 don't accept
commands from serial port, without reset command.

'qvplay' can do many operation to QV-10, and it makes QV-10 to 
'command mode'. So, you can not operate QV-10's button. 
Therefore, you shuold send reset command by adding '-r' 
option as command line's last option.

When, you got the error message "tty not respond.",
or you feel data transfer is not work well, or 
you want to terminate data transfer, terminate 'qvplay'
by 'CTRL-C', and reboot QV-10.

- usage 
  qvplay [options]
 
 num: picture number, 1 to 96 positive number.
 filename: output file name, strings 
 
 -h          Show usages to stderr.
 -r          Reset QV10.
             When reset operation is done, QV10's LCD is cleared,
             and you can operate QV10's buttons. Reset operation
             not affect in image data in QV10.
 -n          Show how many pictures in QV10 to stdout.
 -p num      Show a picture to QV10's LCD.
 -o filename Set output filename.
 -F {jpeg,ppm,PPM,rgb,RGB,bmp,BMP,cam} 
             Set output file format.
             Use with -a option or -g option.
             You should set this option leftside than -a or -g option.
             This option not affect to bafore it.

             jpeg  JPEG(JFIF) format
             ppm   PPM format(thumbnail image)
             PPM   PPM format(picture image)
             rgb   RGB format(thumbnail image)
             RGB   RGB format(picture image)
             bmp   BMP(24bit) format(thumbnail image)
             BMP   BMP(24bit) format(thumbnail image)
             cam   CAM format(thimbnail and picture image)
            
             Default is 'jpeg'.
             Format name is detected by first letter.
             So, 'photo', 'picture' are same as 'ppm'.
 -g num      Download image data from QV10 and save as
             image file. (see -F option)
             If -o option is setted, saved as the filename,
             if -o option is not setted, image file is dumped
             to stdout.
 -a          Download all image data from QV10 and save as
             image files.(see -F option)
             If -F option is not setted, and -o option is setted,
             you got image files like below.
              filename_001.jpg
              filename_002.jpg
              filename_003.jpg
              .....
             If -o  option is not setted, you got image files like below.
              qv_001.jpg
              qv_002.jpg
              qv_003.jpg
              .....
             If -F option is setted, the filename become '*.ppm', '*.cam',
             and so on.
 -s num      Use with -a option.
             It must be set before -a option.
             Set first picture number that you want to download.
 -e num      Use with -a option.
             It must be set before -a option.
             Set last picture number that you want to download.
 -v          Use with -a or -g option.
             It mustbe set before -a or -g option.
             Verbose mode. Reports downloaded data bytes to stderr.
             (Reported information is downloaded bytes, not a filesize)
 -d num      Delete image data in QV10.
 -4 num1,num2,num3,num4
             Split QV10's LCD to quad, and show image data.
 -9 num1,num2,....num9
             Split QV10's LCD to 9 sectors, and show image data.
 -P num      Protect image data.
 -U num      Unprotect image data.
 -t          Take a picutre. (set QV10's function SW to REC position.)
 -D ttydevice Change serial port to 'ttydevice'.
             If your environment is Windows NT/95, set 'COM1'...'COM4'
             as 'ttydevice'.
 -S {normal,mid,high,top,light}or{1,2,3,4,5}
             Set serial speed.
             1 normal   standard speed   9600 baud
             2 mid      medium speed    19200 baud
             3 high     high speed      38400 baud
             4 top      very high speed 57600 baud
             5 light    light speed:-) 115200 baud
             (If your environment is Linux, OS2, or Windows NT/95,
              and your computer has high speed serial port, 
              you can use 'light' speed.)

Options are done, from leftside option to rightside option.
You can set same option any times. But -s -e -o -v option
is not effect, if you set those options after the options
that you want to affort.

When -h option is seted, it show usage, and exit qvplay. The options 
which described after -h option are ingnored.

Outputed picture image files(jpgg, PPM, RGB, BMP), are 
480x240. So you shuld change aspect size to 4:3.

-S option is available from it's rightside option.
So, you should set -S option command line's leftmost.
Maximum serial speed depends computer hardware, and operating system.
(c.f. on NEWS-OS4.2C maximum speed is 9600baud)

-r option changes serial speed to standard(9600baud).

When 'qvplay' is exiting, it changes serial speed to standard(9600baud).

If you are using Linux, you can use over 38400baud serial speed.
To use 'top' or 'light' speed on Linux, set serial port by 
'setserial' command.

Example 1 
  setserial /dev/cua1 spd_hi        # set 57600baud
  qvplay -S top -o foo.jpg -g 1
Example 2
  setserial /dev/cua1 spd_vhi        # set 115200baud
  qvplay -S light -o foo.jpg -g 1

If you are using PC/AT compatible, you should 16550A compatible
serial controler, when using over 19200baud(mid).

