Pulina9500 - Pulina for the Nokia 9500 / 9300 (Series 80 v2.0)
Version 1.0, 2026-11-22. Package UID 0x01000A2A.

Pulina is the chat app of #pulina, the Finnish channel on QuakeNet IRC
(https://github.com/pulinairc/pulina-app). This is Pulina on the Nokia 9500
Communicator: the phone talks IRC to QuakeNet itself, with no PC or bridge in
between, in Pulina's colours and Finnish, with its grouped chat, replies,
reactions and emoji, and #pulina's history from chat.pulina.fi over a TLS 1.2 of
its own.

Port: Sami Vuori, written together with Claude (Anthropic). Pulina and Lobby, which
it grew from: Rolle Laukkarinen.


INSTALL
  1. Install Pulina.sis, to the phone (C:) or the memory card (D: on the 9500). It
     puts Pulina on the Desk.
  2. Start Pulina. The first time it shows #pulina's rules: read them with the
     arrows, type a nick and press Enter. That accepts the rules and joins #pulina.
  3. The phone asks for an access point (WLAN or GPRS/EDGE).
  Pulina needs a network that lets IRC out on port 6667 (irc.quakenet.org), and
  HTTPS on port 443 for the history.


THE SCREEN
  The chat runs from the top edge down, newest at the bottom. One row at the bottom
  holds the open buffer's name, the edit line, and on the right what waits elsewhere
  ("Highlightit (2)" = lines that mention you, "otso 1" = an unread private chat), or
  the connection's state before you are signed on. The topic is at the top of the
  people list (Ihmiset).

  The chat has its own font, two pixels smaller than the system's by default. The
  menu's Pienempi teksti / Suurempi teksti step through the sizes the phone really
  has (it shows the one it picked: "Tekstin koko 11 px"). Nicks longer than their
  column (about twelve letters) are drawn whole and push the text along.


KEYS
  Enter            send
  Up / Down        pick a line (Vastaa and Reagoi act on it); Down past the newest
                   goes back to the bottom
  Shift/Ctrl+Up    page up / down
  Esc              drop the pick
  Left / Right     next buffer, when the edit line is empty (Ctrl+arrow always)
  Ctrl+1..9        buffer 1..9 (1 #pulina, 2 Highlightit, then private chats)
  Tab              complete a nick (Tab again for the next); "nick: " at the start

  Vastaa           "nick: " in front of the edit line, for the picked line or the
                   newest one by someone else
  Reagoi           the emoji palette: 1-0, or arrows + Enter; sent as "nick: <emoji>"
  Ihmiset          the people list; Enter on a nick opens a private chat
  Sulje            quit (sends QUIT first)

  Menu: Yhdista uudelleen, Vaihda nimimerkki, Sulje keskustelu, Saannot,
        Pienempi / Suurempi teksti, Vaalea / Tumma ulkoasu, Tietoja


COMMANDS
  As in Pulina: /me /msg /query /join /part /wc /topic /names /whois /nick /away
  /notice /invite /kick /ban /unban /kickban /bans /mode /op /deop /voice /devoice
  /ignore /unignore /clear /quote /say /quit. Anything else goes to the server as it
  is; "//" sends a line that starts with "/".


SETTINGS (pulina.ini, in \System\Apps\Pulina\ on the drive Pulina is on)
  Pulina writes it on the first join: nick=, rules=, theme= (light/dark), and
  fontsize= once you change the text size.
  To sign in to Q (optional), add:
    quser=yourQaccount
    qpass=yourpassword
  Pulina then AUTHs to Q, sets +x, and joins once the hidden host is on. The
  password sits in the file as it is: anyone with the phone can read it.


HISTORY
  When the IRC link comes up, Pulina fetches #pulina's newest 300 lines from
  chat.pulina.fi (after a break, only what came since) on the same access point,
  without asking again, and puts them in their place in the chat, the way Pulina
  does. "Historiaa N rivia" says how many lines were new. The chat works without it.

  The history server speaks only TLS 1.2 with ECDHE-ECDSA and AES-GCM or
  ChaCha20-Poly1305, which the 9500's own TLS can't, so Pulina brings its own:
  BearSSL 0.6, in PulinaTls.exe beside the app. The server's certificate is checked
  against three roots built in (ISRG Root X1 and X2, Let's Encrypt Root YE) and
  against the phone's clock, so a clock that is far off makes the check fail.

  When it fails, the message says why and where it stopped, for example
  "Historiaa ei saatu: aikakatkaisu [tcp -33]". The part in brackets is the last line
  of history.log in \System\Apps\Pulina\, which lists every step. A negative number
  is a Symbian error; a positive one after tls-... or http/tls is a BearSSL error
  (BR_ERR_* in bearssl_ssl.h; 54 = certificate expired or the clock is wrong).


WHAT COMES FROM PULINA
  grouped chat         one nick per run of lines, 5-minute gap (lib.js continues)
  reactions            "nick: <emoji>" goes under that nick's last line, and your own
                       under the line you picked (lib.js REACTION_RE, app.js)
  replies              "nick: text" quotes what it answers: their newest line, or the
                       one they said to the replier, within 30 minutes (replyTarget)
  highlights           whole-word mentions of your nick, copied to Highlightit
  emoticons            :D :) <3 xd ... become emoji when sent (lib.js EMOTICONS)
  nick colours         the same hues as Pulina (FNV-1a, purples skipped)
  join/part/quit       summed up in one row in Pulina's Finnish:
                       "kaisla ja otso liittyivat", "4 henkiloa liittyi" ...
  stand-in nicks       milla_, milla2 ...; the nick you wanted is taken back when free
  history              merged like backlog.rs: the same nick and text within two
                       minutes is the same line
  encoding             UTF-8 out; in, UTF-8 or else CP1252
  colours              pulina.fi's night blue and neon green (brand.css)


NOT INCLUDED
  Avatars, link cards and pictures, file uploads, Pulina accounts and shells, most
  active, the channel shelf, per-channel notification settings. Emoji outside the
  171 in emoji.dat show as a grey "?".


WHERE IT COMES FROM
  pulcore.c/.h     the IRC session and Pulina's rules in C89, with no C library and
                   no writable static data, taken from pulina-app's ui/lib.js, app.js,
                   core/src/net.rs, irc.rs and backlog.rs. Tested on a PC against a
                   fake server (tests\core_test.c, 143 checks).
  Pulina*.cpp/.h   the Series 80 app: PulinaConn (access point and TCP), PulinaView
                   (the screen), PulinaHistory (runs PulinaTls.exe), PulinaApp.
  PulinaTls.cpp    PulinaTls.exe (PulinaTls.mmp), the history fetch.
  pulhttps.c/.h    one HTTPS GET over BearSSL as a byte pump (the caller moves the
                   bytes): the same code in PulinaTls.exe and in the PC test
                   (tests\history_fetch.c).
  anchors.c        the TLS roots (tools\make_anchors.py, from tools\anchors).
  epocc\           stdint.h & co. and memcpy & co. for BearSSL under the SDK's GCC 2.9;
                   stdint.h also sets BearSSL's switches for a 32-bit ARM.
  rules.txt        #pulina's rules for the first screen (tools\make_rules.py, from
                   pulina-app's ui/brand.js).
  emoji.dat        171 Twemoji pictures at 16x16 (tools\make_emoji.py --png DIR
                   --size 16, from the Twemoji 16.0.1 PNGs); emoji_tab.h is their table.
  tools\dl\bearssl BearSSL 0.6's inc\ and src\ (bearssl.org); the files the fetch
                   uses are listed in PulinaTls.mmp (tools\bearssl_files.sh and
                   make_mmp.py write them there).
  tools\           check.sh (the C core as GNU89), cppcheck.sh (the C++ against the
                   SDK headers), check_bearssl.sh (the C as GCC 2.9 and petran see it),
                   stack_bearssl.sh, arm_helpers.sh, build_bearssl_host.sh (BearSSL
                   for the PC tests), hostgcc.sh, make_icon.py, make_release.py
                   (packs the two zips).

  Found on the way, on the phone:
  - Why an EXE: the SDK's GCC 2.9 puts const data holding addresses (BearSSL's tables
    of function pointers) in .data, and petran refuses an app DLL with any ("Dll
    'PULINA[01000A2A].APP' has initialised data"). An EXE may have it, and gets its
    own 32 KB stack for the elliptic-curve maths.
  - The 7.0s loader parses a process's command line as a file name: "/backlog?limit=300"
    on it panicked the phone's LoaderThread (FSCLIENT panic 25, raised in TParsePtrC),
    and RProcess::Create returned -15. So PulinaTls.exe starts with an empty command
    line and reads what to fetch from history.req (iap=, path=, seed=), which the app
    writes beside it.
  - TParsePtrC only points at the name it is given: TParsePtrC p(me.FileName()) points
    at a temporary, and the paths built from it gave KErrBadName (-28).


BUILD (on a Windows 2000 VM with the Series 80 v2.0 SDK)
  Copy the folder to \Pulina9500 on the SDK's drive, then in it:
    bldmake bldfiles
    abld build armi urel        (builds both Pulina.app and PulinaTls.exe)
    makesis Pulina.pkg
  Pulina.pkg is generated from Pulina.pkg.txt (see its first lines). The SIS installs
  Pulina.app/.rsc/.aif, PulinaTls.exe, rules.txt, emoji.dat, this readme and the
  licences to !:\System\Apps\Pulina\.

  Checks on a PC before a VM build (with a GCC for Windows; the scripts expect the
  WinLibs GCC in ..\GBA9500\tools\dl\mingw64, see tools\hostgcc.sh):
    sh tools/check.sh           the C core as GNU89
    sh tools/cppcheck.sh        the C++ against the SDK headers
    sh tools/check_bearssl.sh   the app's C must hold no addresses in const data
    sh tests/run.sh             the core's tests
    sh tests/fetch.sh           the history from chat.pulina.fi (after
                                sh tools/build_bearssl_host.sh once)
  hostgcc.sh sets LC_ALL=C, -nostdinc and GCC_EXEC_PREFIX: the WinLibs GCC was built
  under D:\Temp and looks there, which hangs every compile when D: is a card reader
  with no card.

  Release: py tools/make_release.py [version] writes release\Pulina9500-<version>-src.zip,
  and release\Pulina9500-<version>.zip once release\Pulina.sis is there.


LICENCE
  Pulina9500 is under the MIT License, like pulina-app (see LICENSE.txt). BearSSL is
  Thomas Pornin's, MIT License (BEARSSL.TXT). The emoji are Twemoji 16.0.1 graphics,
  (c) Twitter, Inc. and other contributors, CC-BY 4.0
  (https://creativecommons.org/licenses/by/4.0/), scaled and packed into emoji.dat.

  Thanks: Rolle Laukkarinen (Pulina and Lobby), Thomas Pornin (BearSSL), the Twemoji
  makers, and #pulina.
