• 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.

Developing for 68k Macs on a modern(ish) Mac?

sega dude

Well-known member
Is it possible to develop for 68k Macs on my MacBook running Mavericks? If now, my iBook G4 or iMac G4 (can boot OS 9) running Tiger? Basically, if possible, I would like to develop for 68k Macs, mostly for System 6 on a Macintosh Plus on a modern(ish) Mac. Is this possible? If so, what tools would I need to use?

 

cb88

Well-known member
grab a copy of Metrowerks Pro 6.0.... and Mac OS no newer than 10.4 Tiger. You can run it in classic mode...you can also copy the compiler tools into Metrowerks Codewarrior Pro 7.0 from what I understand and use that.

Also the guy developing Browsy for system 6 is looking into using Retro64 Gcc from Linux... probably builds on Mac as well there are limitations to that however that have been brought up.

If you want to develop on a 68k mac you'll be in for a long wait to hunt down Metroworks Pro 4 its nearly unobtainuim. (I still haven't gotten a copy of it and I've been looking for awhile)

 
Last edited by a moderator:

Elfen

Well-known member
You can start coding now and compiling later, you will need a minimum of a Text Editor - Text Wrangler is the best for OSX and its System 6/7 counterpart - BBEdit. You can write up the code and save it as text (.txt) file.

Now which environment to program in? C/C++ or 68K Assm? You can try to find MetrWerks Pro or you can use Symantecs C/C++. Codewarrior (6 Pro is the last 68K version) is another C/C++. There are others out there to look for.

You will also need ResEdit or Super ResEdit to built your resource forks.

 
Last edited by a moderator:

sega dude

Well-known member
You can start coding now and compiling later, you will need a minimum of a Text Editor - Text Wrangler is the best for OSX and its System 6/7 counterpart - BBEdit. You can write up the code and save it as text (.txt) file.
I've been wondering if there was a version of Text Wrangler for the classic Mac OS. Do you happen to know the last version of BBEdit that will run on OS 9 that I can use on my PB 1400cs?

 

Elfen

Well-known member
BareBones Inc still has BBEdit for OSX.

But searching the Internet, the freeware version used for System 7 - 8 BBEdit Lite 3.5 can be found. I found it here:

https://www.vulcanhammer.org/downloads/macintosh.php#.VCbkfEZ3zTM

- Scroll down a bit, its like the second item going down.

I have BBEdit Lite 4.0.1 on my system and it works fie on OS 9.22; I just can not find it on the net. BareBones gave up on the Freeware BBEdit Lite on OS 6 - 9 for Text Wrangler on OSX. BBEdit 3.5 should work on OS 9 and 8.

 

cb88

Well-known member
Writing code without a compiler seem pretty impractical... for one the old apis are probably not familar and two incremental development is important to avoiding bugs especially with older compilers.

 

Elfen

Well-known member
Funny you would say that, Cb88. I used to do that all the time in the 1980s and 90s. From punching out punch cards on an IBM Punch Card Typewriter to writing assembly code, doing it on paper by hand and then typing up the code. Then run the program through my head to see if it runs logically. Once I'm satisfied with the code, then I compile it and with my programs, its about 95% bug free. 95% bug free is hard to obtain and many programmers would not want to do this and they end up with buggy software. This is just an exercise in logic, which is easy. I do not know why programers don't do this and assume their work is right when most of the time it is not and then spend hours and hours of debugging the software. Running the code in your head and making corrections as needed saves you (the programmer) for hours of debugging headaches.

 
Last edited by a moderator:

techknight

Well-known member
I used to write and modify direct machine code on the 6805 variants. Until i finally got my hands on an assembler to make use of mnemonics. Made life easier. 

Everytime I added a block of machine code, I had to go and fix all the indirect/relative jump calls because of the now re-arranged addressing from moving things around/adding code. Thank god an assembler does all this for you. 

I used to be real heavy into 6805 programming/hacking back in the day. Not so much anymore. I havent messed with it in a few years. I moved over to AVR. It was funny, I used to dump integrated ROM code from 6805 stuff using a well-placed glitch.  

 
Last edited by a moderator:

Elfen

Well-known member
I did the same thing for 6502, TechKnight. I know EXACTLY what you went through!

 

trag

Well-known member
It was funny, I used to dump integrated ROM code from 6805 stuff using a well-placed glitch.
Wasn't the CUDA ADB controller (341S0788) purported to be a custom 6805 processor? It would be pretty cool if you could pull the code out of one of those. They're found on Macs starting some time around the Quadras and go at least through the PPC Macs.

The supply of scavenged ones must run out eventually. It might be nice to be able to program up a replacement from a 6805 in the proper package.

On the other hand, it appears that sellers on Ali Express have them for sale for $1 - $1.25. Strange. I can't tell if they're new unused stock or used scavenged from old boards stock...

http://www.aliexpress.com/item/341S0788/1884263656.html

 

techknight

Well-known member
Well the trick is the 6805 has to have a command interpreter, the key is to feed in a packet that contains machine code to bitbang a port pin. the glitch is then to bounce into RAM and execute it. 

 

cb88

Well-known member
I agree you should logically understand the code you write....

however..... he asked for a compiler not an assembler and chances are if you are used to new compilers features you take for granted may be completely broken in the old compilers or non existant.

so better to have it on hand from the get go so you can test incrementally as you go along rather than developing the whole program essentially on paper to find out it won't work without a rewrite.

Also I said retro64 earlier when it is acutally Retro68 and apparently its being used to build the Browsy App for system 6. https://github.com/clehner/Browsy

 
Last edited by a moderator:

autc04

Member
Okay, to summarize the tools I know:

1. The latest, free (as in beer) version of MPW, available from Macintosh Garden. Should run under Classic.

Has a C compiler, and a horribly outdated C++ compiler. No C++ standard library.

2. The compilers and libraries from 1., but run from the Mac OS X command line using the MPW emulator: https://github.com/ksherlock/mpw

3. CodeWarrior Pro 4 (hard to find). The C++ compiler is surprisingly decent for its time, but still horribly outdated. A standard library exists, but I doubt it really conforms to the C++98 standard.

4. Various older compilers might run under Classic, too.

5. My own https://github.com/autc04/Retro68 does run on G4s with Tiger. The only way to get *modern* C99 and C++11 for old Macs. Also, definitely a less polished product than the other options. It works, but you may run into bugs and unfinished features at any time.

 

nglevin

Well-known member
Since CWP has already been mentioned a number of times, for convenience's sake, you can grab the patches for any version of CodeWarrior from this mirror; ftp://ftp.cs.tu-berlin.de/pub/mac/lang/Metrowerks/ .

Granted, you're still stuck with a fairly old compiler and IDE with its own unique bugs. But at least you'll be able to bypass a few of those bugs.

 

Bunsen

Admin-Witchfinder-General
MPW is an emulator that lets you run Apple MPW toolkit under OSX and build classic OS apps on a modern environment. Enjoy this informative blog post about it.
mpw is an m68k binary translator/emulator whose sole purpose is to emulate enough of Classic Mac OS to run MPW’s own tools directly on OS X.

...

With the same source file, and only a handful of #ifdefs, I could build the same app for 1984’s System 1.0 all the way up to the current release of OS X, Yosemite.
 
Last edited by a moderator:

Bunsen

Admin-Witchfinder-General
And this looks like it might be useful for testing:

 

GrayBox enables you to run classic Mac apps on Mac OS X... without "Classic"!
 

GrayBox is similar to Apple's BlueBox/Classic. Like Classic, GrayBox interleaves its windows as peers to those of native apps. Unlike Classic, GrayBox runs each app in its own protected memory space.
 

GrayBox runs only early B&W apps.  It uses Mini vMac's M68K emulator.
 
Last edited by a moderator:

VMSZealot

Well-known member
And this looks like it might be useful for testing:
Very Interesting (GrayBox) - but also very dead.  It doesn't seem to have been updated for six years.  I'd love to have an emulator which permitted the running of 68k and PPC Classic apps in an interleaved environment - Classic for modern Macs.  I'd pay for that!

 

PowerPup

Well-known member
If you're looking to emulate a 68k or PCC Mac for emulation, you can always look at Basilisk II (68k) or SheepShaver (PPC). Granted it wouldn't be an interleaved environment, but it does the job.

 

happycube

New member
Executor would be a good alternative to GrayBox then - I don't know if it's been ported to OS X, but it's Free Software (in the rms sense) now.

 
Top