Printed Amstrad Addict magazine announced, check it out here!

Main Menu

|cpm: why? (Can someone explain how CPM loaders work for games?)

Started by cwpab, 18:23, 23 January 24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


35 years after I entered my first "|cpm" command to load a CPC6128 game when "cat" returned an error, I think it's time to finally understand what was going on with that.

The only additional knowledge I learned over the years was the existence of the CPM OS, which for some reason I tried myself on an emulator some years ago (maybe it was the curiosity, I don't think I was doing anything with that). Nice gray backround and higher res black fonts, reminded me a bit of MS-DOS.

But I still don't understand why quite a few games use the so called "CPM loaders" to load instead of the regular commands. As I just learned (and following simpel logic), the CPM OS is not included in these disks: way too big. And someone suggested that for some reason, developers were using the comand to make the CPC believe it was loading the CPM OS, when it was actually loading the game. Maybe this allowed them speeding up the loading or freeing up more RAM.

If that's the case, one would assume perhaps they would simply rename their executable file to the name of CPM, but there clearly is more: you can't browse files with CAT, you can't browse files with |dir, you can't browse files with dir even after loading CPM itself in its own disk and you can't browse files using the ManageDsk Windows application: all these methods return an error.

What is going on here? It's obvious developers are using some kind of special format for these disks that somehow uses a "CPM method" of loading the games, whatever that is. Can someone shed some light on this?


see this :

extract :
;; The boot sector is located on track 0, side 0,sector &41, and
;; is executed with a |CPM command. A maximum of 512 bytes will be loaded to &100
;; in RAM. This sector *must* exist for the disc to be started with the |CPM command.
;; If the disc is formatted to SYSTEM or VENDOR format, then the directory
;; will start on track 2, side 0, sector &41. Otherwise, the disc may use
;; a custom format for the remainder of track 0 and subsequent tracks.
;; If a directory doesn't exist, then you must use sector read/write functions to load
;; data.
;; The boot sector is loaded to &100 in memory and executed.

So some game developer use this format (or the CP/M system) to code their games.
Or it's useful to protect a loader or for the end user, it can be shorter than typing RUN"DISK for example !


|CPM does not have to do anything with CP/M. |CPM just loads and executes the boot sector on a disk. The CPC doesn't care if that code then really starts CP/M or any other code. 

A better name for it would be e.g. |BOOT .

I always hated that way of running a game. I always forgot and then had to wait until I get the error message after CAT - to then start the game with the right command. 


Quote from: eto on 19:52, 23 January 24I always hated that way of running a game. I always forgot and then had to wait until I get the error message after CAT - to then start the game with the right command.


What really sucked was the fact, that |CPM is only working from drive A.
I never added an ABBA switch to my original machine, so for such games and even demos (at this time it was "cool", if a demo had to be started with |CPM ) I had to copy it onto expensive 3" discs.



ABBA switch is useful and not expensive. So why you hate it?
CPC+PSX 4ever

Powered by SMFPacks Menu Editor Mod