• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Getting back on the game programming engine (system 6- target)

Mu0n

Well-known member
I made a few dozen example programs as learned the Mac Toolbox in C (with THINK C) back in 2004-2005. I managed to delve in the wonderful world of the Sound Driver, windows mangement, event management, offscreen blitting, VBL timers, etc. None of it was unified into a real game, but I'm trying to get back to it.

Meanwhile, across my hundreds of hours of searches online back in that time, I dug deep into tons of web-accessible FTP servers which had nuggets of example code files, borrowed olden programming books with CDs filled with source code, perused the old retromac68k hotline server which had MOUNTAINS of software and the occasional code ressources. I have a sample THINK Pascal project folder sitting on my Powerbook 180 which is called SmoothMove. It just moves a sprite across a background very smoothly, doesn't destroy it and seems synced to the retrace timer because as advertised, there's no flicker.

Sadly, it seems it's using libraries that didn't come from whatever source I dug it from. I also don't have THINK Pascal installed and the source file is pretty simple. It calls some external libraries (SATToolbox) but of course, I find no trace of it in my files. All I have to show for it is a least a working executable.

If anyone wants to share a skeleton game engine in C that can compile easily with THINK C, I'd be very grateful. I made some practical library files that sets up the screen by removing the menu bar, creates a grafPort in 512x342 size and can even work in bigger screens by creating it centered instead, with a patterned border around it iirc. I have a bunch of sprite functions that handle all the loading from resource files, or from a custom made .spr8 file type I made which allows for multiple frames of graphics that can loop around. I can't find the software I wrote to make these files, but I should dig around my real dev environment inside Basilisk II on my PC.

 
Last edited by a moderator:

Toni_

Well-known member
There's a couple pages that might be of interest for you:

- Ingemar's SAT page: http://www.lysator.liu.se/~ingemar/sat/sat-downloads.html - has the SAT 2.6 for 68k applications, should work both in THINK C and THINK Pascal 4. However, I don't think there is source code available for it, but it was a widely used graphics library, so it should be pretty stable. (He also has information and guide for THINK Pascal 4.5 at https://www.lysator.liu.se/~ingemar/tp45d4/think.html if that might be of interest).

- SpriteWorld: http://spriteworld.sourceforge.net/ - At least 2.x version has 68k/ppc support, but it only works on 8-, 16- and 32-bit colors to my knowledge. So it would not work on monochrome macs...but it has full source code (including the BlitPixie blitters) included.

I am not sure if either of these fits exactly what you are looking, but they might be useful resources.

 

Mu0n

Well-known member
Well, those links didn't help me directly, but they most certainly helped me indirectly!

I tried a few archives from your linked website from Ingemar and the code is exclusively for Pascal. I don't really fancy porting code from it to C, seems like it's too much work, but it may come handy in very small critical chunks (I'm not brushing it off altogether).

The other unfortunate aspect of his library, even the oldest linked there (2.5.0) targets color macs (I did find THINK Pascal v4.0 in another instance of Basilisk on my laptop but his stuff requires 256-color mode).

Searching for his name did land me back to "Tricks of the Game Programming Gurus" for which he's a contributor. I've come across that book in the past. Thanks to http://vintageapple.org, I can get it very easily. Chapter 0 talks about old b&w animation techniques before going to the "important stuff" (non-important for me) and it's generic enough that I can reproduce it in C. I just need to condense my old routines, buff them up with masks and VBL and I'll get buttery smooth animations over backgrounds.

 
Top