tschak909 Posted May 18 Share Posted May 18 Were some games for the #ColecoVision written in #Pascal? Instead of speculation, Let's validate this assertion by using a quick tool I wrote to check for calls to the #Pascal routines documented in the Programmers Guide and OS Listing. #retrogaming 6 Quote Link to comment Share on other sites More sharing options...
Crapahute Posted May 18 Share Posted May 18 Very interesting. Thank you. Quote Link to comment Share on other sites More sharing options...
Captain Cozmos Posted May 19 Share Posted May 19 (edited) I have disassembled a &&&& load of original Colecovision games and have already discovered plenty of pascal calls. I would have to go through the code to give an accurate listing but off the top of my head Smurf Rescue I believe was one of them. edit.... I just checked and both Smurf Rescue and Donkey Kong 24k both use Pascal entry points. Does this mean they were written in pascal? No clue but the Pascal BIOS calls are abundantly clear. Edited May 19 by Captain Cozmos 1 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 19 Author Share Posted May 19 6 minutes ago, Captain Cozmos said: I have disassembled a &&&& load of original Colecovision games and have already discovered plenty of pascal calls. I would have to go through the code to give an accurate listing but off the top of my head Smurf Rescue I believe was one of them. edit.... I just checked and both Smurf Rescue and Donkey Kong 24k both use Pascal entry points. Does this mean they were written in pascal? No clue but the Pascal BIOS calls are abundantly clear. Yes. -Thom Quote Link to comment Share on other sites More sharing options...
Captain Cozmos Posted May 19 Share Posted May 19 (edited) Smurf.zip recompile it with a drag and drop on TNIASM I also set this to bypass the Colecovision logo screen, strait to player select. Great work BTW.... You actually have tools but I found these totally by accident. Find more and I'll de-compile when I get some time. Edited May 19 by Captain Cozmos Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 19 Author Share Posted May 19 There may be others, but I explicitly look for CALL instructions. -Thom Quote Link to comment Share on other sites More sharing options...
Captain Cozmos Posted May 19 Share Posted May 19 1 minute ago, tschak909 said: There may be others, but I explicitly look for CALL instructions. -Thom One of these days I will do a complete Zaxxon and let you know if it has a deep pascal connection. That seems to be the holy grail of Colecovision games. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 19 Author Share Posted May 19 find-pascal returns the following for Zaxxon: thomc@TMA-2:~/Workspace/tnfs-backup/Coleco Adam/Games/ColecoVision/Z$ find-pascal Zaxxon\ \(1982\)\ \(Coleco\).rom Zaxxon (1982) (Coleco).rom: WRITE_VRAMP so it's a maybe. It may have been at one point, but converted to assembler, with this routine remaining, or maybe it was more convenient to have the arguments in pascal order at this point in the code. -Thom Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 19 Author Share Posted May 19 46 minutes ago, Captain Cozmos said: Smurf.zip 21.73 kB · 2 downloads recompile it with a drag and drop on TNIASM I also set this to bypass the Colecovision logo screen, strait to player select. Great work BTW.... You actually have tools but I found these totally by accident. Find more and I'll de-compile when I get some time. Thank you, I wrote the tool, myself. The source code: /** * @name find-pascal * @brief a tool to scan Coleco game cartridges for Pascal vector usage * @author Thomas Cherryhomes * @email thom dot cherryhomes at gmail dot com */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> /** * @brief Pasca functoins detected? */ bool hasPascalFuncs = false; /** * @brief Vector table with function names */ struct _vectorTable { unsigned short addr; char name[32]; } vectorTable[] = { {0x1F64, "ACTIVATEP"}, {0x1F67, "PUTOBJP"}, {0x1F8B, "INIT_TABLEP"}, {0x1F8E, "GET_VRAMP"}, {0x1F91, "PUT_VRAMP"}, {0x1F94, "INIT_SPR_ORDERP"}, {0x1F97, "WR_SPR_NM_TBLP"}, {0x1F9A, "INIT_TIMERP"}, {0x1F9D, "FREE_SIGNALP"}, {0x1FA0, "REQUEST_SIGNALP"}, {0x1FA3, "TEST_SIGNALP"}, {0x1FA6, "WRITE_REGISTERP"}, {0x1FA9, "WRITE_VRAMP"}, {0x1FAC, "READ_VRAMP"}, {0x1FAF, "INIT_WRITERP"}, {0x1FB2, "SOUND_INITP"}, {0x1FB5, "PLAY_ITP"} }; bool hasPascalFuncs; int main(int argc, char *argv[]) { if (argc < 2) { printf("%s <filename>\n",argv[0]); return 1; } FILE *fp = fopen(argv[1],"rb"); if (!fp) { perror(argv[0]); return 1; } while (!feof(fp)) { unsigned char b = fgetc(fp); if (b == 0xCD) // CALL { unsigned short a; fread(&a,sizeof(unsigned short),1,fp); for (int i=0;i<17;i++) { if (a == vectorTable[i].addr) { if (hasPascalFuncs == false) { printf("%s:\n",argv[1]); hasPascalFuncs=true; } printf("\t%s\n",vectorTable[i].name); } } } } if (hasPascalFuncs == true) printf("\n"); fclose(fp); return 0; } -Thom Quote Link to comment Share on other sites More sharing options...
Captain Cozmos Posted May 19 Share Posted May 19 If you found only one pascal entry point in Zaxxon then that is all there will be. Your tool is very thorough. 3 of my kids and grandson are coming in this weekend for their sisters graduation from HS so I can't promise a Zaxxon disassembly right away but I will get to it. Because I have to scour through every inch of the code to identify tables and such I have learned a great deal of Z80 assembly language so this is homework/refresher course. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted May 19 Share Posted May 19 Any chance we'll discover the Pascal dev kit someday? It would be amazing to have as another option besides asm and C. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 19 Author Share Posted May 19 2 minutes ago, Gemintronic said: Any chance we'll discover the Pascal dev kit someday? It would be amazing to have as another option besides asm and C. Well, the environment itself is the 64000 development system, its editor, and the pascal and c compilers. As part of that, there were bindings to marshal parameters to the calls in the jump table in the OS7 ROM. There was a graphic editor (which has been found and released) but otherwise, that's pretty much it. There's not much magic to it. -Thom Quote Link to comment Share on other sites More sharing options...
leaded solder Posted May 19 Share Posted May 19 It is sort of surprising that they went back and rewrote Donkey Kong, and now I wonder what versions I have. I guess being able to shove it onto a smaller ROM IC must have paid for that work and then some. Quote Link to comment Share on other sites More sharing options...
ChildOfCv Posted May 20 Share Posted May 20 The Pascal stuff is pretty wasteful of CPU resources. The C routines pass args in and out through register calling convention. Pascal uses the stack exclusively. They wrote a generic function that all the P-versions of the calls would call to then pop the args off the stack, store them into the appropriate registers, and then fall through to the C version of the code. So other than the "thrill" of using Pascal, I see no reason to use those calls. I was quite surprised to see that my DK cartridge used it. 1 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 20 Author Share Posted May 20 Just now, ChildOfCv said: The Pascal stuff is pretty wasteful of CPU resources. The C routines pass args in and out through register calling convention. Pascal uses the stack exclusively. They wrote a generic function that all the P-versions of the calls would call to then pop the args off the stack, store them into the appropriate registers, and then fall through to the C version of the code. So other than the "thrill" of using Pascal, I see no reason to use those calls. I was quite surprised to see that my DK cartridge used it. Correct. I've been slowly piecing together enough of a 64000 environment to show how things were done at COLECO, but it will probably take me a few more years to get the missing bits (e.g. the 64800 compilers option) There was an initial decision to try and use Pascal at Coleco to quickly speed up game development. They had an idea of using e.g. high school or college interns to write the game code, this way. But it didn't work out. While the code was definitely fast enough, both the density of the compiled code, and the function call overhead ultimately meant that COLECO were going to lose money needing to produce additional ROMs to hold the data. --- ON ANOTHER POINT --- One thing I want to try to demonstrate at some point, is to demonstrate how OS7's display object management code worked, and how it resulted in making complex spite and tile interactions easier to program, as almost no code today uses these routines, and there are no visible examples of it. (I know, I can hear those of you screaming at me saying "WHY BOTHER?!" This is all in the spirit of preserving knowledge and historical context) -Thom 3 Quote Link to comment Share on other sites More sharing options...
youki Posted May 21 Share Posted May 21 Did you scan Cosmic Avenger? I think it has been the first game developped for the colecovision as proof of concept. May be it is before they decided to code in pascal.. Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 21 Author Share Posted May 21 6 minutes ago, youki said: Did you scan Cosmic Avenger? I think it has been the first game developped for the colecovision as proof of concept. May be it is before they decided to code in pascal.. Yes, as I have stated before, I scanned my entire collection at once, and your assertion of it being the proof of concept may not be correct. thomc@TMA-2:~/Workspace/tnfs-backup/Coleco Adam/Games/ColecoVision/C$ find-pascal Cosmic\ Avenger\ \(1982\)\ \(Coleco\).rom thomc@TMA-2:~/Workspace/tnfs-backup/Coleco Adam/Games/ColecoVision/C$ -Thom Quote Link to comment Share on other sites More sharing options...
youki Posted May 21 Share Posted May 21 33 minutes ago, tschak909 said: Yes, as I have stated before, I scanned my entire collection at once, and your assertion of it being the proof of concept may not be correct. thomc@TMA-2:~/Workspace/tnfs-backup/Coleco Adam/Games/ColecoVision/C$ find-pascal Cosmic\ Avenger\ \(1982\)\ \(Coleco\).rom thomc@TMA-2:~/Workspace/tnfs-backup/Coleco Adam/Games/ColecoVision/C$ -Thom It is what i read in an interview from the developper of Cosmic Avenger few years ago. I don't remember where i read it however. May be in one of retrogamer magazine issue. Lot of believe that Donkey kong was the first game developped for the colecovision but in fact it is Cosmic Avenger. (at least it is what that stated in the article). Quote Link to comment Share on other sites More sharing options...
ColecoFan1981 Posted May 21 Share Posted May 21 (edited) Could this talk of Pascal being wasteful on resources be the reason why both Donkey Kong and Smurf Rescue were later re-released as 16K ROM carts? I know Smurf Rescue was cleaned up first, as very few 24K ROM carts exist (at least one was known to exist in Canada!), but Donkey Kong wasn't cleaned up until early 1983, around the time its sequel Donkey Kong, Jr. was released for the console. ~Ben Edited May 21 by ColecoFan1981 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted May 21 Author Share Posted May 21 3 minutes ago, ColecoFan1981 said: Could this talk of Pascal being wasteful on resources be the reason why both Donkey Kong and Smurf Rescue were later re-released as 16K ROM carts? I know Smurf Rescue was cleaned up first, as very few 24K ROM carts exist (at least one was known to exist in Canada!), but Donkey Kong wasn't cleaned up until early 1983, around the time its sequel Donkey Kong, Jr. was released for the console. ~Ben it was a simple cost reduction, an additional ROM is a significant hit on bill of materials. -Thom Quote Link to comment Share on other sites More sharing options...
NIAD Posted May 21 Share Posted May 21 6 hours ago, youki said: Did you scan Cosmic Avenger? I think it has been the first game developped for the colecovision as proof of concept. May be it is before they decided to code in pascal.. As far as everything that has been shared, Cosmic Avenger was indeed the first CV game that was developed as a proof of concept. As far as what I’ve heard, Coleco partnered with Nuvatec to complete the CV and more importantly make it easily expandable with the idea of expansion into a full fledged computer. I forget the rest of the details re if a Coleco or Nuvatec programmer wrote Cosmic Avenger, but again it was reported as being the first CV game. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.