Making a 1-bit game engine

feeef

6502
I am making a game engine for our old B&W Macs. I have posted the full story at Tinker different as it was my main source of inspiration for coding, but I thought I would post about it here too.

You can find the source code at https://gitlab.com/ftech31/classicsprite

It is still a work in progress and there is no documentation at this time. I plan to work on that as I move forward with finalizing the code structure and the syntax. The entire project is released under a free software licence so feel free to use, share, and modify as you wish! I learned a lot during the process so it can also be a source of code example for anyone who wants to learn how to program with 1-bit QuickDraw.

Here is a quick demo of a dummy game that I made with the engine:

 
I am mainly focusing on the graphics at the moment (I still have my mind in optimizing the frame rate) but sound is part of the plan. This project from @Mu0n seems quite advanced in term of sound. We may be able to merge efforts at some point.
 
Here's what I have:
-modal tunes that use the square wave synth in some very old project
-modal tunes that use the four-tone synth in some very old project
-real time manipulation of the wave shape buffer with the mouse for a four-tone synth while it plays
-MIDI in data coming from a piano controller, passing through a serial MIDI interface, and being dissected and correctly interpreted
-MIDI out data correctly dispatched out to an external midi module like the Roland Sound Canvas or Roland MT-32 or any module, of course
-Standard MIDI file opened, dissected and played back programmatically in C to that same midi interface. Basically I mimick what Space Quest III did for its intro sequence music or gameplay music.
-Link MIDI in to the four-tone synth for real time playback

Here's what I'll soon reach:
-use a MIDI in controller as a joystick just for fun
-Link MIDI in to the square wave synth
-Link MIDI in to the freeform synth and play instrument files from Studio Session at arbitrary note values
-Studio Session song file, played back in real time programmatically since it's just a notch more complicated than doing a standard midi file playback
-Use a standard midi file but dispatch it through a four-tone synth by focusing on 4 instruments at most for quick and dirty game music that doesn't require a hardware MIDI interface and a hardware MIDI module.
 
That's awesome @Mu0n ! When looking at your code, I realize that I should rethink my syntax. I am used to naming my function and variables in lower_case and instead, I should go for the camelCase syntax that is used in the entire Toolbox. That will look a lot cleaner.
 
Thanks a lot @maxoakland ! As I said in my previous message, I plan to refactor the syntax so it better aligns with the syntax of the Toolbox and existing libraries. I hope to do that soon when I have a bit more time for it, and I will try to come up with some documentation as well.
 
This is great to see, @feeef, and it’s clear this has been a labour of love. Having read your Tinker Different post as well, it’s impressive the amount of work you’ve gone to in order to familiarise yourself with the Mac Toolbox in purchasing the Inside Macintosh books, etc.

I’ve just started teaching myself C as an absolute beginner with the ultimate aim of trying to make a small game for classic Mac OS, so your efforts are inspirational.

In your research to learn how to code for classic Mac OS, did you come across the book “Tricks of the Mac Game Programming Gurus” by McCornack et al. (1995)? I own a copy and I’m hopeful it will be a useful resource. Also, I may have missed it, but did you work within THINK C or CodeWarrior? Cheers!
 
Back
Top