📜 ⬆️ ⬇️

System Shock source code is publicly available under the GPL

image

Exceptionally good news: the source code of the cult game System Shock (in the version for PowerMac) is officially released under the GNU General Public License v3.0 . The game was released in 1994 and written in C.

As it is known, the author of the original game, Studio Looking Glass Studios, ceased to exist in 2000 due to the crisis of the publisher Eidos Interactive - people from the studio later created new famous series Deus Ex and BioShock. The rights to the System Shock series were bought by Night Dive Studios, which is currently working on a remake of the original (whose development was frozen a month ago and the release was postponed for 2020 , despite the successful Kickstarter, which collected $ 1.35 million) and a full continuation of System Shock 3 The author of the original, Warren Spector, who has returned to the gaming industry for this, is taking part in the development.
')
You can pick up the source code from the link on Github . Successful compilation will require PowerMac or its emulator (for example, SheepShaver ), Metrowerks CodeWarrior 10 Tools and game data of the original game.

As usual, it was not without interesting findings - for example, a reference to a game designer working at Looking Glass Studios, Seamus Blackley , was already found.

// *******************HACK*HACK*HACK*HACK*****************************+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // uchar EDMS_Seamus_is_an_asshole[12000]; // *******************HACK*HACK*HACK*HACK*****************************+ // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 

Supposedly, there was a “hidden” allocation of almost 12KB of memory - just in case something goes not as planned closer to the release, and additional memory is urgently needed, because it will uncomment one line much faster than optimizing.

Next up are some more funny comments taken from the source code.

 // limit framerate while scrolling to avoid flicker? // should really do something real about flicker anyway. #define SCROLL_FRATE 90 

 // default units per second // in defiance of Rob, I use the number 13. #define MAP_SCROLL_SPEED 13 

 // why!!!! why at the end, why randomly, hate hate hate // Clear out requests for (i=open_track; i < MLIMBS_MAX_CHANNELS -1; i++) current_request[i].pieceID = 255; // was -1 

 #define ULTRA_GROSS_JOHN_MILES_HACK #ifdef ULTRA_GROSS_JOHN_MILES_HACK { #include <conio.h> if ((dev_info[MIDI_CARD]==GENMIDI)&&(dev_info[DIGI_CARD]==SOUNDBLASTERPRO2)) { int mod_loc=dev_info[DIGI_IO]; // loc, the io port to send too if (mod_loc==-1) mod_loc=0x220; // i know much secretness of destruction outp(mod_loc+4,0x83); // such that def io is 220, which AIL wont outp(mod_loc+5,0xb); // tell me till later, when we init it } // which we are not allowed to do yet } #endif 

 // wow is this a total mess, goddamn #define is_solid() \ ((_face_topedge[(me_tiletype(cv->mptr)<<2)]==0xff)|| \ (me_clearsolid(cv->mptr)&_face_topmask)|| \ (me_subclip(cv->mptr)&_face_topmask)|| \ (_face_botedge[(me_tiletype((cv->mptr+y_map_step))<<2)]==0xff)|| \ (me_clearsolid((cv->mptr+y_map_step))&_face_botmask)|| \ (me_subclip(cv->mptr+y_map_step)==SUBCLIP_OUT_OF_CONE)) // note how pretty this looks till you look at the is_solid macro bool _fr_skip_solid_right_n_back(FrClipVec *cv, fix max_loc, int y_map_step) { if (is_solid()) { cv->loc[0]&=0xffff0000; cv->loc[0]+=_fixp1; cv->mptr+=1; while (is_solid()&&(cv->loc[0]<max_loc)) { cv->loc[0]+=_fixp1; cv->mptr+=1; } } return (cv->loc[0]>=max_loc); } 

 ///// AAHRRHRHGGHGHG switch to secondary data cache!!! (...) // oh oh oh baby oh baby oh self modify height delta step baby now baby please // really, this wants to become the threaded nightmare assembler point coder from hell 

The original source code causes difficulties in reading due to line breaks (Mac OS systems prior to version 9 used the CR symbol instead of the more familiar LF / CR + LF). A readable fork with fixes is available here .

Source: https://habr.com/ru/post/352952/


All Articles