Quake9500 - Quake for the Nokia 9500 / 9300 (Series 80 v2.0)
Version 1.1, 2026-11-06. Package UID 0x01000A1C.

id Software's Quake (1996), the whole game, running on the Nokia 9500 Communicator:
software rendered on its 150 MHz ARM9, which has no floating-point hardware. About
17 frames a second in the timedemo, with sound, saves and the full menu.

Port: Sami Vuori, written together with Claude (Anthropic).


NEW IN 1.1
  - 1.35 times as fast: the game's code is now built by GCC 14 instead of the SDK's
    GCC 2.9. The timedemo (demo1) went from 12.6 to 17.1 frames a second on the phone.
    The game is the same, with the same settings, and real play, sound, saving and
    loading were tested on the phone.
  - Install it over 1.0: it is the same package and replaces it. Saves and config.cfg
    stay where they are. If you tried QuakeBlob, the test build, remove it with the
    Application manager; 1.1 doesn't need it.


INSTALL
  1. Install Quake9500.sis (to the phone or the memory card).
  2. Copy Quake's data, which is not included: id1\pak0.pak from the shareware or the
     full game (the full game also needs id1\pak1.pak), to \Quake\id1\ on the memory
     card, or to C:\Quake\id1\. Quake9500 looks in E:\Quake, C:\Quake and D:\Quake.
  3. Start Quake9500 from the Desk.
  Saves (s0.sav ...) and config.cfg are written to the same id1 folder, and
  quakelog.txt (start-up, errors, speed reports) to the Quake folder.


KEYS
  Arrows / rocker       move and turn
  Rocker middle, Enter  fire (Enter selects in the menus)
  Ctrl                  fire
  Space                 jump
  Shift                 run
  Alt                   strafe while held      Chr  strafe on/off
  Backspace or /        next weapon            1-8  choose a weapon
  H                     status bar on/off (health, armour, ammo: hidden by default,
                        so the 3D view gets the whole screen)
  Esc                   menu
  Chr + Z               console
  Chr + Q W E R T Y U I A S D F = F1..F12 (F6 quicksave, F9 quickload)


SETTINGS (in the console, Chr + Z; config.cfg remembers them)
  scr_showfps 1      frames per second in the top right corner
  volume 0.5         sound volume, also in Options; each 0.1 is 5 dB (0.1 = -45 dB,
                     0.7 = -15 dB, the default, 1 = full)
  viewsize 80        a smaller 3D view: faster (100 = full screen, the default)
  r_gunscale 1.4     size of the weapon in your hands (the default; 1 = as on a PC,
                     0 = true perspective, where most of it is below the screen)
  r_drawviewmodel 0  hide the weapon: a little faster
  r_lowres 0         3D view at full height: sharper, slower (default 1: half height,
                     rows doubled)
  d_mipscale 1       sharper distant textures: slower (default 2)
  scr_sbar 1         status bar always on (the same as H)


OPTIONS (in quakeargs.txt, in the Quake folder or in E:\, D:\ or C:\; words
separated by spaces)
  -nosound           no sound (a little faster)
  -mem 16            Quake's memory in MB (default 12; the shareware game needs ~8)
  -width 640         render at the native 640x200, 1:1 (default 320x200, pixels
                     doubled; 640 is much slower)
  -aspect 0.83       PC-like stretched picture (default: correct proportions, wide view)
  +map e1m1          start a map; any normal Quake argument works
  Speed reports: +timedemo demo1 writes the frame rate and the time per frame to
  quakelog.txt; add -parts to split the 3D view into its parts (world, edges,
  spans, models, ...). In a game, "timeframes" in the console starts counting and
  "timeframes" again writes the same report for real play.


NOT INCLUDED
  Music (Quake's CD tracks), multiplayer (no network), the mission packs.


WHERE IT COMES FROM
  upstream\    Rockbox's Quake, untouched (apps/plugins/sdl/progs/quake at Rockbox
               commit d54b9e6f, GPLv2): SDLQuake 1.0.9 = id Software's GPL source, plus
               Pocket Quake's (Dan East) fixed-point renderer paths (USE_PQ_OPT*) and
               Rockbox's ARM fixes (unaligned reads of map/model data). Rockbox gets
               about 10 fps on an iPod Classic (216 MHz ARM9, no FPU).
  Quake9500\   the game. Its C files are built by GCC 14 on the PC into quake9500.rbl;
               its C++ files by the SDK into quake9500.exe, which loads the .rbl. What
               changed from upstream:
    - SDL and Rockbox are gone. New drivers: sys_epoc.c (main loop, files, clock, keys,
      log, speed reports), vid_epoc.c (video), snd_epoc.c (sound), cd_null.c.
    - Native layer from Doom9500: epocsys.cpp (window, framebuffer from the HAL, palette
      blit with ARM loops, keys, clock, exception handler) and epocaudio.cpp (audio
      thread + CMdaAudioOutputStream).
    - 1.1: two compilers. stub.cpp (SDK) loads quake9500.rbl into a chunk, fixes its
      addresses, and gives it the phone's services through a table (blobapi.h): the
      native layer, and files in place of estlib. The game's C library is newlib,
      inside the .rbl (blob\blobmain.c). Only ints and pointers cross between the two:
      GCC 2.9 keeps a double's two words the other way round, and calls into the game
      go through blob\crt.S, which aligns the stack as GCC 14 expects.
    - Sound: id's original mixer is back in snd_mix.c, all on the game thread; the audio
      thread only copies from Quake's DMA ring and plays silence for anything not mixed
      yet. 11025 Hz stereo (Quake's sounds are 11 kHz 8-bit).
    - Floats: 1.0 had its own float helpers, softfloat.c, instead of EUSER's slow,
      trapping TRealX ones. Since 1.1, GCC 14's libgcc has them, shorter still.
    - Speed: fixed-point (multiply, not divide) world edges, span drawing without
      divides (reciprocal table), fixed-point alias model culling and transform,
      particles in fixed point, per-plane gradient cache, light point cache, sine table,
      3D view at half height with rows doubled (r_lowres 1), coarser mips (d_mipscale 2),
      2x-stretching blit with 16-byte stores. 7.4 fps at the first measurement, 13.6 fps
      in 1.0 before the gun fixes, 12.6 after them, 17.1 in 1.1 (timedemo demo1,
      full-height view).
    - No status bar by default (H toggles it); "timeframes", scr_showfps.
    - Window server events: EpocVidPollKey now takes each completed request's signal
      with User::WaitForRequest. Left on the thread's semaphore, they pile up and every
      later wait spins through them (the same fix as in NES9500).
    - The weapon in your hands: true proportions on the 640x200 screen show only about
      half as far up and down as a PC, which left the gun below the screen. It is now
      projected as on a PC's default view fitted to the view's height, and grown from
      the bottom edge by r_gunscale (R_DrawViewModel in r_main.c).
    - Pocket Quake's integer gradients for models (d_polyse.c) overflowed 32 bits on
      the depth steps of anything close (the gun, a monster in your face): surfaces
      behind showed through, e.g. dark patches on the double-barrelled shotgun's
      barrels. Big differences now drop low bits first (tools\polytest checks it).
    - The phone's C library writes floats with the locale's decimal comma: Q_ftoa
      writes "%f" with a point (saves, config.cfg), Q_atof reads both.
    - Saves are written in one go (256 KB stdio buffer, no flush per entity).
    - The code is C89, as GCC 2.9 wanted: declarations above statements. Chained float
      assignments (a = b = c = x) were miscompiled by GCC 2.9 and were split up.
    - Big local arrays made static: Symbian stacks are small (EPOCSTACKSIZE 80 KB).
    - Byte order hard-wired to little-endian.
  blob\        The game's side of the bridge: crt.S (entry and thunks), mem.S (memcpy and
               memset), blob.ld, blobmain.c (the table's other end, newlib's system calls),
               and quake9500.rbl itself, ready built.
  Launcher\    Quake9500.app: the Desk icon. It starts quake9500.exe and quits; if the
               game or pak0.pak can't be found it says so, with Start and Exit. Icons
               made by make_icons.py from Quake's own console background (pak0.pak).
  tools\       PC-side tools (see tools\README.txt): build_blob.sh builds the game, armsim
               runs it in an ARM interpreter that stops where the phone would fault,
               comparelogs.py sets speed reports side by side, hostshot builds the game
               for the PC (the blog's screenshots), make_release.py packs the source zip
               and, once the SIS is in release\, the player zip.
  gcc29\       1.0's pieces that 1.1 doesn't use: softfloat.c and its tests, o2.bat, the
               1.0 mmp. The whole 1.0 source is release\Quake9500-1.0-src.zip.


BUILD
  The game, on the PC, only when its C changes (blob\quake9500.rbl is ready built):
    sh tools/build_blob.sh
  It needs the Arm GNU Toolchain 14.2.Rel1 (arm-none-eabi) and Python 3, from Git Bash.
  ARMGCC= the toolchain's folder (default ..\RE9500\tools\dl\arm-gcc). It checks the
  relocations and that nothing an ARMv4T can't run got in.

  On the Win2000 VM (Series 80 v2.0 SDK), with the project at \Quake9500 on the SDK
  drive (Quake9500, Launcher and blob are needed there):
  quake9500.exe, from \Quake9500\Quake9500\epoc:
    bldmake bldfiles
    abld build armi urel
  Launcher, from \Quake9500\Launcher:
    bldmake bldfiles
    abld build armi urel
  SIS, from \Quake9500\Quake9500\epoc:
    makesis Quake9500.pkg    (Quake9500.pkg is generated from Quake9500.pkg.txt; it
                              takes ..\..\blob\quake9500.rbl)

  Another build of the game needs no VM: NAME=test sh tools/build_blob.sh makes
  blob\test.rbl; copy it to the Quake folder and put -blob test in quakeargs.txt.
  quake9500.exe then loads test.rbl and logs to test.txt.
  Before the phone, sh tools/simrun.sh quake9500 SOMEFOLDER runs the timedemo in
  tools\armsim (no faults expected; its milliseconds are only a model).
  If the game crashes, quakelog.txt ends with the exception, the stack, and lines like
  "blob+0x12345": look those up in tools\obj\quake9500\blob0.dis of the same build.
  The fl and div columns of the -parts report were counted by softfloat.c; since 1.1
  they are 0.


LICENCE
  Quake9500 is free software under the GNU General Public License, version 2 (see
  COPYING), like id Software's Quake source it is built on. If you pass the SIS on,
  pass this source on with it. Quake's data files (pak0.pak, pak1.pak) are id
  Software's and are not covered by the GPL.

  quake9500.rbl also contains parts of two libraries that come with the toolchain:
  newlib, the C library (BSD-style licences, listed in COPYING.NEWLIB, which comes with
  this release: newlib 4.4.0's own file, https://sourceware.org/newlib/), and libgcc
  (GPL version 3 with the GCC Runtime Library Exception, which lets a program built by
  GCC use it under the program's own licence).

  Thanks: id Software (Quake, and its source), SDLQuake, Pocket Quake (Dan East), the
  Rockbox project's Quake port, Doom9500 for the Symbian layer, and GCC and newlib.
