LAST LIGHT - installing on a Miyoo Mini Plus with Onion OS
==========================================================

Version: v1.0.1
Author: slop.kitchen
Website: https://slop.kitchen/

LAST LIGHT runs on the Miyoo Mini Plus with Onion OS 4.4 (tested on 4.4.0). It appears in
Onion's Ports list: Games > Ports > Action > Last Light. This zip holds only the game; it
never contains save files, so installing or updating never touches your progress.

What the zip puts on the SD card
--------------------------------

  Roms/PORTS/Games/LastLight/lastlight            the game
  Roms/PORTS/Games/LastLight/lastlight-audio      native audio helper
  Roms/PORTS/Games/LastLight/launch.sh            starts it and restores audio/CPU settings on exit
  Roms/PORTS/Games/LastLight/INSTALL.txt          this file
  Roms/PORTS/Games/LastLight/CHANGELOG.md         what changed in each version
  Roms/PORTS/Games/LastLight/LICENSE.txt          LAST LIGHT's license
  Roms/PORTS/Games/LastLight/OFL.txt              the Exo 2 font's license (SIL Open Font License 1.1)
  Roms/PORTS/Games/LastLight/cacert.pem           certificates for the engine's network code
                                                  (LAST LIGHT itself never goes online)
  Roms/PORTS/Games/LastLight/HTTPS-LICENSES.txt   the network libraries' license notices
  Roms/PORTS/Shortcuts/Action/Last Light.port     the entry in the Ports list
  Roms/PORTS/Imgs/Last Light.png                  its box art

The game keeps its saves next to it, in Roms/PORTS/Games/LastLight/: meta.txt and meta.bak
(gold, power ups, unlocks, achievements, options), run.sav (a suspended run), last_run.rec
(the last run's recording), settings.audio and settings.rumble (AUDIO SETTINGS and RUMBLE),
and log.txt.

OPTIONS > RUMBLE controls vibration: OFF, LIGHT or NORMAL (the default).
Damage, NOVA, boss defeats and death have distinct short pulses; LIGHT uses
shorter pulses. Rumble stops on pause and menu pages. The setting is stored in
settings.rumble beside the game and is preserved when updating.

OPTIONS > ABOUT shows the version and a QR code: scan it with a
phone camera to open https://slop.kitchen/lastlight for updates and the
feedback form. From the title it plays Skyline Drift, a drum and bass
piece from Sound Lab. B returns to OPTIONS.

One melody runs through all five nights, in a sound of its own for each: glass,
frost, ritual reeds, bells and warm piano. It builds through the run and for elites
and bosses. Title, death and dawn use shared cues. Level-ups, chests,
NOVA, revival and other important events have short sounds. The handheld's volume
buttons control listening level. Keep the helper and launcher beside the game;
copying only the main binary does not install native sound. If audio cannot start,
the game remains playable and log.txt/audio-helper.log hold the diagnostics.


Install
-------

1. Turn the handheld off and put its SD card in your computer.
2. Extract the zip to the ROOT of the SD card (the top level, where the Roms, App and Emu
   folders are), so that its Roms folder merges with the card's Roms folder. Nothing on the
   card is deleted; only the files listed above are added.
   - Windows: open the zip, select the Roms folder inside it, and copy it onto the card's top
     level (Explorer merges folders). Answer "Replace" if it asks about LAST LIGHT's files.
   - macOS: do NOT drag the Roms folder onto the card in Finder: Finder's default is to
     REPLACE the card's whole Roms folder, which deletes your games. Use Terminal instead
     (change SDCARD to your card's name as Finder shows it, keeping the quotes):
         unzip -o ~/Downloads/LastLight-v1.0.1.zip -d "/Volumes/SDCARD"
         dot_clean -m "/Volumes/SDCARD"
     (dot_clean -m removes the "._" files macOS leaves on memory cards.)
     Safari unzips downloads and deletes the zip. If it did, copy the Roms folder it left in
     Downloads instead, then remove it (so the next update's folder gets the same name):
         rsync -r ~/Downloads/Roms/ "/Volumes/SDCARD/Roms/" && rm -r ~/Downloads/Roms
         dot_clean -m "/Volumes/SDCARD"
   - Linux: unzip -o LastLight-v1.0.1.zip -d /path/to/the/card
3. Check that the card now has Roms/PORTS/Games/LastLight/lastlight (not a
   LastLight-v1.0.1 folder at the top with Roms inside it).
4. Eject the card safely, put it back in the handheld and turn it on.
5. Open Games > Ports and run "~Import ports" at the top of the list: Onion shows a new port
   only after that. Then open Action > Last Light.

If Games > Ports is missing altogether, install Onion's "Ports Collection" from
Apps > Package Manager. If Onion says "Port Launch Error ... lastlight is missing", the
files went to the wrong folder: see step 3.


Update to a new version
-----------------------

When updating from 0.10.0, finish your current run first if you want to keep
playing it. The two new chapters change the run format: an older suspended run
offers BANK n GOLD (keep its gold) or KEEP FILE instead of CONTINUE. Your gold,
power ups, unlocks and achievements remain available.

Quit LAST LIGHT, then install the new zip exactly as above, replacing the old files
when asked. Your saves are not in the zip, so they stay as they are. To be extra safe, copy the meta.*, run.* and settings.*
files out of Roms/PORTS/Games/LastLight/ before updating.

Since 1.0 LAST LIGHT has a synthesized soundtrack; 0.10.0 and earlier had no sound.
Some test builds carried experimental recordings instead, which are now in Sound
Lab. If you installed such a test build by extracting its ZIP by hand, remove these
files from the game's music/ folder (Mixtape removes them itself when it updates a
build it installed):
    menu.mp3  menu_alt.mp3  flow_a.mp3  flow_b.mp3  pressure.mp3  defiance.mp3
    menu.wav  menu_alt.wav  flow_a.wav  flow_b.wav  pressure.wav  defiance.wav
    CREDITS.txt  SOURCES.json
Also remove AUDIO-CODECS.txt beside the game. Keep lastlight-audio: the synthesized
soundtrack needs it. Saves are outside music/ and should be kept.

If an update changes how runs are stored, a run suspended by the older version cannot
continue: the title then offers BANK n GOLD (keep its gold) or KEEP FILE.


Moving from the Apps list (early testers)
-----------------------------------------

Test builds before this release installed LAST LIGHT in the Apps list (App/LastLight). The
Ports version starts with empty saves until you move yours over:

1. Quit LAST LIGHT (MENU) if it is open.
2. Install this zip as above.
3. Before you start the Ports version, copy these files (those you have) from
   App/LastLight/ to Roms/PORTS/Games/LastLight/:
       meta.txt  meta.bak  run.sav  run.bak  last_run.rec
   (and any other file whose name starts with meta., run., last_run. or settings.).
   If you already played the Ports version, copying replaces its new progress with the
   old one: keep whichever you prefer.
4. Start Games > Ports > Action > Last Light and check your gold and unlocks.
5. Remove the old Apps entry: delete the App/LastLight folder. (To hide it but keep its
   files, rename App/LastLight/config.json to config.json.migrated and launch.sh to
   launch.sh.migrated instead.)


NIGHT VISUALS
-------------

The five nights use indigo, frost blue, oxblood, teal and dry amber backgrounds,
each kept through all four of its phases, with small ground marks of its own.


CPU BOOST
---------

OPTIONS > CPU BOOST (off by default) runs the CPU at its full 1.2 GHz while LAST LIGHT runs,
for smoother frames in the busiest moments. It uses more battery and the handheld runs
warmer. It never changes how the game plays. The game puts Onion's CPU setting back when it
exits, and launch.sh puts it back too if the game is ever stopped abruptly. LAST LIGHT's
Ports entry does not use Onion's own performance mode; leave CPU BOOST off if battery life
matters more to you.


Uninstall
---------

Delete these from the SD card:
    Roms/PORTS/Games/LastLight/               (this deletes your saves too: copy meta.* first
                                               if you want to keep your progress)
    Roms/PORTS/Shortcuts/Action/Last Light.port
    Roms/PORTS/Imgs/Last Light.png
Then run "~Import ports" at the top of the Ports list so that the entry goes away.


Problems
--------

The game writes what it does to Roms/PORTS/Games/LastLight/log.txt; include that file when
you report a problem, along with the version shown on the title screen (v1.0.1).
