SOKOBAN

As - up to now - last try of a de-compilation I used the game SOKOBAN. I found this game in Software-Archiv des KC-Clubs", paragraph CP/M-Spiele" ( Also on this site resides the game SLIDER. A hint for that may be found here ). Also this game was compiled into a .COM file using TURBO PASCAL 3.x. Referring to de-compilation look for some hints as described for QUATRIS.

At first here the de-compilation of the original program with special ESCape sequences used by the KC machine.

The main problem was to adapt the grafic routines. I reverted to routines published in the German article Turbo-Grafik für den JOYCE. Here the result, resolved into three files:

Hint: The grafics is coded as an assembler routine, residing in the Common Memory of the JOYCE. Without modification this program does not work on ther CP/M machines. (The routine is taken from the article above with some modifications). The following entry points exist:
  • _PLOT found at $F400, used by the procedure Plot (as GX_Dot), accessing a pixel within video memory through parameters.
  • _CLRGRAF found at $F462, used by the procedure CLRGRAF (as GX_Clr), deleting the entire screen.
  • _X found at $F410, defining the memory address for a 16 bit horizontal coordinate (as GX_X).
  • _YM found at $F412, defining the memory address for an 8 bit vertical coordinate (as GX_Y).
  • _YM+1 found at $F413, defining the access mode for a pixel (as GX_M). (The program uses only a value of 0 (set pixel) and 1 (reset pixel)).
Before using them, the grafic routines will be moved into Common Memory (by the routine GraphInit).

If you wish to compile the game keep in mind: a .COM file must be created. Due to the address of _PLOT ($F400) the end address for the compiler should be $F3FF or less.

A final hint: ASCII files will be used for creating different game boards. Every files holds up to five board layouts. If a level is choosen one of these files will be read and a board will be created. The files are named SOKO-x.PIC with x in range from 0 up to 11 ( [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] ).
An information relating SOKOBAN may be found in Wikipedia, the free encyclopedia.
For bringing you into the right mood find below two possible opening screens: