Fixing bugs using Bird on Palm OS


Tenohira Hanafuda Kai (掌花札 kai) is a koi-koi card game for Palm OS, created in 2001 by Hiroki Takahashi. It’s a fun game with varying difficulty, stats tracking, and lovely high-resolution (for the time!) colour graphics.

But, it has one serious problem: sometimes it will forfeit the current round when you choose to continue!



After repeated play I figured out that the game would continue as intended only if I pressed the right half of the こいこい (koi-koi) button.

But if I pressed the left half of the button it would not behave as expected and forfeit the round. More on that later.


The Plan

One of the beautiful things about Palm OS is that apps and their resources are viewable, and even editable, right there on the device itself! It’s a lot like Classic Macintosh in that regard, which is no surprise as Palm took a lot of inspiration from the original Mac.

And much like ResEdit on Macintosh, Palm had it’s own equivalent app in RsrcEdit by Quartus, though I preferred to use an app called Bird by Philippe Guillot. You can view strings, bitmaps, menu bars, and other user interface elements (organised as Forms).

Let’s do this

So I launched Bird and loaded up the contents of Tenohira Hanafuda Kai, and went through all the forms until I found the one that displays the continue prompt.

Interestingly the form is dual-purpose. It contains the continue/stop buttons (a List of two items) and also a single button (了解; confirm) used on a different prompt. It’s overlaid on the continue button in a close enough position to be suspect. Perhaps it’s moved slightly at run time?

We can easily change the order of the controls on the form by cutting and pasting, so we do that with the List and it now comes below the button in the order and will be drawn last on the screen. Presumably the things drawn last are the first to capture interactions? Let’s see.



I apply all changes and they are saved directly into the app data. Launching the game again and playing enough to trigger another continue/stop prompt, I tap the left half of the button and… the game continues as expected. There is no strange forfeit. The problem has been solved!



I figured this out back in 2019 and edited the app on my Sony CLIÉ device. Recently I’ve been using CloudPilot to run Palm OS apps and games on my iPhone. So to play Tenohira Hanafuda Kai I had to either find the old modified game file, or do it all over again from scratch. I chose to do it again to test my memory and so I could document the process.

Enjoyed this blog post? Please show your support.
Comments: @gingerbeardman