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

TxtoPS V
--------

A Homebrew Text Editor

Version  : First Edition
Author   : dangee
Date     : August 2009
Platform : Sony PSP
Firmware : M33 Custom Firmware

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

Description
-----------
  TxtoPS V is an upgrade of TxtoPS II, an application to create
 and edit text files stored on the PSP Memory Stick Duo.
  As well as many performance improvements and enhancements,this
 release features onscreen guides and menus in 5 languages
 (English,French,Italian,German and Spanish), definable colour
 scheme for the editor, Cyrillic and customized character encoding,
 screenshots, and an alpha image viewer.

 TxtoPS V runs on any PSP equipped with M33 Custom Firmware.

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

Installation
------------
  Unzip, and move the /TT5 folder to /PSP/GAME and launch in
 Kernel mode 3/4/5.XX.

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

 Controls
 --------
  When TxtoPS V first boots successfully, it loads an introduction
 file (INTRO.TXT) with the necessary information to  start loading,
 editing and saving files.
  The START button switches between the editor, and a Top Menu with
 various control and configuration options.
   An onscreen control summary can be switched on/off from the
 Top Menu, and the popup memory stick File Selector has its own
 mini guide.

 Memory
 ------
  Improved memory management was a high priority for TxtoPS V.
 The cache available now allows files of up to about 2MB to be
 loaded, and the worst of the memory leaks that affected TxtoPS II
 are plugged.
  However free RAM can still deplete slowly during normal use
 of the editor, so a memory monitor is now included on the Status
 Line. If this drops below +:1.0M a file save, and reboot of TxtoPS
 from the Top Menu is recommended.

 File Edits
 ----------
  TxtoPS V loads files from the PSP Memory Stick to RAM where
 editing is carried out, by sending the f1 Function key from the
 OnScreen Keypad (OSK), or by choosing 'Load file' from
 'File options' on the Top Menu.

  A file can be loaded into either of two page windows, overwiting
 the previous file loaded in that window. Either of the two page
 windows can be viewed in fullscreen, or page layout can be changed
 to view both windows simultaneously in splitscreen, by sending f6
 from the OSK. The active window is switched by sending f8.

  There are two Edit Modes
    OSK Mode - Single characters are inserted into the loaded
               file, and Function commands are sent to TxtoPS,
               from the OSK.
    C&P Mode - Multi-line blocks of text can be defined,copied,
               cut and pasted. A block of text that starts and
               ends at column 1 can be shifted left or right.
  The SELECT button toggles between the two modes.

  An edited file is written from RAM onto the Memory Stick by
 sending Function key f7 from the OSK, or by choosing 'Save file'
 from 'File options' on the Top Menu. The edited file overwrites
 the file chosen from the File Selector.
  By default, the overwritten file is saved to the /TRASH folder,
 but a save without backup can be made by choosing the empty file
 entry in the edited file's source folder. AutoTrash can also be
 switched off in 'File Format options' from 'Configuration' on the
 Top Menu.
  Power failure during file save is likely to cause data loss, but
 a failsafe <filename>_BAK may still be found on the memory stick,
 either in the file source folder or in /TRASH.

 Text Search
 -----------
  Send Function key f2 from the OSK to enter a single line of text
 to search for in the loaded file. The popup text selector has a
 single textline memory.

  Send Function key f4 from the OSK to search for the next
 instance, treating the file as circular.

 Line Jump
 ---------
  Send Function key f3 from the OSK to enter a line or column
 number. The popup line/column selector has a line number memory.

 LuaPlayer Scripts
 -----------------
  TxtoPS V runs in a host interpreter, LuaPlayer HM-6.6, and can
 be used to edit and/or launch compatible LuaScripts.

 Function key f5 from the OSK launches  /Applications/USR.LUA

 Other scripts can be run by choosing 'Launch LuaScript' from
 'File Options' on the Top Menu.
  Scripts launched from TxtoPS only have the amount of free memory
 available as shown by the memory monitor. To run a script with
 the full memory resource of HM-6.6, choose 'Boot LuaPlayer' from
 the Top menu. This deboots TxtoPS and runs the normal Luaplayer
 bootscript (ie. script.lua,index.lua, or system.lua). When the
 script finishes, TxtoPS reboots, unless the external boot folder
 /XBOOT is found in /TT5. /XBOOT is always removed during reboot
 if it contains no files. TxtoPS always reboots if the Left
 Shoulder button is held down, whether or not /XBOOT is found.

 Alpha image viewer
 ------------------
  'TomSkin' in the 'Configuration' menu loads PNG or JPG images
 of up to 512x512 resolution,scaled automatically to screen size
 (480x272) to use as a Top Menu skin.
  To view the image in its original resolution, press the SELECT
 button for Image (alpha).
  This image viewer provides a background that moves through the
 colour spectrum to show transparency in PNG images. The background
 colour can be paused at any time.
  JPG images are unaffected.

 Screenshot
 ----------
  TxtoPS V features an advanced screenshot system that allows
 the full screen, or a subsection of it, to be saved in either
 PNG or JPG format. Screenshots are saved in /Image as

     SHOT_J{i}.JPG
  or SHOT_P{i}.PNG

  To access the screenshot GUI click the Left and Right shoulder
 buttons simultaneously.
  Screenshots cannot be taken during memory stick access, or while
 a user script is running.

 Encoding
 --------
  The character set assigned to ASCII codes 128-255 can be chosen
 in 'OSK settings' from the 'Configuration' Menu.
  There are presets for dos,western (ISO-8895-1), and
 Cyrilic (ISO-8895-5) encoding.

  There's also a custom encoding option for a character set
 designed using a GUI, by choosing 'TxtoPS Encoding' from the
 'Configuration' Menu. The custom character set is stored in the
 savestate file /TXSAV.DAT. So to set up a simple personalized
 encryption system, make a backup of /TXSAV.DAT to use as the key.

  The OSK includes most of the encoded characters in its
 alternative keyset. All other characters must be cut and pasted
 from the file /Guide/ASCII.TXT

 ColorWays
 ---------
  Use the precision pixel editing GUI (Pixi-Ed) to set up colour
 schemes for the various screen objects by choosing 'Colours'
 from the 'Configuration' menu.

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

 Sub-folders:
   /Guide             (Guide Files)
   /Applications      (LuaPlayer Scripts)
   /Trash             (File Backups)
   /Image             (Screenshots)
 these are created as needed if not found.
 You can rename /Guide,/Applications or /Image, but only from
 inside TxtoPS so that the new name can be saved in the config
 file /TXSAV.DAT

 This File:
  /README.TXT
 and the Savestate Files:
  /TXSAV.DAT
  /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:
   /TOMSKIN.PNG
 the default Function f5 User Script
   /Applications/USR.LUA
 the default LuaPlayer boot Script
   /Applications/SCRIPT.LUA
 and the Guide Files
   /Guide/INTRO.TXT
   /Guide/INTROTAB.TXT
   /Guide/LP02FUNCTIONS.TXT
   /Guide/HM66FUNCTIONS.TXT
   /Guide/ASCII.TXT
 can be modified or replaced, but not renamed. The original files
 are reloaded if not found when TxtoPS reboots.

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

 IRDA Keyboard/External I/P
 ==========================
 Pikey is not supported.

  TxtoPS V has a driver for an IR Keyboard when run on a PSP 1000.
 This works in all modes and subsystems.

 However, it is specific to the uncommon

    NIKKAI UNIVERSAL PDA THUMBOARD (aka PKB-800)

 The source code for the Driver can be found at
    http://dangee.net/IRNIKA.TXT

 Other IRDA keyboards are unlikely to work with this Driver,but it
 can be modified to implement a customized external input Driver,
 scripted to run in Luaplayer 0.2, and stored as
   IRPATCH.LUA in the /TT5 folder.
 The interface with TxtoPS V is by the following methods;
    IKB.enable()
    IKB.speedSet(rpt,rpt1)
    IKB.rptclr()
    IKB.read()
    IKB.disable()
 IKB.read() returns a string of 0 or more characters, and doesn't
 wait for input before return.
  TxtoPS V calls IKB.read() at about 30-40hz , and only the first
 character of a non-empty return string is processed.

  Control codes:

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

    Dpad/Analog
    -----------
    IKB.KYUP,IKB.KYDN,IKB.KYLF,IKB.KYRT
    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

    Symbol Buttons
    --------------
    IKB.CCL   maps to the SQUARE button
    IKB.DEL   maps to the CROSS button
    IKB.CMD   maps to the TRIANGLE button

    IKB.ENTER maps to the CIRCLE button
              except in Cut & Paste mode (see below)

    Cut & Paste Mode (note: changed since TxtoPS II)
    ------------------------------------------------
    IKB.TODO maps to the CIRCLE button   (Zone Lock)
    IKB.CTRLF,IKB.CTRRT  (indent a highlighted Zone)

    Page Jump
    ---------
    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

    Line Jump
    ---------
    IKB.TODO maps to the LEFT button    (set bookmark)
    IKB.MEMO maps to the RIGHT button   (bookmark)

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


  Bugs
  ----
    1)  Occasional desynchronisation of the Cut & Paste
       highlighted Zone from the edit cursor. This causes nothing
       more than screen glitches that can be cleared by opening the
       Top Menu and choosing 'Return to editor', or by scrolling
       any glitch offscreen.

    2)  The extensive file backup system in TxtoPS V is included
       because of possible bugs in the low level i/o routines
       used during file save, and/or unknown system bugs.
       Even if Autotrash is switched off, occasional file backups
       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
pspgen for the top French language PSP website
     http://www.pspgen.com
Dark Alex for M33 Custom Firmware
     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.

Translation
-----------
Thanks to
 Goldensun (pspgen) for posting a French language guide for TxtoPS II:
 http://www.pspgen.com/forums/txtops-ii-un-editeur-de-texte-pour-psp-t147410.html

 Google Translate       http://translate.google.co.uk
 Yahoo Babel fish       http://babelfish.yahoo.com
 Gefa (PSPdictionary)   http://www.gefa.altervista.org/index.php
 Jim,Tariq (German)
 Peter,James,Steve (French)
 Steve's friend (Spanish)
 Isabelle (French,German,Spanish)

and to Richard for help with design of the language selector

*********************************
** Translators (all languages) **

Your corrections, improvements and translations are more than
welcome; for inclusion in future releases, or by hyperlink to
your webpage from dangee.net.

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

Contact: dan@dangee.net

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

License
-------

This Application is distributed in the file:

  TXTOPSV.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) Sep. 2009 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.

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

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