# Play Zork on PicoCalc/PicoMite

**URL:** <https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191>\
**Category:** PicoCalc\
**Created:** [April 30, 2025, 10:20pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191 "2025-04-30T22:20:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![thwill](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/thwill/32/9466_2.png) [@thwill](https://forum.clockworkpi.com/u/thwill)\
**Post date:** [April 30, 2025, 10:20pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/1 "2025-04-30T22:20:45Z")

</div>

Hi folks,

After some prompting and testing by @cjstoddard I’ve updated my MMBasic Z-Machine implementation (Z-MIM) to run on the PicoCalc:

> **[GitHub - thwill1000/mmbasic-zmim: Z-machine interpreter for MMBasic](https://github.com/thwill1000/mmbasic-zmim)**
>
> Z-machine interpreter for MMBasic

The download includes “minizork” but Z-MIM should be capable of playing all of Infocom’s classic .z3 adventures if you have the files:

- ballyhoo.z3 - Ballyhoo
- cutthroat.z3 - Cuthroats
- enchanter.z3 - Enchanter
- hollywood.z3 - Hollywood Hijinx
- lgop.z3 - Leather Goddesses of Phobos
- lurking.z3 - The Lurking Horror
- planetfall.z3 - Planetfall
- plundered.z3 - Plundered Hearts
- seastalker.z3 - Seastalker
- sorcerer.z3 - Sorcerer
- spellbrkr.z3 - Spellbreaker
- wishbringer.z3 - Wishbringer
- infidel.z3 - Infidel
- zork1.z3 - Zork: The Great Underground Empire - Part I
- zork2.z3 - Zork II: The Wizard of Frobozz
- zork3.z3 - Zork III: The Dungeon Master

**Note:** Z-MIM is not firmware, it is an MMBasic program that runs under the PicoMite firmware (v6.00+).

**Caveat:** The performance could generously be described as “leisurely”, especially on the Pico 1. Cut it some slack, it is implementing a 16-bit virtual machine in BASIC !

Best wishes,

Tom

---

<div class="post-metadata">

**Author:** ![cjstoddard](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@cjstoddard](https://forum.clockworkpi.com/u/cjstoddard)\
**Post date:** [May 1, 2025, 1:43am UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/2 "2025-05-01T01:43:17Z")

</div>

Tom did a great job updating Z-MIM to run on the PicoCalc. Please consider buying him some coffee for all his hard work.

---

<div class="post-metadata">

**Author:** ![DigitalDreams](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/digitaldreams/32/16007_2.png) [@DigitalDreams](https://forum.clockworkpi.com/u/DigitalDreams)\
**Post date:** [May 1, 2025, 8:56am UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/3 "2025-05-01T08:56:00Z")

</div>

> [@thwill](#):
>
> After some prompting and testing by @cjstoddard I’ve updated my MMBasic Z-Machine implementation (Z-MIM) to run on the PicoCalc:

Just waiting for a SD card reader to arrive in the post (old one getting upset) and will give it a test on my pico2 before sending over a coffee sir 😎.

---

<div class="post-metadata">

**Author:** ![DigitalDreams](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/digitaldreams/32/16007_2.png) [@DigitalDreams](https://forum.clockworkpi.com/u/DigitalDreams)\
**Post date:** [May 2, 2025, 5:12pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/4 "2025-05-02T17:12:39Z")

</div>

> [@thwill](#):
>
> After some prompting and testing by @cjstoddard I’ve updated my MMBasic Z-Machine implementation (Z-MIM) to run on the PicoCalc:

Its running !, some questions…

1. In a game is there an easy way to exit (maybe saving progress at the same time) ?. Only seems to be \*break followed by q ?

2. \*save, \*restore… Will these work fine if flipping between different stories ?

Note - if you do \*break followed by ‘h’ the output is not properly formatted for the PicoCalc screen hence difficult to read.

---

<div class="post-metadata">

**Author:** ![thwill](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/thwill/32/9466_2.png) [@thwill](https://forum.clockworkpi.com/u/thwill)\
**Post date:** [May 2, 2025, 5:25pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/5 "2025-05-02T17:25:19Z")

</div>

> Its running !

That’s great news.

`*break` is to break into the interactive Z-Machine debugger, you probably don’t need that unless you are planning on writing your own story or extending/fixing Z-MIM.

> 1. In a game is there an easy way to exit (maybe saving progress at the same time) ?. Only seems to be \*break followed by q ?

In general just type `save` to save and `quit` to quit, with no `*` prefix.

Note the meta-commands `*save` and `*restore` are really there for any stories that don’t provide their own save/restore.

> 1. \*save, \*restore… Will these work fine if flipping between different stories ?

`save` and `restore` provide 10 independent save slots per story.

> Note - if you do \*break followed by ‘h’ the output is not properly formatted for the PicoCalc screen hence difficult to read.

Thanks, I’m not sure the PicoCalc is the ideal platform for using the debugger, but I’ll take a look next time I am passing through.

Best wishes,

Tom

---

<div class="post-metadata">

**Author:** ![cjstoddard](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@cjstoddard](https://forum.clockworkpi.com/u/cjstoddard)\
**Post date:** [May 2, 2025, 5:47pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/6 "2025-05-02T17:47:40Z")

</div>

> [@DigitalDreams](#):
>
> Note - if you do \*break followed by ‘h’ the output is not properly formatted for the PicoCalc screen hence difficult to read.

I have been using z-mim for the better part of 3 weeks now and it never once occurred to me to go into the debugger.

---

<div class="post-metadata">

**Author:** ![DigitalDreams](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/digitaldreams/32/16007_2.png) [@DigitalDreams](https://forum.clockworkpi.com/u/DigitalDreams)\
**Post date:** [May 5, 2025, 6:19pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/7 "2025-05-05T18:19:38Z")

</div>

> [@thwill](#):
>
> > Its running !
> 
> That’s great news.

And now its not !!. Seems to be my recent upgrade to rc20. On bootup it gives the immediate error (no startup screen)…

[712] Line Input #1, s$  
Error : Line is too long

😳

---

<div class="post-metadata">

**Author:** ![thwill](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/thwill/32/9466_2.png) [@thwill](https://forum.clockworkpi.com/u/thwill)\
**Post date:** [May 5, 2025, 7:56pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/8 "2025-05-05T19:56:54Z")

</div>

Well that’s looks like a new firmware bug - I speculate that it is no longer correctly handling reading from files that just have line-feed ‘\n’ line-endings.

It’s possible Peter cocked it up in the PicoMite main-line, I’ll try and find time to check tomorrow.

However I also know that @adcockm “fixed” a PicoCalc specific bug with line-endings read from standard input using `INPUT` … and I can’t help but wonder if that fix broke reading from files ?

Please note I don’t have a PicoCalc so it’s difficult for me to do any debugging specific for that platform.

Best wishes,

Tom

---

<div class="post-metadata">

**Author:** ![DigitalDreams](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/digitaldreams/32/16007_2.png) [@DigitalDreams](https://forum.clockworkpi.com/u/DigitalDreams)\
**Post date:** [May 5, 2025, 8:00pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/9 "2025-05-05T20:00:22Z")

</div>

> [@thwill](#):
>
> Well that’s looks like a new firmware bug - I speculate that it is no longer correctly handling reading from files that just have line-feed ‘\n’ line-endings.

Yes probably. I just tried deleting the whole folder and copying back to the PicoCalc incase of file corruption… exact same error 😑. A coffee awaits if you can find a way round this !

---

<div class="post-metadata">

**Author:** ![cjstoddard](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@cjstoddard](https://forum.clockworkpi.com/u/cjstoddard)\
**Post date:** [May 5, 2025, 8:37pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/10 "2025-05-05T20:37:33Z")

</div>

And this is why I wait two or three revisions between upgrading firmware. I am hoping adcockm finds a nice stable RC of 6.00.02, does his thing with it, then stops trying to chase Peter and settles into a nice leisurely once a month update.

---

<div class="post-metadata">

**Author:** ![thwill](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/thwill/32/9466_2.png) [@thwill](https://forum.clockworkpi.com/u/thwill)\
**Post date:** [May 5, 2025, 8:39pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/11 "2025-05-05T20:39:02Z")

</div>

Try running this program:

```auto
txt$ = "Moses supposes his toeses are "
Cat txt$, "roses; Moses supposes "
Cat txt$, "eroneously, For nobody's "
Cat txt$, "toeses are roses or "
Cat txt$, "posies, As Moses "
Cat txt$, "supposes his toeses "
Cat txt$, "to be."
Open "output.txt" For Output As #1
For i = 1 To 20
  ' End line with just \n
  Print #1, txt$; Chr$(10);
Next
Close #1
Open "output.txt" For Input As #1
Do While Not Eof(#1)
  Line Input #1, s$
  Print s$
Loop

```

It should print the rhyme about Moses 20 times, if as I suspect the PicoCalc firmware is broken then you will get a “Line is too long” error from line 16.

Best wishes,

Tom

---

<div class="post-metadata">

**Author:** ![thwill](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/thwill/32/9466_2.png) [@thwill](https://forum.clockworkpi.com/u/thwill)\
**Post date:** [May 5, 2025, 10:21pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/12 "2025-05-05T22:21:23Z")

</div>

I have tested Z-MIM with RC22 of the standard PicoMite (LCD) build (RC20 is no longer available for download) and it works fine so on the balance of probabilities I believe this is a new PicoCalc specific bug.

Best wishes,

Tom

---

<div class="post-metadata">

**Author:** ![thwill](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/thwill/32/9466_2.png) [@thwill](https://forum.clockworkpi.com/u/thwill)\
**Post date:** [May 5, 2025, 10:31pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/13 "2025-05-05T22:31:43Z")

</div>

OK, I’ve poked some more, and I think I’m wrong, that error is not from `LINE INPUT`, it’s from the new line continuation feature.

Try disabling it with `OPTION CONTINUATION LINES OFF` and see if the problem persists.

I’m not sure exactly how this caused the specific error you saw (which may be transitory and fixed by RC22), but I do need to make some fixes to Z-MIM because it was using \_ as the name of a (dummy) variable in places.

Best wishes,

Tom

---

<div class="post-metadata">

**Author:** ![DigitalDreams](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/digitaldreams/32/16007_2.png) [@DigitalDreams](https://forum.clockworkpi.com/u/DigitalDreams)\
**Post date:** [May 5, 2025, 10:44pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/14 "2025-05-05T22:44:23Z")

</div>

Ran your test…

[16] Line Input #1, s$  
Error : line is too long

I’m on PicoMite\_PICORP2350\_V6.00.02RC20.uf2 by adcockm, not the RC21 with line break update…

---

<div class="post-metadata">

**Author:** ![thwill](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/thwill/32/9466_2.png) [@thwill](https://forum.clockworkpi.com/u/thwill)\
**Post date:** [May 5, 2025, 10:47pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/15 "2025-05-05T22:47:23Z")

</div>

> [@DigitalDreams](#):
>
> Ran your test…
> 
> [16] Line Input #1, s$  
> Error : line is too long

OK, that is very confusing, that error message is generated by the line continuation code which I don’t think should be getting invoked.

Have you tried disabling line continuation ?

Best wishes,

Tom

---

<div class="post-metadata">

**Author:** ![adcockm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adcockm/32/1664_2.png) [@adcockm](https://forum.clockworkpi.com/u/adcockm)\
**Post date:** [May 5, 2025, 10:49pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/16 "2025-05-05T22:49:50Z")

</div>

> [@thwill](#):
>
> However I also know that @adcockm “fixed” a PicoCalc specific bug with line-endings read from standard input using `INPUT` …

I just picked up that fix from Peter’s mainline changes.

But I see you found the issue with the “\_”. I turned off line continuation after trying it, since it already had one bug reported shortly after it was added. And it’s not on by default on PicoCalc though it can be turned on. Personally, i found it an… odd choice to dynamically change source code back and forth in the editor and assume that it wouldn’t break anything, especially when the underscore character presumably had no special meaning before, and could have been used by programs already. And your program is a perfect example. If official changes to the PicoMite code can break existing code so easily, it makes me question the long term stability of it. At least the line continuation is optional and can be turned off.

---

<div class="post-metadata">

**Author:** ![DigitalDreams](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/digitaldreams/32/16007_2.png) [@DigitalDreams](https://forum.clockworkpi.com/u/DigitalDreams)\
**Post date:** [May 5, 2025, 10:54pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/17 "2025-05-05T22:54:01Z")

</div>

> [@thwill](#):
>
> Have you tried disabling line continuation ?

That feature isnt in my version (RC20)

---

<div class="post-metadata">

**Author:** ![thwill](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/thwill/32/9466_2.png) [@thwill](https://forum.clockworkpi.com/u/thwill)\
**Post date:** [May 5, 2025, 10:55pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/18 "2025-05-05T22:55:15Z")

</div>

Both Visual Basic and FreeBASIC use an underscore as a line continuation character, but Peter’s implementation is idiosyncratic, as you say, you wouldn’t expect it to be reformatting the source (but I know why he has to do it).

> If official changes to the PicoMite code can break existing code so easily, it makes me question the long term stability of it.

It’s relatively rare but not unheard of, and we are currently in a very prolonged alpha/beta/rc phase.

Tom

---

<div class="post-metadata">

**Author:** ![thwill](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/thwill/32/9466_2.png) [@thwill](https://forum.clockworkpi.com/u/thwill)\
**Post date:** [May 5, 2025, 10:57pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/19 "2025-05-05T22:57:47Z")

</div>

> [@DigitalDreams](#):
>
> That feature isnt in my version (RC20)

Hmm … very true … I think we should wait a couple of days for another half-dozen release candidates to fly by 😉 .

Best wishes,

Tom

---

<div class="post-metadata">

**Author:** ![adcockm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/adcockm/32/1664_2.png) [@adcockm](https://forum.clockworkpi.com/u/adcockm)\
**Post date:** [May 5, 2025, 11:01pm UTC](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191/20 "2025-05-05T23:01:49Z")

</div>

> [@cjstoddard](#):
>
> And this is why I wait two or three revisions between upgrading firmware. I am hoping adcockm finds a nice stable RC of 6.00.02, does his thing with it, then stops trying to chase Peter and settles into a nice leisurely once a month update.

Since this is my first experience with a “release cycle” of PicoMite, I can only hope that it reaches some kind of stable state. It seems that even though these are RCs and the intention is to get to some final release, random new features keep being added that create more code churn and create new bugs. At this rate there doesn’t seem to be an end in sight, and while that might work for Peter and many PicoMite fans, at some point I’m going to burn out or lose interest, or both. This kind of frenzied development can be impressive, but to have a group of people expecting to rely on the latest bleeding edge release is unusual. And it also seems to require folks to rewrite their code when the system changes out from under them. Maybe that’s part of the reason to try to stay caught up, because required changes to existing programs would be even more drastic from one major release to the next?

In any case, i’m looking forward to a stable release as well!

I hesitated to even try to add the PicoCalc specific keyboard backlight and battery stuff, but that seemed pretty isolated and something people had been interested in.

[Next page](https://forum.clockworkpi.com/t/play-zork-on-picocalc-picomite/17191.md?page=2)
