# Empire is running on the PicoCalc — v0.1-alpha

**URL:** <https://forum.clockworkpi.com/t/empire-is-running-on-the-picocalc-v0-1-alpha/23506>\
**Category:** PicoCalc\
**Created:** [October 16, 2026, 7:02pm UTC](https://forum.clockworkpi.com/t/empire-is-running-on-the-picocalc-v0-1-alpha/23506 "2026-10-16T19:02:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisleif](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/chrisleif/32/6199_2.png) [@chrisleif](https://forum.clockworkpi.com/u/chrisleif)\
**Post date:** [October 16, 2026, 7:02pm UTC](https://forum.clockworkpi.com/t/empire-is-running-on-the-picocalc-v0-1-alpha/23506/1 "2026-10-16T19:02:07Z")

</div>

A follow-up to my earlier post in the Rogue forum: Walter Bright’s Empire (1.2) now runs on real PicoCalc hardware.

**Repo and download:** [GitHub - ctorkildson-netizen/picocalc-empire: Empire (Walter Bright, 1977) ported to the PicoCalc / RP2350, built on PDCurses and picocalc-text-starter following the architecture of Blair Leduc's picocalc-rogue. · GitHub](https://github.com/ctorkildson-netizen/picocalc-empire)  
**Binary:** `bin/picocalc-empire.uf2`. Copy it into `pico2-apps` on your SD card and launch it from the uf2loader menu.

**Requirements:** a Pico 2 / Pico 2 W (RP2350) module. There’s no RP2040 build, because the game doesn’t fit. You’ll also need the v1.7 keyboard BIOS and pelrun’s uf2loader.

**What to expect:** this is an alpha with exactly one tester so far, so bugs, especially late in the game, are likely. The map is 64×40 and the unit pool is capped at 300 to fit in 520KB. Saves go to `empsave.dat` on the SD card automatically. Movement keys are Empire’s own QWE/AD/ZXC; the arrow keys won’t move your pieces.

**For anyone building on Blair’s PDCurses backend:** getting this onto hardware turned up three bugs in the shared `picocalc/` display layer.

- The LCD font didn’t match the 64-column layout, so long lines got garbled.
- Keyboard polling only started if the program called `raw()`.
- Color attributes were thrown away.

The fixes are in `picocalc/pdc*.c` in the repo, and any curses program using that layer should benefit.

Colossal Cave Adventure is coming next, in a separate thread.

—

Ported with Claude’s help.

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [October 16, 2026, 11:30pm UTC](https://forum.clockworkpi.com/t/empire-is-running-on-the-picocalc-v0-1-alpha/23506/2 "2026-10-16T23:30:31Z")

</div>

Thank you for the bug report! I made correction that made sense to Rogue’s version.

---

<div class="post-metadata">

**Author:** ![chrisleif](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/chrisleif/32/6199_2.png) [@chrisleif](https://forum.clockworkpi.com/u/chrisleif)\
**Post date:** [October 17, 2026, 8:19pm UTC](https://forum.clockworkpi.com/t/empire-is-running-on-the-picocalc-v0-1-alpha/23506/3 "2026-10-17T20:19:15Z")

</div>

Hi Blair,

Thanks again for the quick Rogue fix in v1.2. Since then I’ve ended up with two small pieces that might be useful in the shell and in your other projects. Both are yours to use, change or ignore.

Summary:

- A shared clock: the RP2350’s always-on (POWMAN) timer survives the soft reboot UF2 Loader does between programs, so one program can set the time and every program after it can read it, until power-off.
- A screenshot function for PDCurses programs on the PicoCalc: Shift+F5 saves the screen as a BMP.

1. SHARED CLOCK

What I found:

- The POWMAN timer runs from the crystal and keeps going through UF2 Loader’s reboot. Only a power-off clears it.
- Tested on a Pico 2 W: set the time over NTP in my VirtualT port, quit to your shell, ran Adventure, quit, relaunched VirtualT. The time was still there, with no WiFi needed.

picocalc\_clock.h (attached, MIT, written to sit next to your picocalc\_shell.h):

- picocalc\_clock\_load(): sets the program’s own time()/localtime() from the shared clock, if it’s set.
- picocalc\_clock\_save(): copies the program’s current time into it.
- picocalc\_clock\_is\_set(): tells you whether it holds a real time.
- Rule: only real times (NTP, or the user typing it) ever go in, so a program reading it can trust it.

settime (attached, source plus .uf2):

- A small program that joins WiFi, gets the time from NTP, saves it to the shared clock and returns to the shell.
- If the clock is already set, it shows the time and returns at once (N fetches it again anyway).
- Needs a Pico 2 W, with 2.4 GHz WPA2 WiFi. It retries the join up to three times.

settime’s settings, in a plain text file, /settime.cfg (falls back to /virtualt/virtualt.cfg so VirtualT users don’t type their WiFi password twice):

ssid=YourNetwork  
password=YourWiFiPassword  
tz=PST8PDT,M3.2.0,M11.1.0  
ntp=[pool.ntp.org](http://pool.ntp.org)

- One key=value per line; # starts a comment.
- tz is a POSIX TZ string, defaulting to US Pacific; ntp defaults to [pool.ntp.org](http://pool.ntp.org).
- The clock itself holds UTC; tz only affects how a program shows it. A shell DATE/TIME command would want the same tz setting, so if you’d rather have one shared settings file (or a TZ variable in /etc/profile), I’m happy to switch settime to that.

Where the shell comes in:

- DATE and TIME commands. Real dates on files the shell writes would also need the FAT32 code to stamp them.
- A cheap “is the clock set?” test usable from AUTOEXEC.BAT or /etc/profile. That’s the piece I can’t do from outside. settime is about 350 KB because of the CYW43 firmware, so running it from the startup script means the shell rewrites most of it into flash on every return from another program. With a test in the script, it would only run once per power-on.

1. SCREENSHOTS (pdcshot.c, attached)

- For PDCurses on the PicoCalc, built on your text-starter drivers, so it should drop into Rogue’s backend.
- It redraws curses’ own screen copy (curscr), using the LCD’s font and our colour map, into a 320x320 24-bit BMP. It doesn’t read back the LCD.
- Files go to /screenshots/-NNN.bmp, named from a PICOCALC\_APP\_NAME define, so programs don’t overwrite each other.
- Hooked to F10 (Shift+F5) inside PDC\_check\_key(), with a beep when done; those few lines are in pdckbd.c if you want them. The output matched the screen exactly in my tests.
- The files could get real timestamps from the shared clock, with a small change to the FAT32 driver’s date stamp.

One more thing from the same work: in the key-table lookup, the BIOS’s shifted column is 0 for most keys, so F6-F10, Del and a few others were dropped while Shift was held. The fix is a fallback to the unshifted code when the shifted one is 0. Happy to send the diff if Rogue’s table has the same layout.

None of this is urgent. If any of it is useful, I’m glad to adapt it to whatever fits the shell best.

Best,  
Chris

(Attachment SETTIME.TXT is missing)

(Attachment picocalc\_clock.h is missing)

(Attachment main.c is missing)

(Attachment settime.uf2 is missing)

(Attachment pdcshot.c is missing)

---

<div class="post-metadata">

**Author:** ![chrisleif](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/chrisleif/32/6199_2.png) [@chrisleif](https://forum.clockworkpi.com/u/chrisleif)\
**Post date:** [October 17, 2026, 8:52pm UTC](https://forum.clockworkpi.com/t/empire-is-running-on-the-picocalc-v0-1-alpha/23506/4 "2026-10-17T20:52:17Z")

</div>

Hi Blair,

The ClockworkPi mail relay stripped all the attachments from my last message as “dangerous”, so here’s everything in one place instead:

> **[GitHub - ctorkildson-netizen/picocalc-extras](https://github.com/ctorkildson-netizen/picocalc-extras)**
>
> Contribute to ctorkildson-netizen/picocalc-extras development by creating an account on GitHub.

- picocalc\_clock.h: the shared clock header, MIT.
- settime/: source, a ready-built settime.uf2, and SETTIME.TXT. It builds from a fresh clone, with your picocalc-text-starter as a submodule.
- screenshot/: pdcshot.c, plus a README with the PDC\_check\_key() hook and the Shift fallback fix.

If you’d rather get things some other way in future, just say which.

Best,  
Chris

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [October 19, 2026, 1:39am UTC](https://forum.clockworkpi.com/t/empire-is-running-on-the-picocalc-v0-1-alpha/23506/5 "2026-10-19T01:39:05Z")

</div>

Thank you! I am taking a look at this now.

---

<div class="post-metadata">

**Author:** ![BlairLeduc](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/blairleduc/32/11808_2.png) [@BlairLeduc](https://forum.clockworkpi.com/u/BlairLeduc)\
**Post date:** [October 24, 2026, 12:14pm UTC](https://forum.clockworkpi.com/t/empire-is-running-on-the-picocalc-v0-1-alpha/23506/6 "2026-10-24T12:14:29Z")

</div>

I am planning to ship the clock enhancement to the shell sometime today. Thank you for the idea and direction. I didn’t implement this feature exactly as presented here, but it does appear to be compatible with VirtualT.
