The PC-1211 and the FX-702P in PockEmul: a 20-year wait, a new simulation framework

Their ROMs were never extracted, their processors are undocumented. After 20 years of waiting, PockEmul 2.11 rebuilds early-1980s pocket computers near 100 %: the Sharp PC-1211, now on a new simulation framework, and the Casio FX-702P.

Two pioneers out of reach

The Sharp PC-1211 and the Casio FX-702P are two pioneers of the pocket computers of the early 1980s. They are also two machines PockEmul could never emulate the usual way.

Most machines in PockEmul are emulated: PockEmul runs the original ROM on an emulated processor, so the machine behaves like the real one because it runs the real firmware. That needs the ROM, and a documented processor. For these two, neither exists: their ROMs have never been extracted, which is very hard to do, and their CPUs are undocumented.

For 20 years we hoped to get access to them. It never happened.

From a first simulator to a framework

About 10 years ago we took another road and wrote a simulator of the PC-1211: a program that behaves like the machine without running its ROM. The results were mixed. Reaching the quality of an emulator with a simulator is a real challenge. But the idea stayed: a simulation framework, built once and well, that would make the FX-702P possible, and maybe other machines one day.

After a lot of work, that framework is now a reality. The framework, born from the work on the PC-1211, made it possible to add the FX-702P; the PC-1211 now runs on it too.

Each machine is near 100 % rebuilt, with its user manual as the reference: every behaviour is checked by automated tests. Where the manual is silent, the choice made is written down, to be settled later on a real machine. The arithmetic is exact decimal arithmetic and programs are kept in the machine’s real program format, where the former PC-1211 simulator used binary floating point and its own line format. Behind the scenes, the simulated machines share a neutral core (decimal arithmetic, scientific functions, saving the machine’s state) and a BASIC engine; each new machine adds only its own rules to that shared, tested core, so it is faster to build.

The PC-1211, rebuilt

The PC-1211 (1980) that started it all now runs on the framework. PockEmul 2.10 offered the old simulator to subscribers as an experimental preview; the new one starts again from the manual, as a regular model:

  • the PC-1211’s own decimal arithmetic, 12 digits in calculations and 10 kept in memories, checked against a real machine and the manuals (INT(4.35*100) is 435, as on the real machine);
  • programs in the PC-1211’s own format, with exact step counts and MEM;
  • every statement of the manual, including USING, STOP / CONT and DEBUG, the RESERVE and DEF modes, and the manual’s error codes;
  • the CE-122 printer with its print mode: LIST and PRINT on its 16 columns;
  • the arrow keys repeat when held, as described in the manual;
  • the speed of a real PC-1211: 60 timed tests on one, all within 4.8 %;
  • the whole PC-1211 Applications Manual, 127 programs, ready to load from the Program menu; your own BASIC listings imported and exported as text;
  • sessions keep the whole machine, mode and angle unit included;
  • about 1,000 automated checks.

It replaces the experimental simulator in the catalogue. If you own the PC-1211, you keep it. Your sessions of the experimental simulator open on the new one: the program, the memories, the reserve keys and the CE-122 with its printed paper are carried over, a dialog lists anything that could not be (for example a line the real PC-1211 would refuse), and the original file is left unchanged until you save.

And the FX-702P joins PockEmul

The FX-702P (1981) is a BASIC-programmable calculator with a 20-character dot-matrix display, 1680 program steps in ten program areas P0-P9 and up to 226 memories. Fidelity was the goal:

  • Its own program format. Programs are stored byte for byte as the FX-702P stores them, so the step counter shows the same free steps as the manual’s examples.
  • Its own arithmetic. Calculations use 12-digit decimal numbers, displayed on 10 digits as on the real machine, not the binary floating point of a PC.
  • Its own keys. A cursor key held more than a second moves the cursor fast, as described in the manual; no other key repeats.
  • The whole manual. Manual calculations, the editor, the program statements, statistics, DEFM, passwords, TRACE, CSR and the PRT formats, with the machine’s ERR-1 to ERR-9 codes.
  • A familiar display. The 20 dot-matrix cells, the seven-segment step counter, the cursor and the busy mark reproduce those of a real FX-702P.
  • FP-10 printer. Connect the FP-10 to print listings, variables and results.
  • Programs ready to run. The whole Casio FX-702P program library, 73 programs in 9 chapters, loads from the Program menu, each program checked against the book’s step count; your own BASIC listings can be imported and exported as text.
  • Manuals at hand. The FX-702P Instruction Manual and the Program Library (in French) open from the pocket’s Documents menu.
  • Sessions. Reload a saved session and your programs, memories, mode and display are back.
  • Tested. More than 600 automated checks cover the FX-702P and the framework under it.

Coming next: cassette tapes

Both simulators are near-complete today: programs, the BASIC of the manual, the printer and saved sessions. Cassette tape support arrives in the next version of PockEmul, for every model that can use it (including the CE-121 of the PC-1211 and the FA-2 adaptor of the FX-702P): not only to save and load programs, but also to manage data files on tape.

The PC-1211 runs at the speed of a real PC-1211, measured on one; the FX-702P’s timings are approximate for now.

Availability

PockEmul 2.11 arrives in December on Android, iOS, Windows and macOS. The Sharp PC-1211 and the Casio FX-702P will be included with every PockEmul subscription, on every platform; on Android, each can also be bought on its own.

https://youtu.be/CyeKPNLDwgw

Leave a Reply

Your email address will not be published. Required fields are marked *