How to detect MCoder II games?

This is the place for general discussion and updates about the ZXDB Database. This forum is not specific to Spectrum Computing.

Moderator: druellan

User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

How to detect MCoder II games?

Post by druellan »

WIP list of titles we are reviewing. We have also some Hisoft Colt compiler titles in the list
EDIT: we also detected several Colt compiled games.



Since some time now, I'm going back to this report by goodboy
goodboy wrote: Mon Dec 27, 2021 7:03 am all game from Shaw brothers use MCoder2 (compiled basic + some code SubRoutine)
...........
and strategy games from Astros
The issue I have is that I don't have any way to quickly confirm that, game by game: the games don't have any obvious text signature in the code, and I don't know if the encoder requires some kind of copyright notice to be visible in the manuals, but for example, I don't see anything in Aquasquad that is already marked as using MCoder II (https://spectrumcomputing.co.uk/entry/230/).

I need to keep looking for interviews, to see if they mention the fact somewhere, but for a start, in Aquasquad 'CERIUS', 'GUNFIGHTER' and 'TANK COMMAND' are mentioned, so, there is a good chance those games are also MCode II.
Something like a hex string to search inside the binary can be very helpful, specially for other games like the Astos Software strategy ones.

Anyone has more information? Thanks!
✓ Reviewed
marenja
Microbot
Posts: 108
Joined: Sun Dec 26, 2021 4:15 pm

Re: How to detect MCoder II games?

Post by marenja »

druellan wrote: Sun Jan 07, 2024 2:09 pm The issue I have is that I don't have any way to quickly confirm that, game by game: the games don't have any obvious text signature in the code
The main idea is to seek for MC2 runtime library above 60000 address. I have investigated this question a bit. But I need to find my notes.
sn3j
Manic Miner
Posts: 500
Joined: Mon Oct 31, 2022 12:29 am
Location: Germany

Re: How to detect MCoder II games?

Post by sn3j »

From the instructions:
  • MCODER must also be saved as it contains several runtime routines which the compiled code needs to run properly.
  • The compiler stretches from 59990 to 65368...
  • The address of the variables used by MCODER can be listed with a routine starting at location 65240.
POKE 23614,10: STOP      1..0 hold, SS/m/n colors, b/spc toggle
User avatar
Turtle_Quality
Manic Miner
Posts: 506
Joined: Fri Dec 07, 2018 10:19 pm

Re: How to detect MCoder II games?

Post by Turtle_Quality »

Don't forget MCODER II came in 16K and 48K flavours, there are some 16K games out there too
Definition of loop : see loop
User avatar
Pobulous
Dynamite Dan
Posts: 1366
Joined: Wed Nov 15, 2017 12:51 pm

Re: How to detect MCoder II games?

Post by Pobulous »

Look for text containing Threlfall and Hodgson just above 60000 for 48K games.

I picked out quite a few in another thread somewhere.
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: How to detect MCoder II games?

Post by druellan »

The issue I have with the string search is that there is no copyright notice inside Aquasquad's TAP/TZX or doing a memory dump. So, I can't use it to validate the claim that all Shaw Brothers games use MCoder II.
Astros Software also does not seem to have any obvious signature, at least looking at Zulu War, Nato Assault or Vikings.

So, might be the case those games don't use MCoder II or might be the case there is a way to completely obfuscate the runtime library. That's basically why I'm still going around this report.

Besides, all that is really useful information, because I plan to do a massive search on the gamebase and extract all the games I can find that have a clear copyright notice inside.
marenja
Microbot
Posts: 108
Joined: Sun Dec 26, 2021 4:15 pm

Re: How to detect MCoder II games?

Post by marenja »

druellan wrote: Mon Jan 08, 2024 2:40 pm The issue I have with the string search is that there is no copyright notice inside Aquasquad's TAP/TZX or doing a memory dump.
So, might be the case those games don't use MCoder II or might be the case there is a way to completely obfuscate the runtime library.
You could not obfuscate MCoder II runtime library after game is started but you could obfuscate game on tape before game is loaded to RAM. So tape image files like TAP/TZX could contain no visible text you search for if game was protected or/and compressed. You should seek RUNTIME of mcoder2 but not copyright signature.

mc2 occupies RAM starting from 60000 up to UDG. So you should compare mc2 snapshot with game snapshot. Use any uncompressed file format - SNA is uncompressed, but Z80 is compressed. I use 48K SNA file which is 49179 bytes long.

Save snapshot after MC2 is loaded and then save second shapshot after the game you are inspecting was started.
Snapshot contains RAM but not ROM. So addresses in SNA file are moved down comparing to ZX RAM.
60000 - 16384 = 43616 or 0xAA60. That is address in SNA file where MCoder II should start. So you should compare files in binary mode and look addresses starting from 0xAA60.

In my case it is Cerius. I use WinMerge which shows differences as orange and matched parts as white.
Image

First white section AA60-AB30 is changed with orange one and you see copyrights there (red frame) - in MC2 file but not in Cerius game. That's why you have good chance to make wrong conclusion if you just look for any copyright inside game.

But second white section 0xABD0 and everything down to address BF70 is the same for both SNA files (green frame). And that means Cerius contains 5024 bytes of mcoder2 RUNTIME library.

Next screenshot for Interalia (Cerius 2) shows greater orange section AB30-AD30 but still everething with higher addresses AD30-BF70 matches for this game and mcoder2 - 4672 bytes.
Image

druellan wrote: Mon Jan 08, 2024 2:40 pm Astros Software also does not seem to have any obvious signature, at least looking at Zulu War, Nato Assault or Vikings.
Zulu surely does contain mc2 runtime.
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: How to detect MCoder II games?

Post by druellan »

Thanks, this is great!
First white section AA60-AB30 is changed with orange one and you see copyrights there (red frame) - in MC2 file but not in Cerius game. That's why you have good chance to make wrong conclusion if you just look for any copyright inside game.
Exactly what I was thinking: it is easy to just remove the text, so, between the loader compression/obfuscation and the fact that the developers can pretty much remove the copyright notice, searching for that alone is going to leave a bunch of games out for sure.

My intention is to deal with compression/obfuscation later, and for now just find some magic hex string that allow us to scan the collection and see what we can find.
Zulu surely does contain mc2 runtime.
I need a better hex string then, I'm using

Code: Select all

2b 36 00 3e 21 2a 1b eb cd 74 f1 2e 0e 3a 19 eb
That matches Cerius, Nato Assault and Solar Flare, but not Zulu or Aquasquad.
User avatar
SkoolKid
Manic Miner
Posts: 407
Joined: Wed Nov 15, 2017 3:07 pm

Re: How to detect MCoder II games?

Post by SkoolKid »

Pobulous wrote: Mon Jan 08, 2024 9:00 am Look for text containing Threlfall and Hodgson just above 60000 for 48K games.
Just for fun I did this on the (13422 at the time of writing) snapshots produced by the t2sfiles repo, and these 188 matches showed up:
✓ Reviewed
SkoolKit - disassemble a game today
Pyskool - a remake of Skool Daze and Back to Skool
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: How to detect MCoder II games?

Post by druellan »

NICE!! We have the starting list!
User avatar
+3code
Manic Miner
Posts: 433
Joined: Sat Mar 19, 2022 7:40 am

Re: How to detect MCoder II games?

Post by +3code »

druellan wrote: Thu Jan 11, 2024 7:28 pm NICE!! We have the starting list!
Some of them (like Fantomasa and Super Sudoku) are listed as

Authored with:
HiSoft COLT Compiler

Maybe the COLT and MCoder II are the same?
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: How to detect MCoder II games?

Post by druellan »

Might be also a mistake, we don't know why they are marked. For example, Yength is already (correctly) tagged as MCoder II. But let's see, I'm building the initial list to check what we already have in the DB.
User avatar
lexi
Dizzy
Posts: 63
Joined: Mon Dec 04, 2023 10:55 pm
Contact:

Re: How to detect MCoder II games?

Post by lexi »

The Colt is a new BASIC compiler from HiSoft, previously well-known for their Spectrum Pascal package. Colt is a fourth generation program, descended from ZX-GT, Mcoder 1, and Mcoder 2, reviewed last issue. Rather confusingly, Mcoder 3 (which we look at later) is an entirely new program.
https://www.crashonline.org.uk/20/compilers.htm
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: How to detect MCoder II games?

Post by druellan »

Confirmed, at least in this case the Colt compiler has the same copyright notice as MCoder II, meaning, we can't rely on the message alone to match exclusively MCoder II.

Image

That's a bummer. On the plus side, we can probably match some Colt titles.

ALSO: the WIP list is available on the first message.
User avatar
SkoolKid
Manic Miner
Posts: 407
Joined: Wed Nov 15, 2017 3:07 pm

Re: How to detect MCoder II games?

Post by SkoolKid »

For what it's worth, here are the 121 game snapshots from the list of 188 I originally posted (containing the text string 'THRELFALL and HODGSON') that also contain the byte string 2b36003e212a1bebcd74f12e0e3a19eb:
Of these, all except Exotron, Mapsnatch, Peking and Yenght have the byte string at ED11-ED20 (60689-60704).
✓ Reviewed
SkoolKit - disassemble a game today
Pyskool - a remake of Skool Daze and Back to Skool
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: How to detect MCoder II games?

Post by druellan »

Excellent! I also confirmed a bunch myself, I think we have a pretty decent list.
marenja
Microbot
Posts: 108
Joined: Sun Dec 26, 2021 4:15 pm

Re: How to detect MCoder II games?

Post by marenja »

SkoolKid wrote: Mon Jan 15, 2024 12:12 pm For what it's worth, here are the 121 game snapshots from the list of 188 I originally posted (containing the text string 'THRELFALL and HODGSON') that also contain the byte string 2b36003e212a1bebcd74f12e0e3a19eb:
Of these, all except Exotron, Mapsnatch, Peking and Yenght have the byte string at ED11-ED20 (60689-60704).
What tool do you use to search HEX ?
druellan wrote: Sun Jan 07, 2024 2:09 pm WIP list of titles we are reviewing. We have also some Hisoft Colt compiler titles in the list
Are we going to add to check list all games from the Shaws as we state they have often used MCoder 2? It is very possible that creators continue to use compiler they have already used earlier. Will you add 'creator' column to googledocs?

BTW they have distinct number of linked games:
Graham D. Shaw - 46
David A. Shaw - 21
Adrian R. Shaw - 20
User avatar
SkoolKid
Manic Miner
Posts: 407
Joined: Wed Nov 15, 2017 3:07 pm

Re: How to detect MCoder II games?

Post by SkoolKid »

marenja wrote: Tue Jan 16, 2024 1:02 am What tool do you use to search HEX ?
I use SkoolKit's snapinfo.py. The -f option searches for byte sequences, and the -t option searches for text.
SkoolKit - disassemble a game today
Pyskool - a remake of Skool Daze and Back to Skool
User avatar
Turtle_Quality
Manic Miner
Posts: 506
Joined: Fri Dec 07, 2018 10:19 pm

Re: How to detect MCoder II games?

Post by Turtle_Quality »

Between @SkoolKid 's list of 188 and following list of 121 I see that both Light Cycles by PSS and Mazeball went missing ?

I went back and checked, though Light Cycles was 16K, Mazeball was 48K - completely unnecessary but might have been done to improve the sound FX

In the course of my search I saw this link, page 14 declared the winner and runner-up of the PSS Competition for best game using MCODER back in 1983

https://dn790006.ca.archive.org/0/items ... p_1983.pdf

I had entered Mazeball for that competition, it didn't win but was picked up by PSS for publishing by a new sister company called Wildest Dreams (so it's likely their other games were compiled).

Anyway my point is surely the winning games must be MCODER based - Elektro Storm and Panic

Ahem - now I see that the copyright text is there in Mazeball and I was using MCODER version 1.
Definition of loop : see loop
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: How to detect MCoder II games?

Post by druellan »

marenja wrote: Tue Jan 16, 2024 1:02 am What tool do you use to search HEX ?
I'm using Total Commander, that has the nice addition to be able to go into zip files. Right now I'm running it in a full WOS archive backup, but my intention is to run it on TOSEC. The issue with this method is that is not able to unpack loaders, but so far my findings are pretty close to Skoolkids's so, I think it is good enough.
marenja wrote: Tue Jan 16, 2024 1:02 am Are we going to add to check list all games from the Shaws as we state they have often used MCoder 2?
Yes, for sure, since the claim was that all the games use MCoder II, but right now I was able to confirm only a bunch. I can give you access to the spreadsheet if you want to take a look an add notes. The big issue we have is really Aquasquad, that is marked in the ZXDB as MCoder II, but I can't confirm it.

And BTW, I very intrigued by Cybex (https://spectrumcomputing.co.uk/entry/1202) does not look like compiled basic, or it is a false positive or the author used MCoder II to compile the main menu, and the rest is pure MC.

Thanks for the contributions everyone, the list is looking almost ready to produce a patch for the database, just a couple of iterations more.
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: How to detect MCoder II games?

Post by druellan »

Turtle_Quality wrote: Tue Jan 16, 2024 3:12 pm In the course of my search I saw this link, page 14 declared the winner and runner-up of the PSS Competition for best game using MCODER back in 1983
[...]
Anyway my point is surely the winning games must be MCODER based - Elektro Storm and Panic
[...]
Ahem - now I see that the copyright text is there in Mazeball and I was using MCODER version 1.
Thanks for taking a look and yes, we need for sure do the same for MCoder I and also the Colt compiler. There is also the Super Compilatore - Softwell, that seems to be a non-official italian version of the MCoder II, not sure if worth to add it to the database so we can flag the games.
User avatar
MatGubbins
Dynamite Dan
Posts: 1239
Joined: Mon Nov 13, 2017 11:45 am
Location: Kent, UK

Re: How to detect MCoder II games?

Post by MatGubbins »

Just to confirm, I'm the author of - 35687 Super Sudoku Solver this was compiled with
https://spectrumcomputing.co.uk/entry/8 ... T_Compiler

If you load in my program (48k mode only) and the breaking into the program - Caps shift and space - then typing in
RANDOMIZE USR 60000 to start compiling the basic loader (it will fail) you can see the version that has been used.

If needed again and as mentioned in this topic
viewtopic.php?p=77196#p77196

A list of my own stuff that has been compiled with the same HiSoft Colt compiler
and they have already been added to the 'Programs authored (or executed) with this title' section of the Hisoft compiler page.

Escape II - Some Years Later - https://spectrumcomputing.co.uk/entry/2 ... ears_Later
Gunfright - The Map Editor - https://spectrumcomputing.co.uk/entry/2 ... Map_Editor
Laser Squad - The Map Editor - https://spectrumcomputing.co.uk/entry/2 ... Map_Editor
Martianoids - The Map Editor - https://spectrumcomputing.co.uk/entry/1 ... Map_Editor
Nightshade - The Map Editor - https://spectrumcomputing.co.uk/entry/2 ... Map_Editor
RebelStar - The Map Editor - https://spectrumcomputing.co.uk/entry/2 ... Map_Editor
Super Sudoku Solver - https://spectrumcomputing.co.uk/entry/3 ... oku_Solver
[CSSCGC] One Life Invaders - https://spectrumcomputing.co.uk/entry/3 ... e_Invaders
[CSSCGC] Clint and da Crabs - https://spectrumcomputing.co.uk/entry/3 ... d_da_Crabs

All must be loaded in 48k mode only, otherwise they will crash.
✓ Reviewed
User avatar
Einar Saukas
Bugaboo
Posts: 3145
Joined: Wed Nov 15, 2017 2:48 pm

Re: How to detect MCoder II games?

Post by Einar Saukas »

druellan wrote: Wed Jan 17, 2024 10:56 am There is also the Super Compilatore - Softwell, that seems to be a non-official italian version of the MCoder II, not sure if worth to add it to the database so we can flag the games.
About Super Compilatore: does it have relevant differences from MCoder II, or only cosmetic changes (like different loader or some modified messages)? If it's the latter, then it will simply have the same ID.
User avatar
druellan
Dynamite Dan
Posts: 1475
Joined: Tue Apr 03, 2018 7:19 pm

Re: How to detect MCoder II games?

Post by druellan »

Einar Saukas wrote: Wed Jan 17, 2024 7:44 pm About Super Compilatore: does it have relevant differences from MCoder II, or only cosmetic changes (like different loader or some modified messages)? If it's the latter, then it will simply have the same ID.
Since it is MIA, I'm not sure, but seems to be the same software just translated and with the copyright notice changed, that's why I'm kind of hesitant to add it.

@Alessandro (Hi) do you know something about it?

So far we know the tool was used to compile almost all the games by D. Felaco https://spectrumcomputing.co.uk/list?label_id=8659 the code seems to be identical to MCoder II, and the copyright notice has also the same structure:

This is the copyright string inside the games

Code: Select all

SUPER COMPILATORE            1985  ***** SOFTWELL *****    COMPILATO !   Lung.PROGRAMMA =  bytes   Per partire  RAND USR
And the original on MCoder II compiled software:

Code: Select all

ZX COMPILER  V2.0            1983 THRELFALL and HODGSON    Compiled OK   Program Length =  bytes   To run enter RAND USR
User avatar
Einar Saukas
Bugaboo
Posts: 3145
Joined: Wed Nov 15, 2017 2:48 pm

Re: How to detect MCoder II games?

Post by Einar Saukas »

I think that's enough evidence to add Super Compilatore as a translated re-release of MCoder II.

I will add it in the next ZXDB release.
Post Reply