**************************************************************************

TxtoPS II
---------

A Homebrew Text Editor

Version  : First Edition
Author   : dangee
Date     : December 2008
Platform : Sony PSP
Firmware : M33 Custom Firmware 

**************************************************************************

Description
-----------
  TxtoPS II is an application to create and edit text files stored
 on the PSP Memory Stick Duo.
  This version is exclusively for use on PSP equipped with M33
 Custom Firmware up to 5.00-M33. 

**************************************************************************

Installation
------------

  Unzip, and move the /TXTOPS folder to /PSP/GAME and launch in
 Kernel mode 3/4/5.XX.
 
**************************************************************************

 Controls
 --------
  
  Wizard -  When TxtoPS II first boots successfully, it creates a
            set of Guide Files in /TXTOPS/Guide, and opens an
            Intro file giving detailed Control information.
 
  QuickStart - When the Editor opens, press START to access the
               TxtoPS Top Menu, from where an onscreen Control
               Summary can be toggled on/off.
 
 
 USB-PC Connection
 -----------------
  Choose 'File options' from the Top Menu, and 'USB PC Connection' 
  to access the PSP memory stick from your PC via a PSP-PC 
  USB connector without needing to de-boot TxtoPS II.
   
 File Edits
 ----------
  TxtoPS II Loads files from the PSP Memory Stick to RAM, where
  edit operations are carried out. To Save an edited copy from
  RAM back onto the Memory Stick a SAVE FILE command must be
  sent to TxtoPS from Function key f7 on the On Screen Keypad. 
   A file can be loaded into either of two tabs, overwiting
  the previous file loaded in that tab. Either of the two tabs
  can be viewed in fullscreen, or page layout can be changed to
  view both tabs simultaneously in splitscreen.
   There are two Edit Modes
     OSK Mode - Single characters are inserted into the loaded
                file, and Function commands are sent to TxtoPS,
                from the OnScreen Keypad (OSK)
     C&P Mode - Multi-line blocks of text can be moved,cut and
                pasted.
   The SELECT button toggles between the two modes.
 
 User scripts
 ------------
  TxtoPS II runs in a host interpreter, LuaPlayer HM-6.6, and can
  be used to edit and/or launch compatible LuaScripts.

 Memory Stick File operations
 ----------------------------
  TxtoPS II provides standard file operations that involve access
 to the PSP Memory Stick, and is designed to avoid unwanted data
 loss. A file backup folder /Trash is maintained, and overwritten
 files are copied to it unless the quick update feature is used.
 There's always a confirmation prompt before file deletion.

  Writes to Flash memory are not directly supported, but can be
 made from a HM-6.6 User Script. This is not recommended, and is
 entirely at User's own risk.

 Resource Files
 --------------
  TxtoPS II expects to find various Sub-folders and Files in the 
 /TT2 folder.

 Sub-folders:
   /Config            (Configuration Files)
   /Guide             (Guide Files)
   /Applications      (User Programs)
   /Trash             (File Backups)
 these are created as needed if not found

 This File:
  /README.TXT 
 and the Savestate Files:
  /Config/TXSAV.DAT
  /Config/SHORTCUT.DAT
 are created or reloaded automatically by TxtoPS if they're not
 found, or modified in any way. 

 The default Top Menu Background Image:
   /Config/TOMSKIN.PNG
 the default Function f5 User Script
   /Applications/USR.LUA
 and all the Guide Files
   /Guide/INTRO.TXT
   /Guide/INTROTAB.TXT
   /Guide/FSELECT.TXT
   /Guide/OSK.TXT
   /Guide/TOPMENU.TXT
   /Guide/EDITFILE.TXT
   /Guide/LP02FUNCTIONS.TXT
   /Guide/HM66FUNCTIONS.TXT
   /Guide/ASCII.TXT
 can be modified or replaced. The original files are reloaded
 only if not found when TxtoPS reboots.

 After TxtoPS II initialises and before starting its main loop,
 it runs the LuaScript
   /Applications/PATCH.LUA
 if found.

 IRDA Keyboard
 -------------
  Pikey is not supported.
  TxtoPS II has a driver for an IR Keyboard when run on a PSP 1000.
  This works in both OSK and Cut & Paste Modes, but not in the Top
  Menu except when the OSK pops up for text entry.

  However, it is specific to the uncommon
     NIKKAI UNIVERSAL PDA THUMBOARD
  that was rebranded as the
     PKB-800
  The PKB-800 may work assuming the transmit protocol is unchanged,
  although this is untested.
  The source code for the Driver used by TxtoPS II can be found at
    http://dangee.net/IRNIKA.TXT
  Other IRDA keyboards are unlikely to work with this Driver.
  A Customized external input Driver scripted for LuaPlayer 0.2
  can be run from /Applications/PATCH.LUA, so long as compatible
  interface functions are used:
    IKB.enable()
    IKB.speedSet(rpt,rpt1)
    IKB.rptclr()
    IKB.read()
    IKB.disable()
  These are the Driver functions called from TxtoPS II
  IKB.read() returns a string of 0 or more characters, and doesn't
  wait for input before return.
   TxtoPS II calls IKB.read() at about 30-40hz , and only the first
  character of a non-empty return string is processed.

  Control codes:

    Functions f1-f8 are sent as a 2 character sequence,
    IKB.FN,followed by ascii code for digits '1'-'8'

    Cursor/Page move
    IKB.KYUP,IKB.KYDN,IKB.KYLF,IKB.KYRT  map to the PSP DPAD
                                          (arrow) buttons or
                                          Analog stick
    IKB.SHUP,IKB.SHDN,IKB.SHLF,IKB.SHRT  map to PSP DPAD/Analog
                                          + L shoulder button 
    IKB.DATE toggles DPAD and Analog Stick mapping for the above
             codes

    IKB.ALTUP jumps to Start of File
    IKB.ALTDN jumps to End of File
    IKB.ALTLF jumps to Column 1
    IKB.ALTRT jumps to End of Line

    Modes
    IKB.PHON maps to the PSP START button
    IKB.SYM  maps to the PSP SELECT button

    In Cut & Paste Mode
    IKB.CCL  maps to the PSP CIRCLE button 
    IKB.DEL  maps to the PSP CROSS button 
    IKB.MEMO maps to the PSP TRIANGLE button 
    IKB.CMD  maps to the PSP SQUARE button 

    IKB.CTRLF,IKB.CTRRT  indent a highlighted Zone

  Size Limits
  -----------
   It should be possible to load and edit files of up to about 1MB
  without Memory or stack overflow. Larger files may cause load
  errors.

   Updating a loaded file, and/or the Paste Buffer to sizes above
  1MB may cause line/paste buffer errors or file save errors.
   When these errors occur, TxtoPS attempts to avoid data loss, but
  a reboot is recommended to avoid possible subsequent data
  corruption.

  Bugs
  ----
   The original version of this text editor, was never
  released because of a random freeze and PSP shutdown.

   After a complete rewrite of the graphics engine, TxtoPS II
  has good reliability. 

   There are two known, but unresolved bugs. Both occur very
  rarely.

    1)  Desynchronisation of the Cut & Paste highlighted Zone
       from the edit cursor. This causes nothing more than
       screen glitches and can be cleared by toggling OSK Mode
       with the SELECT button.

    2)  Control Lock affecting all the PSP controls except the
       Analog Stick. Occasional file saves during edit are
       recommended. 

  User Scripts run in protected mode and any bugs are normally
  caught and reported without need of a reboot. However, name
  clashes with TxtoPS Objects and/or resource overflow can cause
  unpredictable results.

****************************************************************************

Credits/thx
-----------

The LuaPlayer creators,developers and maintainers
     http://www.luaplayer.org/
Homemister for the modified LuaPlayer 'HM 6.6'
     http://luaplayerhm.xtreemhost.com
mediumguage for filer PSP, used often during development
     http://www.geocities.jp/mediumgauge
DCEmu for PSP homebrew expertise & Resources,hosting
     http://www.dcemu.co.uk
qj.net for hosting & distributing PSP Homebrew
     http://dl.qj.net
Dark Alex for M33 Custom Firmware (used for development)
     http://www.dark-alex.org
Sony Computer Entertainment for the PSP & F/ware 1.5
     http://sony.com

& All the dedicated hackers who continue to make PSP homebrew
possible.


****************************************************************************
****************************************************************************

License
-------

This Application is distributed in the file:

  TXTOPS_2.ZIP
             
and includes the following files

  EBOOT.PBP      - the Application
  README.TXT     - Overview,Installation instructions

The Application and all its original designs are
  copyright (c) Dec. 2008 dangee.net
The author, 'dangee' , reserves all rights.

The software may be freely Redistributed and used for any
lawful non-commercial purpose provided that a file with details
of any modifications, and this file, 'README.TXT' in its original
form, are included in the redistribution.

Redistribution of the software,for any commercial purpose
is subject to prior agreement with the author.
( Contact: dan@dangee.net  )
       
Any file modified or created by the software may be
freely used for any lawful purpose, subject to the Disclaimer
below 

 Disclaimer

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


****************************************************************************


The software includes a modified version of 'LuaPlayer v0.2',
which requires inclusion of the following licence:

  **************************************************************************
  Copyright (c) 2005  Frank Buss
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:
  1. Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.
  3. The names of the authors may not be used to endorse or promote products
     derived from this software without specific prior written permission.
  
  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
****************************************************************************

****************************************************************************